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

Data Structures

struct  a_trajpoly5
 instance structure for quintic polynomial trajectory More...
 

Macros

#define A_TRAJPOLY5   3
 

Typedefs

typedef struct a_trajpoly5 a_trajpoly5
 

Functions

void a_trajpoly5_gen (a_trajpoly5 *ctx, double ts, double p0, double p1, double v0, double v1, double a0, double a1)
 generate for quintic polynomial trajectory
 
void a_trajpoly5_gen0 (a_trajpoly5 *ctx, double ts, double p0, double p1, double v0, double v1, double a0, double a1)
 
void a_trajpoly5_gen1 (a_trajpoly5 *ctx)
 
void a_trajpoly5_gen2 (a_trajpoly5 *ctx)
 
double a_trajpoly5_pos (a_trajpoly5 const *ctx, double x)
 calculate position for quintic polynomial trajectory
 
double a_trajpoly5_vel (a_trajpoly5 const *ctx, double x)
 calculate velocity for quintic polynomial trajectory
 
double a_trajpoly5_acc (a_trajpoly5 const *ctx, double x)
 calculate acceleration for quintic polynomial trajectory
 

Detailed Description

Function Documentation

◆ a_trajpoly5_acc()

double a_trajpoly5_acc ( a_trajpoly5 const * ctx,
double x )

calculate acceleration for quintic polynomial trajectory

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

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

◆ a_trajpoly5_gen()

void a_trajpoly5_gen ( a_trajpoly5 * ctx,
double ts,
double p0,
double p1,
double v0,
double v1,
double a0,
double a1 )

generate for quintic 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{a_{0}}{2}\\ c_{3}=\cfrac{\left(a_{1}-3\,a_{0}\right)\,t^2+\left(-12\,v_{0}-8\,v_{1}\right)\,t+20\,p}{2\,t^3}\\ c_{4}=\cfrac{\left(3\,a_{0}-2\,a_{1}\right)\,t^2+\left(16\,v_{0}+14\,v_{1}\right)\,t-30\,p}{2\,t^4}\\ c_{5}=\cfrac{\left(a_{1}-a_{0}\right)\,t^2+\left(-6\,v_{0}-6\,v_{1}\right)\,t+12\,p}{2\,t^5} \end{array}\right. \end{aligned}

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

◆ a_trajpoly5_pos()

double a_trajpoly5_pos ( a_trajpoly5 const * ctx,
double x )

calculate position for quintic 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}+c_{4}\left(t-t_{0}\right)^{4}+c_{5}\left(t-t_{0}\right)^{5}\\ \end{array} \end{aligned}

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

◆ a_trajpoly5_vel()

double a_trajpoly5_vel ( a_trajpoly5 const * ctx,
double x )

calculate velocity for quintic 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}+4 c_{4}\left(t-t_{0}\right)^{3}+5 c_{5}\left(t-t_{0}\right)^{4}\\ \end{array} \end{aligned}

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