create regress_simple for JavaScript
[liba.git] / lua / src / trajbell.h
blob98869529291fe57448657da2e8368f5fae5e1480
1 /***
2 bell-shaped velocity trajectory
3 @classmod a.trajbell
4 */
6 #ifndef LUA_LIBA_TRAJBELL_H
7 #define LUA_LIBA_TRAJBELL_H
9 #include "a.h"
11 /***
12 bell-shaped velocity trajectory
13 @field t total duration
14 @field tv constant velocity phase
15 @field ta acceleration phase
16 @field td deceleration phase
17 @field taj time-interval in which the jerk is constant (j max or j min ) during the acceleration phase
18 @field tdj time-interval in which the jerk is constant (j max or j min ) during the deceleration phase
19 @field p0 initial position
20 @field p1 final position
21 @field v0 initial velocity
22 @field v1 final velocity
23 @field vm maximum velocity
24 @field jm maximum jerk
25 @field am maximum acceleration
26 @field dm maximum deceleration
27 @table a.trajbell
29 #if defined(__cplusplus)
30 extern "C" {
31 #endif /* __cplusplus */
33 /***
34 constructor for bell-shaped velocity trajectory
35 @treturn a.trajbell bell-shaped velocity trajectory userdata
36 @function new
38 int liba_trajbell_new(lua_State *L);
40 /***
41 generate for bell-shaped velocity trajectory
42 @tparam number jm defines the maximum jerk during system operation
43 @tparam number am defines the maximum acceleration during system operation
44 @tparam number vm defines the maximum velocity during system operation
45 @tparam number p0 defines the initial position
46 @tparam number p1 defines the final position
47 @tparam[opt] number v0 defines the initial velocity
48 @tparam[opt] number v1 defines the final velocity
49 @treturn number total duration
50 @function gen
52 int liba_trajbell_gen(lua_State *L);
54 /***
55 calculate position for bell-shaped velocity trajectory
56 @tparam number x difference between current time and initial time
57 @treturn number position output
58 @function pos
60 int liba_trajbell_pos(lua_State *L);
62 /***
63 calculate velocity for bell-shaped velocity trajectory
64 @tparam number x difference between current time and initial time
65 @treturn number velocity output
66 @function vel
68 int liba_trajbell_vel(lua_State *L);
70 /***
71 calculate acceleration for bell-shaped velocity trajectory
72 @tparam number x difference between current time and initial time
73 @treturn number acceleration output
74 @function acc
76 int liba_trajbell_acc(lua_State *L);
78 /***
79 calculate jerk for bell-shaped velocity trajectory
80 @tparam number x difference between current time and initial time
81 @treturn number jerk output
82 @function jer
84 int liba_trajbell_jer(lua_State *L);
86 #if defined(__cplusplus)
87 } /* extern "C" */
88 #endif /* __cplusplus */
90 #endif /* trajbell.h */