liba 0.1.15
An algorithm library based on C/C++
Loading...
Searching...
No Matches
cubic polynomial trajectory
Collaboration diagram for cubic polynomial trajectory:

Data Structures

struct  a_trajpoly3
 instance structure for cubic polynomial trajectory More...
 

Macros

#define A_TRAJPOLY3   3
 

Typedefs

typedef struct a_trajpoly3 a_trajpoly3
 

Functions

void a_trajpoly3_gen (a_trajpoly3 *ctx, double ts, double p0, double p1, double v0, double v1)
 generate for cubic polynomial trajectory
 
void a_trajpoly3_gen0 (a_trajpoly3 *ctx, double ts, double p0, double p1, double v0, double v1)
 
void a_trajpoly3_gen1 (a_trajpoly3 *ctx)
 
void a_trajpoly3_gen2 (a_trajpoly3 *ctx)
 
double a_trajpoly3_pos (a_trajpoly3 const *ctx, double x)
 calculate position for cubic polynomial trajectory
 
double a_trajpoly3_vel (a_trajpoly3 const *ctx, double x)
 calculate velocity for cubic polynomial trajectory
 
double a_trajpoly3_acc (a_trajpoly3 const *ctx, double x)
 calculate acceleration for cubic polynomial trajectory
 

Detailed Description

Function Documentation

◆ a_trajpoly3_acc()

double a_trajpoly3_acc ( a_trajpoly3 const * ctx,
double x )

calculate acceleration for cubic polynomial trajectory

\begin{aligned} \begin{array}{l} \ddot{p}(t)=2 c_{2}+6 c_{3}\left(t-t_{0}\right) \end{array} \end{aligned}

Parameters
[in]ctxpoints to an instance of cubic polynomial trajectory
[in]xdifference between current time and initial time
Returns
acceleration output

◆ a_trajpoly3_gen()

void a_trajpoly3_gen ( a_trajpoly3 * ctx,
double ts,
double p0,
double p1,
double v0,
double v1 )

generate for cubic polynomial trajectory

\begin{aligned} \left\{\begin{array}{l} t=t_{1}-t_{0}\\ p=p_{1}-p_{0}\\ c_{0}=p_{0}\\ c_{1}=v_{0}\\ c_{2}=\cfrac{\left(-2\,v_{0}-v_{1}\right)\,t+3\,p}{t^2}\\ c_{3}=\cfrac{\left(v_{0}+v_{1}\right)\,t-2\,p}{t^3} \end{array}\right. \end{aligned}

Parameters
[in,out]ctxpoints to an instance of cubic polynomial trajectory
[in]tsdifference between final time and initial time
[in]p0initial position
[in]p1final position
[in]v0initial velocity
[in]v1final velocity

◆ a_trajpoly3_pos()

double a_trajpoly3_pos ( a_trajpoly3 const * ctx,
double x )

calculate position for cubic polynomial trajectory

\begin{aligned} \begin{array}{l} p(t)=c_{0}+c_{1}\left(t-t_{0}\right)+c_{2}\left(t-t_{0}\right)^{2}+c_{3}\left(t-t_{0}\right)^{3} \\ \end{array} \end{aligned}

Parameters
[in]ctxpoints to an instance of cubic polynomial trajectory
[in]xdifference between current time and initial time
Returns
position output

◆ a_trajpoly3_vel()

double a_trajpoly3_vel ( a_trajpoly3 const * ctx,
double x )

calculate velocity for cubic polynomial trajectory

\begin{aligned} \begin{array}{l} \dot{p}(t)=c_{1}+2 c_{2}\left(t-t_{0}\right)+3 c_{3}\left(t-t_{0}\right)^{2} \\ \end{array} \end{aligned}

Parameters
[in]ctxpoints to an instance of cubic polynomial trajectory
[in]xdifference between current time and initial time
Returns
velocity output