fastcat 0.13.15
C++ EtherCAT Device Command & Control Library
Loading...
Searching...
No Matches
trap.h
Go to the documentation of this file.
1#ifndef FASTCAT_FASTCAT_TRAP_H_
2#define FASTCAT_FASTCAT_TRAP_H_
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <stdint.h>
9
15
16typedef struct {
17 double pos_init;
18 double pos_pre;
20 double pos_acc;
21 double pos_dec;
22 double pos_fini;
23
24 double vel_max;
25 double acc;
26 double acc_pre;
28 double dec;
29
30 double t_init;
31 double t_pre;
33 double t_acc;
34 double t_dec;
35 double t_fini;
36
37 double vel_init;
38 double vel_fini;
39
40 double vel_pre;
41 double vel_acc;
42
43 int mode;
44
46
47int fastcat_trap_generate(fastcat_trap_t* self, double t_init, double pos_init,
48 double pos_fini, double vel_init, double vel_fini,
49 double max_vel, double acc);
50
51int fastcat_trap_update(fastcat_trap_t* self, double t, double* pos,
52 double* vel);
53
54int fastcat_trap_generate_vel(fastcat_trap_t* self, double t_init_sec,
55 double pos_init, double vel_init, double vel_fini,
56 double acc, double max_time);
57
58int fastcat_trap_update_vel(fastcat_trap_t* self, double t, double* pos,
59 double* vel);
60
61#ifdef __cplusplus
62}
63#endif
64
65#endif
Definition trap.h:16
double t_fini
absolute time of the end of the trajectory
Definition trap.h:35
double vel_pre
velocity after the initial phase
Definition trap.h:40
double pos_fini
absolute position of the end of the trajectory
Definition trap.h:22
double vel_fini
velocity at the end of the trajectory
Definition trap.h:38
double dec
deceleration of the trajectory
Definition trap.h:28
double vel_init
velocity at the start of the trajectory
Definition trap.h:37
double t_dec
absolute time when the deceleration phase starts
Definition trap.h:34
double pos_acc
absolute position when accelration phase is complete
Definition trap.h:20
double pos_init
absolute position of the start of the trajectory
Definition trap.h:17
double vel_acc
velocity after the accel phase
Definition trap.h:41
double pos_pre
Definition trap.h:18
double pos_dec
absolute position when decleration phase start
Definition trap.h:21
double t_pre
Definition trap.h:31
int mode
Definition trap.h:43
double t_acc
absolute time when acceleration phase is complete
Definition trap.h:33
double acc_pre
Definition trap.h:26
double acc
acceleration of the trajectory
Definition trap.h:25
double vel_max
maximum velocity of the trajectory
Definition trap.h:24
double t_init
absolute time of the start of the trajectory
Definition trap.h:30
int fastcat_trap_update_vel(fastcat_trap_t *self, double t, double *pos, double *vel)
Definition trap.c:486
int fastcat_trap_update(fastcat_trap_t *self, double t, double *pos, double *vel)
Definition trap.c:391
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)
Definition trap.c:436
fastcat_trap_mode_t
Definition trap.h:10
@ FASTCAT_TRAP_MODE_RATE
Definition trap.h:12
@ FASTCAT_TRAP_MODE_POS
Definition trap.h:13
@ FASTCAT_TRAP_MODE_IDLE
Definition trap.h:11
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.
Definition trap.c:107