release 0.1.13
[liba.git] / lua / src / trajtrap.h
blob47a48f2c0636d663fd1720cd7d2bab6d2e4fc1cf
1 /***
2 trapezoidal velocity trajectory
3 @classmod a.trajtrap
4 */
6 #ifndef LUA_LIBA_TRAJTRAP_H
7 #define LUA_LIBA_TRAJTRAP_H
9 #include "a.h"
11 /***
12 trapezoidal velocity trajectory
13 @field t total duration
14 @field p0 initial position
15 @field p1 final position
16 @field v0 initial velocity
17 @field v1 final velocity
18 @field vc constant velocity
19 @field ta time before constant velocity
20 @field td time after constant velocity
21 @field pa position before constant velocity
22 @field pd position after constant velocity
23 @field ac acceleration before constant velocity
24 @field de acceleration after constant velocity
25 @table a.trajtrap
27 #if defined(__cplusplus)
28 extern "C" {
29 #endif /* __cplusplus */
31 /***
32 constructor for trapezoidal velocity trajectory
33 @treturn a.trajtrap trapezoidal velocity trajectory userdata
34 @function new
36 int liba_trajtrap_new(lua_State *L);
38 /***
39 generate for trapezoidal velocity trajectory
40 @tparam number vm defines the maximum velocity during system operation
41 @tparam number ac defines the acceleration before constant velocity
42 @tparam number de defines the acceleration after constant velocity
43 @tparam number p0 defines the initial position
44 @tparam number p1 defines the final position
45 @tparam[opt] number v0 defines the initial velocity
46 @tparam[opt] number v1 defines the final velocity
47 @treturn number total duration
48 @function gen
50 int liba_trajtrap_gen(lua_State *L);
52 /***
53 calculate position for trapezoidal velocity trajectory
54 @tparam number x difference between current time and initial time
55 @treturn number position output
56 @function pos
58 int liba_trajtrap_pos(lua_State *L);
60 /***
61 calculate velocity for trapezoidal velocity trajectory
62 @tparam number x difference between current time and initial time
63 @treturn number velocity output
64 @function vel
66 int liba_trajtrap_vel(lua_State *L);
68 /***
69 calculate acceleration for trapezoidal velocity trajectory
70 @tparam number x difference between current time and initial time
71 @treturn number acceleration output
72 @function acc
74 int liba_trajtrap_acc(lua_State *L);
76 #if defined(__cplusplus)
77 } /* extern "C" */
78 #endif /* __cplusplus */
80 #endif /* trajtrap.h */