liba 0.1.15
An algorithm library based on C/C++
Loading...
Searching...
No Matches
trajpoly5.h
Go to the documentation of this file.
1
7#ifndef LIBA_TRAJPOLY5_H
8#define LIBA_TRAJPOLY5_H
9
10#include "a.h"
11
18typedef struct a_trajpoly5 a_trajpoly5;
19
20#if !defined A_TRAJPOLY5
21#define A_TRAJPOLY5 3
22#endif /* A_TRAJPOLY5 */
23#if defined(__cplusplus)
24extern "C" {
25#endif /* __cplusplus */
26
50A_EXTERN void a_trajpoly5_gen(a_trajpoly5 *ctx, a_float ts,
51 a_float p0, a_float p1,
52 a_float v0, a_float v1,
53 a_float a0, a_float a1);
54A_EXTERN void a_trajpoly5_gen0(a_trajpoly5 *ctx, a_float ts,
55 a_float p0, a_float p1,
56 a_float v0, a_float v1,
57 a_float a0, a_float a1);
58#if defined(A_TRAJPOLY5) && (A_TRAJPOLY5 + 0 > 1)
59A_EXTERN void a_trajpoly5_gen1(a_trajpoly5 *ctx);
60#endif /* A_TRAJPOLY5 */
61#if defined(A_TRAJPOLY5) && (A_TRAJPOLY5 + 0 > 2)
62A_EXTERN void a_trajpoly5_gen2(a_trajpoly5 *ctx);
63#endif /* A_TRAJPOLY5 */
64
77
78#if defined(A_TRAJPOLY5) && (A_TRAJPOLY5 + 0 > 1)
91#endif /* A_TRAJPOLY5 */
92
93#if defined(A_TRAJPOLY5) && (A_TRAJPOLY5 + 0 > 2)
106#endif /* A_TRAJPOLY5 */
107
108#if defined(__cplusplus)
109} /* extern "C" */
110namespace a
111{
112typedef struct a_trajpoly5 trajpoly5;
113} /* namespace a */
114#endif /* __cplusplus */
115
127{
129#if defined(A_TRAJPOLY5) && (A_TRAJPOLY5 + 0 > 1)
131#endif /* A_TRAJPOLY5 */
132#if defined(A_TRAJPOLY5) && (A_TRAJPOLY5 + 0 > 2)
134#endif /* A_TRAJPOLY5 */
135#if defined(__cplusplus)
136 A_INLINE void gen(a_float ts, a_float p0, a_float p1,
137 a_float v0 = 0, a_float v1 = 0,
138 a_float a0 = 0, a_float a1 = 0)
139 {
140 a_trajpoly5_gen(this, ts, p0, p1, v0, v1, a0, a1);
141 }
142 A_INLINE void gen0(a_float ts, a_float p0, a_float p1,
143 a_float v0 = 0, a_float v1 = 0,
144 a_float a0 = 0, a_float a1 = 0)
145 {
146 a_trajpoly5_gen0(this, ts, p0, p1, v0, v1, a0, a1);
147 }
148 A_INLINE a_float pos(a_float x) const
149 {
150 return a_trajpoly5_pos(this, x);
151 }
152#if defined(A_TRAJPOLY5) && (A_TRAJPOLY5 + 0 > 1)
153 A_INLINE void gen1() { a_trajpoly5_gen1(this); }
154 A_INLINE a_float vel(a_float x) const
155 {
156 return a_trajpoly5_vel(this, x);
157 }
158#endif /* A_TRAJPOLY5 */
159#if defined(A_TRAJPOLY5) && (A_TRAJPOLY5 + 0 > 2)
160 A_INLINE void gen2() { a_trajpoly5_gen2(this); }
161 A_INLINE a_float acc(a_float x) const
162 {
163 return a_trajpoly5_acc(this, x);
164 }
165#endif /* A_TRAJPOLY5 */
166#endif /* __cplusplus */
167};
168
171#endif /* a/trajpoly5.h */
algorithm library
#define a_float
Definition a.h:785
void a_trajpoly5_gen(a_trajpoly5 *ctx, double ts, double p0, double p1, double v0, double v1, double a0, double a1)
generate for quintic polynomial trajectory
double a_trajpoly5_acc(a_trajpoly5 const *ctx, double x)
calculate acceleration for quintic polynomial trajectory
double a_trajpoly5_vel(a_trajpoly5 const *ctx, double x)
calculate velocity for quintic polynomial trajectory
double a_trajpoly5_pos(a_trajpoly5 const *ctx, double x)
calculate position for quintic polynomial trajectory
instance structure for quintic polynomial trajectory
Definition trajpoly5.h:127
double a[4]
coefficients of acceleration
Definition trajpoly5.h:133
double v[5]
coefficients of velocity
Definition trajpoly5.h:130
double p[6]
coefficients of position
Definition trajpoly5.h:128