liba 0.1.15
An algorithm library based on C/C++
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
Loading...
Searching...
No Matches
trajpoly3.h
Go to the documentation of this file.
1
6
7#ifndef LIBA_TRAJPOLY3_H
8#define LIBA_TRAJPOLY3_H
9
10#include "a.h"
11
17
18typedef struct a_trajpoly3 a_trajpoly3;
19
20#if defined(__cplusplus)
21extern "C" {
22#endif /* __cplusplus */
23
43A_EXTERN void a_trajpoly3_gen(a_trajpoly3 *ctx, a_real ts,
44 a_real p0, a_real p1,
45 a_real v0, a_real v1);
46
52A_EXTERN void a_trajpoly3_c0(a_trajpoly3 const *ctx, a_real c[4]);
53
59A_EXTERN void a_trajpoly3_c1(a_trajpoly3 const *ctx, a_real c[3]);
60
66A_EXTERN void a_trajpoly3_c2(a_trajpoly3 const *ctx, a_real c[2]);
67
79A_EXTERN a_real a_trajpoly3_pos(a_trajpoly3 const *ctx, a_real x);
80
92A_EXTERN a_real a_trajpoly3_vel(a_trajpoly3 const *ctx, a_real x);
93
105A_EXTERN a_real a_trajpoly3_acc(a_trajpoly3 const *ctx, a_real x);
106
107#if defined(__cplusplus)
108} /* extern "C" */
109namespace a
110{
111typedef struct a_trajpoly3 trajpoly3;
112} /* namespace a */
113#endif /* __cplusplus */
114
126{
128#if defined(__cplusplus)
129 A_INLINE void gen(a_real ts, a_real p0, a_real p1,
130 a_real v0 = 0, a_real v1 = 0)
131 {
132 a_trajpoly3_gen(this, ts, p0, p1, v0, v1);
133 }
134 A_INLINE a_real pos(a_real x) const
135 {
136 return a_trajpoly3_pos(this, x);
137 }
138 A_INLINE a_real vel(a_real x) const
139 {
140 return a_trajpoly3_vel(this, x);
141 }
142 A_INLINE a_real acc(a_real x) const
143 {
144 return a_trajpoly3_acc(this, x);
145 }
146 A_INLINE void c0(a_real x[4]) const
147 {
148 a_trajpoly3_c0(this, x);
149 }
150 A_INLINE void c1(a_real x[3]) const
151 {
152 a_trajpoly3_c1(this, x);
153 }
154 A_INLINE void c2(a_real x[2]) const
155 {
156 a_trajpoly3_c2(this, x);
157 }
158#endif /* __cplusplus */
159};
160
162
163#endif /* a/trajpoly3.h */
algorithm library
double a_real
compiler built-in floating-point number type
Definition a.h:1006
void a_trajpoly3_gen(a_trajpoly3 *ctx, a_real ts, a_real p0, a_real p1, a_real v0, a_real v1)
generate for cubic polynomial trajectory
void a_trajpoly3_c1(a_trajpoly3 const *ctx, a_real c[3])
compute coefficients of velocity for cubic polynomial trajectory
void a_trajpoly3_c2(a_trajpoly3 const *ctx, a_real c[2])
compute coefficients of acceleration for cubic polynomial trajectory
a_real a_trajpoly3_pos(a_trajpoly3 const *ctx, a_real x)
compute position for cubic polynomial trajectory
a_real a_trajpoly3_vel(a_trajpoly3 const *ctx, a_real x)
compute velocity for cubic polynomial trajectory
void a_trajpoly3_c0(a_trajpoly3 const *ctx, a_real c[4])
compute coefficients of position for cubic polynomial trajectory
a_real a_trajpoly3_acc(a_trajpoly3 const *ctx, a_real x)
compute acceleration for cubic polynomial trajectory
instance structure for cubic polynomial trajectory
Definition trajpoly3.h:126
a_real c[4]
Definition trajpoly3.h:127