liba 0.1.15
An algorithm library based on C/C++
Loading...
Searching...
No Matches
trajtrap.h
Go to the documentation of this file.
1
7#ifndef LIBA_TRAJTRAP_H
8#define LIBA_TRAJTRAP_H
9
10#include "a.h"
11
18typedef struct a_trajtrap a_trajtrap;
19
20#if defined(__cplusplus)
21extern "C" {
22#endif /* __cplusplus */
23
52
63A_EXTERN a_float a_trajtrap_pos(a_trajtrap const *ctx, a_float x);
64
74A_EXTERN a_float a_trajtrap_vel(a_trajtrap const *ctx, a_float x);
75
85A_EXTERN a_float a_trajtrap_acc(a_trajtrap const *ctx, a_float x);
86
87#if defined(__cplusplus)
88} /* extern "C" */
89namespace a
90{
91typedef struct a_trajtrap trajtrap;
92} /* namespace a */
93#endif /* __cplusplus */
94
99{
112#if defined(__cplusplus)
113 A_INLINE a_float gen(a_float vm, a_float ac_, a_float de_, a_float p0_, a_float p1_,
114 a_float v0_ = 0, a_float v1_ = 0)
115 {
116 return a_trajtrap_gen(this, vm, ac_, de_, p0_, p1_, v0_, v1_);
117 }
118 A_INLINE a_float pos(a_float x) const
119 {
120 return a_trajtrap_pos(this, x);
121 }
122 A_INLINE a_float vel(a_float x) const
123 {
124 return a_trajtrap_vel(this, x);
125 }
126 A_INLINE a_float acc(a_float x) const
127 {
128 return a_trajtrap_acc(this, x);
129 }
130#endif /* __cplusplus */
131};
132
135#endif /* a/trajtrap.h */
algorithm library
#define a_float
Definition a.h:785
double a_trajtrap_gen(a_trajtrap *ctx, double vm, double ac, double de, double p0, double p1, double v0, double v1)
generate for trapezoidal velocity trajectory
double a_trajtrap_vel(a_trajtrap const *ctx, double x)
calculate velocity for trapezoidal velocity trajectory
double a_trajtrap_acc(a_trajtrap const *ctx, double x)
calculate acceleration for trapezoidal velocity trajectory
double a_trajtrap_pos(a_trajtrap const *ctx, double x)
calculate position for trapezoidal velocity trajectory
instance structure for trapezoidal velocity trajectory
Definition trajtrap.h:99
double p1
final position
Definition trajtrap.h:102
double pd
position after constant velocity
Definition trajtrap.h:109
double pa
position before constant velocity
Definition trajtrap.h:108
double p0
initial position
Definition trajtrap.h:101
double v0
initial velocity
Definition trajtrap.h:103
double ta
time before constant velocity
Definition trajtrap.h:106
double v1
final velocity
Definition trajtrap.h:104
double t
total duration
Definition trajtrap.h:100
double td
time after constant velocity
Definition trajtrap.h:107
double de
acceleration after constant velocity
Definition trajtrap.h:111
double vc
constant velocity
Definition trajtrap.h:105
double ac
acceleration before constant velocity
Definition trajtrap.h:110