amino  1.0-beta2
Lightweight Robot Utility Library
traj.h File Reference
#include "state.h"

Go to the source code of this file.

Classes

struct  aa_ct_pt
 Waypoint. More...
 

Macros

#define AA_CT_SEG_IN   1
 
#define AA_CT_SEG_OUT   0
 
#define AA_CT_LIN_SEG   1
 
#define AA_CT_PB_SEG   2
 
#define AA_CT_ACCL_SEG   3
 

Functions

struct aa_ct_pt_list * aa_ct_pt_list_create (struct aa_mem_region *reg)
 Initialize and construct a point list from a memory region. More...
 
void aa_ct_pt_list_add (struct aa_ct_pt_list *list, struct aa_ct_state *state)
 Add a reference to a waypoint to the back of a point list. More...
 
void aa_ct_pt_list_add_front (struct aa_ct_pt_list *list, struct aa_ct_state *state)
 Add a reference to a waypoint to the front of a point list. More...
 
void aa_ct_pt_list_add_qutr (struct aa_ct_pt_list *list, const double E[7])
 Add a quaternion-translation pose to the point list.
 
void aa_ct_pt_list_add_q (struct aa_ct_pt_list *list, size_t n_q, const double *q)
 Add a quaternion-translation position the point list.
 
void aa_ct_pt_list_destroy (struct aa_ct_pt_list *list)
 Destroys an allocated point list. More...
 
const struct aa_ct_stateaa_ct_pt_list_start_state (const struct aa_ct_pt_list *list)
 Return the initial state of the point list.
 
const struct aa_ct_stateaa_ct_pt_list_final_state (const struct aa_ct_pt_list *list)
 Return the final state of the point list.
 
size_t aa_ct_pt_list_size (const struct aa_ct_pt_list *list)
 Return the number of points in the point list.
 
void aa_ct_pt_list_dump (FILE *stream, struct aa_ct_pt_list *list)
 Print out a list of points to a file. More...
 
int aa_ct_seg_list_eval (struct aa_ct_seg_list *list, struct aa_ct_state *state, double t)
 Evaluates a segment list at a given time. More...
 
int aa_ct_seg_list_eval_q (struct aa_ct_seg_list *list, double t, size_t n, double *q)
 Evaluate trajectory and fill configuration array.
 
int aa_ct_seg_list_eval_dq (struct aa_ct_seg_list *list, double t, size_t n, double *q, double *dq)
 Evaluate trajectory and fill configuration and velocity arrays.
 
void aa_ct_seg_list_plot (struct aa_ct_seg_list *list, size_t n_q, double dt)
 Plots a segment list with a given resolution. More...
 
void aa_ct_seg_list_destroy (struct aa_ct_seg_list *list)
 Destroys an allocated segment list. More...
 
size_t aa_ct_seg_list_n_q (const struct aa_ct_seg_list *list)
 Return segment list configuration count.
 
double aa_ct_seg_list_duration (const struct aa_ct_seg_list *list)
 Return duration (time) of segment list.
 
struct aa_ct_seg_list * aa_ct_tjq_pb_generate (struct aa_mem_region *reg, struct aa_ct_pt_list *list, struct aa_ct_limit *limits)
 Generate a parabolic blend trajectory from a point list. More...
 
struct aa_ct_seg_list * aa_ct_tjq_trap_generate (struct aa_mem_region *reg, struct aa_ct_pt_list *list, struct aa_ct_limit *limits)
 Generate a trapezoidal blend trajectory from a point list. More...
 
struct aa_ct_seg_list * aa_ct_tjq_lin_generate (struct aa_mem_region *reg, struct aa_ct_pt_list *list, struct aa_ct_limit *limits)
 Generate a linear trajectory from a point list. More...
 
struct aa_ct_seg_list * aa_ct_tjX_pb_generate (struct aa_mem_region *reg, struct aa_ct_pt_list *list, struct aa_ct_limit *limits)
 Generate a parabolic blend trajectory in the workspace from a point list. More...
 
int aa_ct_seg_list_check (struct aa_ct_seg_list *segs, double dt, int(*function)(void *cx, double t, const struct aa_ct_state *state), void *cx)
 Check the trajectory by evaluting function at points along the trajectory. More...
 
int aa_ct_seg_list_check_c0 (struct aa_ct_seg_list *segs, double dt, double tol, double eps)
 Check C0 (position) continuity of the trajectory. More...
 
struct aa_ct_seg_list * aa_ct_tjx_slerp_generate (struct aa_mem_region *reg, struct aa_ct_pt_list *list)
 Generate a SLERP trajectory from a point list. More...
 

Function Documentation

◆ aa_ct_pt_list_add()

void aa_ct_pt_list_add ( struct aa_ct_pt_list *  list,
struct aa_ct_state state 
)

Add a reference to a waypoint to the back of a point list.

The reference will be kept in the list.

Parameters
listList to add point to
stateState to add to list

◆ aa_ct_pt_list_add_front()

void aa_ct_pt_list_add_front ( struct aa_ct_pt_list *  list,
struct aa_ct_state state 
)

Add a reference to a waypoint to the front of a point list.

The reference will be kept in the list.

