liba 0.1.15
An algorithm library based on C/C++
Loading...
Searching...
No Matches
trajbell.h
Go to the documentation of this file.
1
7#ifndef LIBA_TRAJBELL_H
8#define LIBA_TRAJBELL_H
9
10#include "a.h"
11
18typedef struct a_trajbell a_trajbell;
19
20#if defined(__cplusplus)
21extern "C" {
22#endif /* __cplusplus */
23
61
80A_EXTERN a_float a_trajbell_pos(a_trajbell const *ctx, a_float x);
81
99A_EXTERN a_float a_trajbell_vel(a_trajbell const *ctx, a_float x);
100
118A_EXTERN a_float a_trajbell_acc(a_trajbell const *ctx, a_float x);
119
137A_EXTERN a_float a_trajbell_jer(a_trajbell const *ctx, a_float x);
138
139#if defined(__cplusplus)
140} /* extern "C" */
141namespace a
142{
143typedef struct a_trajbell trajbell;
144} /* namespace a */
145#endif /* __cplusplus */
146
151{
166#if defined(__cplusplus)
167 A_INLINE a_float gen(a_float jm_, a_float am_, a_float vm_, a_float p0_, a_float p1_,
168 a_float v0_ = 0, a_float v1_ = 0)
169 {
170 return a_trajbell_gen(this, jm_, am_, vm_, p0_, p1_, v0_, v1_);
171 }
172 A_INLINE a_float pos(a_float x) const
173 {
174 return a_trajbell_pos(this, x);
175 }
176 A_INLINE a_float vel(a_float x) const
177 {
178 return a_trajbell_vel(this, x);
179 }
180 A_INLINE a_float acc(a_float x) const
181 {
182 return a_trajbell_acc(this, x);
183 }
184 A_INLINE a_float jer(a_float x) const
185 {
186 return a_trajbell_jer(this, x);
187 }
188#endif /* __cplusplus */
189};
190
193#endif /* a/trajbell.h */
algorithm library
#define a_float
Definition a.h:785
double a_trajbell_jer(a_trajbell const *ctx, double x)
calculate jerk for bell-shaped velocity trajectory
double a_trajbell_acc(a_trajbell const *ctx, double x)
calculate acceleration for bell-shaped velocity trajectory
double a_trajbell_gen(a_trajbell *ctx, double jm, double am, double vm, double p0, double p1, double v0, double v1)
generate for bell-shaped velocity trajectory
double a_trajbell_vel(a_trajbell const *ctx, double x)
calculate velocity for bell-shaped velocity trajectory
double a_trajbell_pos(a_trajbell const *ctx, double x)
calculate position for bell-shaped velocity trajectory
instance structure for bell-shaped velocity trajectory
Definition trajbell.h:151
double vm
maximum velocity
Definition trajbell.h:162
double p1
final position
Definition trajbell.h:159
double ta
acceleration phase
Definition trajbell.h:154
double taj
time-interval in which the jerk is constant (j max or j min ) during the acceleration phase
Definition trajbell.h:156
double am
maximum acceleration
Definition trajbell.h:164
double v0
initial velocity
Definition trajbell.h:160
double tv
constant velocity phase
Definition trajbell.h:153
double tdj
time-interval in which the jerk is constant (j max or j min ) during the deceleration phase
Definition trajbell.h:157
double p0
initial position
Definition trajbell.h:158
double dm
maximum deceleration
Definition trajbell.h:165
double td
deceleration phase
Definition trajbell.h:155
double jm
maximum jerk
Definition trajbell.h:163
double v1
final velocity
Definition trajbell.h:161
double t
total duration
Definition trajbell.h:152