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