Parameters
listList to add point to
stateState to add to list

◆ aa_ct_pt_list_create()

struct aa_ct_pt_list* aa_ct_pt_list_create ( struct aa_mem_region reg)

Initialize and construct a point list from a memory region.

Parameters
regMemory region to allocate from
Returns
A freshly allocated struct aa_ct_pt_list.

◆ aa_ct_pt_list_destroy()

void aa_ct_pt_list_destroy ( struct aa_ct_pt_list *  list)

Destroys an allocated point list.

Parameters
listList to destroy

◆ aa_ct_pt_list_dump()

void aa_ct_pt_list_dump ( FILE *  stream,
struct aa_ct_pt_list *  list 
)

Print out a list of points to a file.

Parameters
streamFile to print to
listPoint list to print

◆ aa_ct_seg_list_check()

int aa_ct_seg_list_check ( struct aa_ct_seg_list *  segs,
double  dt,
int(*)(void *cx, double t, const struct aa_ct_state *state)  function,
void *  cx 
)

Check the trajectory by evaluting function at points along the trajectory.

Parameters
segsThe segment list to check
dtTime intervel between steps to check
functionFunction to check a state, must return 0 if state is valid
Returns
0 if trajectory is valid (function evaluates to zero at each point), otherwise return the return value of function at the non-zero point

◆ aa_ct_seg_list_check_c0()

int aa_ct_seg_list_check_c0 ( struct aa_ct_seg_list *  segs,
double  dt,
double  tol,
double  eps 
)

Check C0 (position) continuity of the trajectory.

Parameters
segsThe segment list to check
dtTime intervel between steps
tolMaximum distance between two steps
epsMaximum distance between final and inital position of subsequent segments
Returns
0 if trajectory is C0 continuous, 1 if the trajectory violates the maximum distance between two steps, 2 if the trajectory violates the maximum distance between final and initial of subsequent segments, non-zero otherwise

◆ aa_ct_seg_list_destroy()

void aa_ct_seg_list_destroy ( struct aa_ct_seg_list *  list)

Destroys an allocated segment list.

Parameters
listList to destroy

◆ aa_ct_seg_list_eval()

int aa_ct_seg_list_eval ( struct aa_ct_seg_list *  list,
struct aa_ct_state state,
double  t 
)

Evaluates a segment list at a given time.

Fills in the provided state struct With the reference state at that time.

Parameters
listSegment list to evaluate
stateState structure to fill in
tTime to evaluate segment list at
Returns
AA_CT_SEG_IN if time is within segment list, AA_CT_SEG_OUT if not.

◆ aa_ct_seg_list_plot()

void aa_ct_seg_list_plot ( struct aa_ct_seg_list *  list,
size_t  n_q,
double  dt 
)

Plots a segment list with a given resolution.

Pipes commands to gnuplot.

Parameters
listSegment list to plot
n_qNumber of configurations
dtTimestep to plot

◆ aa_ct_tjq_lin_generate()

struct aa_ct_seg_list* aa_ct_tjq_lin_generate ( struct aa_mem_region reg,
struct aa_ct_pt_list *  list,
struct aa_ct_limit limits 
)

Generate a linear trajectory from a point list.

Parameters
regRegion to allocate from
listPoint list to build segment list from
limitsState structure with dq and ddq kinematic limits
Returns
An allocated segment list describing a linear trajectory.

◆ aa_ct_tjq_pb_generate()

struct aa_ct_seg_list* aa_ct_tjq_pb_generate ( struct aa_mem_region reg,
struct aa_ct_pt_list *  list,
struct aa_ct_limit limits 
)

Generate a parabolic blend trajectory from a point list.

Parameters
regRegion to allocate from
listPoint list to build segment list from
limitsState structure with dq and ddq kinematic limits
Returns
An allocated segment list describing a parabolic blend trajectory.

◆ aa_ct_tjq_trap_generate()

struct aa_ct_seg_list* aa_ct_tjq_trap_generate ( struct aa_mem_region reg,
struct aa_ct_pt_list *  list,
struct aa_ct_limit limits 
)

Generate a trapezoidal blend trajectory from a point list.

Parameters
regRegion to allocate from
listPoint list to build segment list from
limitsState structure with dq and ddq kinematic limits
Returns
An allocated segment list describing a trapezoidal blend trajectory.

◆ aa_ct_tjX_pb_generate()

struct aa_ct_seg_list* aa_ct_tjX_pb_generate ( struct aa_mem_region reg,
struct aa_ct_pt_list *  list,
struct aa_ct_limit limits 
)

Generate a parabolic blend trajectory in the workspace from a point list.

Parameters
regRegion to allocate from
listPoint list to build segment list from
limitsState structure with dq and ddq kinematic limits
Returns
An allocated segment list describing a parabolic blend trajectory.

◆ aa_ct_tjx_slerp_generate()

struct aa_ct_seg_list* aa_ct_tjx_slerp_generate ( struct aa_mem_region reg,
struct aa_ct_pt_list *  list 
)

Generate a SLERP trajectory from a point list.

Parameters
regRegion to allocate from
listPoint list to build segment list from
Returns
An allocated segment list describing a slerp trajectory.