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
Primitive< Dim > Class Template Reference

Primitive class. More...

#include <primitive.h>

Public Member Functions

 Primitive ()
 Empty constructor.
 
 Primitive (const Waypoint< Dim > &p, const VecDf &u, decimal_t t)
 Construct from an initial state p and an input control u for a given duration t. More...
 
 Primitive (const Waypoint< Dim > &p1, const Waypoint< Dim > &p2, decimal_t t)
 Construct from an initial state p1 and a goal state p2 for a given duration t.
 
 Primitive (const vec_E< Vec6f > &cs, decimal_t t, Control::Control control)
 Construct from given coefficients and duration $t$. More...
 
Waypoint< Dim > evaluate (decimal_t t) const
 Return Waypoint at time $t$. More...
 
decimal_t t () const
 Return duration $t$.
 
Control::Control control () const
 Get the control indicator.
 
Primitive1D pr (int k) const
 Get the 1D primitive. More...
 
Primitive1D pr_yaw () const
 Get the yaw primitive.
 
decimal_t max_vel (int k) const
 Return max velocity along one axis. More...
 
decimal_t max_acc (int k) const
 Return max accleration along one axis. More...
 
decimal_t max_jrk (int k) const
 Return max jerk along k-th dimension.
 
decimal_t J (const Control::Control &control) const
 Return total efforts for the given duration. More...
 
decimal_t Jyaw () const
 Return total yaw efforts for the given duration.
 
vec_E< Waypoint< Dim > > sample (int N) const
 Sample N+1 Waypoints using uniformed time.
 

Public Attributes

decimal_t t_
 Duration.
 
Control::Control control_
 Control.
 
std::array< Primitive1D, Dim > prs_
 By default, primitive class contains Dim 1D primitive.
 
Primitive1D pr_yaw_
 Primitive for yaw.
 

Detailed Description

template<int Dim>
class Primitive< Dim >

Primitive class.

Contains $n$ 1D primitives corresponding to each axis individually.

Constructor & Destructor Documentation

◆ Primitive() [1/2]

template<int Dim>
Primitive< Dim >::Primitive ( const Waypoint< Dim > &  p,
const VecDf u,
decimal_t  t 
)
inline

Construct from an initial state p and an input control u for a given duration t.

if the dimension of u is greater than p, use the additional value for yaw control

◆ Primitive() [2/2]

template<int Dim>
Primitive< Dim >::Primitive ( const vec_E< Vec6f > &  cs,
decimal_t  t,
Control::Control  control 
)
inline

Construct from given coefficients and duration $t$.

Note: flag use_xxx is not set in this constructor

Member Function Documentation

◆ evaluate()

template<int Dim>
Waypoint<Dim> Primitive< Dim >::evaluate ( decimal_t  t) const
inline

Return Waypoint at time $t$.

Note: flag use_xxx is set in the return value and it is equal to the first given Waypoint

◆ J()

template<int Dim>
decimal_t Primitive< Dim >::J ( const Control::Control control) const
inline

Return total efforts for the given duration.

Parameters
controleffort is defined as $i$-th derivative of polynomial

Return J is the summation of efforts in all three dimensions and $J(i) = \int_0^t |p^{i}(t)|^2dt$

◆ max_acc()

template<int Dim>
decimal_t Primitive< Dim >::max_acc ( int  k) const
inline

Return max accleration along one axis.

Parameters
kindicates the corresponding axis: 0-x, 1-y, 2-z

◆ max_vel()

template<int Dim>
decimal_t Primitive< Dim >::max_vel ( int  k) const
inline

Return max velocity along one axis.

Parameters
kindicates the corresponding axis: 0-x, 1-y, 2-z

◆ pr()

template<int Dim>
Primitive1D Primitive< Dim >::pr ( int  k) const
inline

Get the 1D primitive.

Parameters
kindicates the corresponding axis: 0-x, 1-y, 2-z

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