-
Notifications
You must be signed in to change notification settings - Fork 24
/
scurve.h
83 lines (53 loc) · 1.54 KB
/
scurve.h
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
#ifndef SCURVE_H
#define SCURVE_H
#include "iostream"
#include "chrono"
//! This shared library is written by Skynet Cyberdyne.
//! No green pass is required to use this software, just use your mind.
class Scurve
{
public:
Scurve();
struct RESULT{
//! Displacement result.
double sr=0;
//! Velocity result.
double vr=0;
//! Acceleration result.
double ar=0;
//! Curve time.
double ct=0;
//! Curve displacment.
double cs=0;
//! Error.
bool error=0;
};
//! Inputs:
//! at_time=request displacment at a certain time stamp.
//! vs=velocity max.
//! cs=curve displacement
RESULT scurve_lineair(double at_time, double vs, double cs);
//! Inputs:
//! sct=scurve type [0=acc, 1=dcc]
//! vo=velocity start
//! vs=velocity max
//! ve=velocity end
//! am=acceleration max
//! acs=acceleration start
//! ace=acceleration end
//! Results:
//! at_time=request curve at [t]
RESULT scurve_acc_dcc(int sct, double vo, double ve, double am, double acs, double ace, double at_time);
//! Inputs:
//! vs=velocity max.
//! am=acceleration max.
//! vo=velocity begin.
//! acs=acceleration begin.
//! ltot=pathlenght.
//! ve=velocity end.
//! ace=acceleration end.
//! at_time=curve request at time [t]
RESULT motion(double vs, double am, double vo, double acs, double ltot, double ve, double ace, double at_time);
void example();
};
#endif // SCURVE_H