fastcat 0.13.15
C++ EtherCAT Device Command & Control Library
Loading...
Searching...
No Matches
Classes | Enumerations | Functions
trap.h File Reference
#include <stdint.h>
Include dependency graph for trap.h:

Go to the source code of this file.

Classes

struct  fastcat_trap_t
 

Enumerations

enum  fastcat_trap_mode_t { FASTCAT_TRAP_MODE_IDLE = 0 , FASTCAT_TRAP_MODE_RATE , FASTCAT_TRAP_MODE_POS }
 

Functions

int fastcat_trap_generate (fastcat_trap_t *self, double t_init, double pos_init, double pos_fini, double vel_init, double vel_fini, double max_vel, double acc)
 Sets up math for creating a simple trapezoidal position profile.
 
int fastcat_trap_update (fastcat_trap_t *self, double t, double *pos, double *vel)
 
int fastcat_trap_generate_vel (fastcat_trap_t *self, double t_init_sec, double pos_init, double vel_init, double vel_fini, double acc, double max_time)
 
int fastcat_trap_update_vel (fastcat_trap_t *self, double t, double *pos, double *vel)
 

Enumeration Type Documentation

◆ fastcat_trap_mode_t

Enumerator
FASTCAT_TRAP_MODE_IDLE 
FASTCAT_TRAP_MODE_RATE 
FASTCAT_TRAP_MODE_POS 

Function Documentation

◆ fastcat_trap_generate()

int fastcat_trap_generate ( fastcat_trap_t self,
double  t_init_sec,
double  pos_init,
double  pos_fini,
double  vel_init,
double  vel_fini,
double  vel_max,
double  acc 
)

Sets up math for creating a simple trapezoidal position profile.

Parameters
selftrap main object
t_init_secinitial absolute time in seconds
pos_initinitial position for the profile
pos_finifinal position for the profile
vel_initinitial velocity for the profile
vel_finifinal velocity for the profile
vel_maxcruising speed for the profile
accmax acceleration/deceleration for the profile
Returns
0 on success, -1 on failure

< initial velocity

< final velocity

< cruising ("max") velocity

< total distance from initial to final

< acceleration time from initial to max

< decleration time from max to final

< acceleration distance from initial to max

< deceleration distance from max to final

< initial position

< final position

< total time for constant velocity phase (cruising time)

< distance travelled during constant velocity phase (cruising distance)

< min value

< actual capped max velocity in order to not overshoot during a non-trapezoidal profile

< total distance (including direction)

< initial velocity

< final velocity

< acceleration magnitude. direction is enforced elsewhere

◆ fastcat_trap_generate_vel()

int fastcat_trap_generate_vel ( fastcat_trap_t self,
double  t_init_sec,
double  pos_init,
double  vel_init,
double  vel_fini,
double  acc,
double  max_time 
)

◆ fastcat_trap_update()

int fastcat_trap_update ( fastcat_trap_t self,
double  t,
double *  pos,
double *  vel 
)
Here is the caller graph for this function:

◆ fastcat_trap_update_vel()

int fastcat_trap_update_vel ( fastcat_trap_t self,
double  t,
double *  pos,
double *  vel 
)