-
Notifications
You must be signed in to change notification settings - Fork 1
/
TrajectoryGenerator.h
51 lines (41 loc) · 1.53 KB
/
TrajectoryGenerator.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
/*
Written by Ahmet Ihsan KOSE, Istanbul, Turkey
Contact [email protected]
*/
#pragma once
#include <vector>
#include "FirFilter.h"
#include "BiquadFilter.h"
class TrajectoryGenerator
{
public:
TrajectoryGenerator(std::vector<float> &kinematicConstraints);
~TrajectoryGenerator() = default;
std::vector<float> getTimeVecOut() const { return TimeVecOut; }
void generateTrajectory(const float &samplingTime);
std::vector<float> getTrajectoryPositions() const { return TrajectoryPositions; }
std::vector<float> getTrajectoryVelocities() const { return TrajectoryVelocities; }
std::vector<float> getTrajectoryAccelerations() const { return TrajectoryAccelerations; }
std::vector<float> getTrajectoryJerk() const { return TrajectoryJerk; }
private:
void setKinematicConstraints(std::vector<float> &kinematicConstraints);
std::vector<float> checkConstraints(const std::vector<float> &timeVecIn);
std::vector<float> generateCoefficents(int length, float sampleTime); // this coefficient for the trajectory generation
private:
float MaxDistance;
float MaxVelocity;
float MaxAcceleration;
float MaxJerk;
std::vector<float> KinematicConstraints;
private:
float InitialPosition;
float FinalPosition;
float SamplingTime;
float TotalDuration;
private:
std::vector<float> TimeVecOut;
std::vector<float> TrajectoryPositions;
std::vector<float> TrajectoryVelocities;
std::vector<float> TrajectoryAccelerations;
std::vector<float> TrajectoryJerk;
};