MRSL Motion Primitive Library  1.2
A motion primitive library for generating trajectory for mobile robots
Public Member Functions | Public Attributes | List of all members
Primitive1D Class Reference

Primitive1D class. More...

#include <primitive.h>

Public Member Functions

 Primitive1D ()
 Empty constructor.
 
 Primitive1D (const Vec6f &coeff)
 Construct from known coefficients. More...
 
 Primitive1D (decimal_t p, decimal_t u)
 Construct 1D primitive from an initial state (p) and an input control (u)
 
 Primitive1D (Vec2f state, decimal_t u)
 
 Primitive1D (Vec3f state, decimal_t u)
 
 Primitive1D (Vec4f state, decimal_t u)
 
 Primitive1D (decimal_t p1, decimal_t p2, decimal_t t)
 
 Primitive1D (decimal_t p1, decimal_t v1, decimal_t p2, decimal_t v2, decimal_t t)
 
 Primitive1D (decimal_t p1, decimal_t v1, decimal_t a1, decimal_t p2, decimal_t v2, decimal_t a2, decimal_t t)
 
decimal_t J (decimal_t t, const Control::Control &control) const
 Return total efforts of 1D primitive for the given duration: $J(t, i) = \int_0^t |p^{i}(t)|^2dt$. More...
 
Vec6f coeff () const
 Return coffecients.
 
decimal_t p (decimal_t t) const
 Return $p$ at time $t$.
 
decimal_t v (decimal_t t) const
 Return $v$ at time $t$.
 
decimal_t a (decimal_t t) const
 Return $a$ at time $t$.
 
decimal_t j (decimal_t t) const
 Return $j$ at time $t$.
 
std::vector< decimal_textrema_v (decimal_t t) const
 Return vector of time $t$ for velocity extrema. More...
 
std::vector< decimal_textrema_a (decimal_t t) const
 Return vector of time $t$ for acceleration extrema. More...
 
std::vector< decimal_textrema_j (decimal_t t) const
 Return vector of time $t$ for jerk extrema. More...
 

Public Attributes

Vec6f c {Vec6f::Zero()}
 Coefficients.
 

Detailed Description

Primitive1D class.

Assume the 1D primitive is the n-th order polynomial with n = 5 as $p(t) = \frac{c(0)}{120}t^5+\frac{c(1)}{24}t^4+\frac{c(2)}{6}t^3+\frac{c(3)}{2}t^2+c(4)t+c(5) = 0$

Constructor & Destructor Documentation

◆ Primitive1D() [1/7]

Primitive1D::Primitive1D ( const Vec6f coeff)
inline

Construct from known coefficients.

Parameters
coeff[0]is the coefficient of the highest order

◆ Primitive1D() [2/7]

Primitive1D::Primitive1D ( Vec2f  state,
decimal_t  u 
)
inline

Construct 1D primitive from an initial state (p, v) and an input control (u)

◆ Primitive1D() [3/7]

Primitive1D::Primitive1D ( Vec3f  state,
decimal_t  u 
)
inline

Construct 1D primitive from an initial state (p, v, a) and an input control (u)

◆ Primitive1D() [4/7]

Primitive1D::Primitive1D ( Vec4f  state,
decimal_t  u 
)
inline

Construct 1D primitive from an initial state (p, v, a, j) and an input control (u)

◆ Primitive1D() [5/7]

Primitive1D::Primitive1D ( decimal_t  p1,
decimal_t  p2,
decimal_t  t 
)
inline

Construct 1D primitive from an initial state (p1) to a goal state (p2), given duration t

◆ Primitive1D() [6/7]

Primitive1D::Primitive1D ( decimal_t  p1,
decimal_t  v1,
decimal_t  p2,
decimal_t  v2,
decimal_t  t 
)
inline

Construct 1D primitive from an initial state (p1, v1) to a goal state (p2, v2), given duration t

◆ Primitive1D() [7/7]

Primitive1D::Primitive1D ( decimal_t  p1,
decimal_t  v1,
decimal_t  a1,
decimal_t  p2,
decimal_t  v2,
decimal_t  a2,
decimal_t  t 
)
inline

Construct 1D primitive from an initial state (p1, v1, a1) to a goal state (p2, v2, a2), given duration t

Member Function Documentation

◆ extrema_a()

std::vector<decimal_t> Primitive1D::extrema_a ( decimal_t  t) const
inline

Return vector of time $t$ for acceleration extrema.

Accelerations at both ends (0, t) are not considered

◆ extrema_j()

std::vector<decimal_t> Primitive1D::extrema_j ( decimal_t  t) const
inline

Return vector of time $t$ for jerk extrema.

Jerks at both ends (0, t) are not considered

◆ extrema_v()

std::vector<decimal_t> Primitive1D::extrema_v ( decimal_t  t) const
inline

Return vector of time $t$ for velocity extrema.

Velocities at both ends (0, t) are not considered

◆ J()

decimal_t Primitive1D::J ( decimal_t  t,
const Control::Control control 
) const
inline

Return total efforts of 1D primitive for the given duration: $J(t, i) = \int_0^t |p^{i}(t)|^2dt$.

Parameters
tassume the duration is from 0 to t
controleffort is defined as $i$-th derivative of polynomial

The documentation for this class was generated from the following file: