-
Notifications
You must be signed in to change notification settings - Fork 1
/
trajectorysender.h
executable file
·64 lines (53 loc) · 1.73 KB
/
trajectorysender.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
64
#ifndef TRAJECTORYSENDER_H
#define TRAJECTORYSENDER_H
#include <QObject>
#include <QThread>
#include <QVector>
#include "sendcommand.h"
#include "inversekinematicscore.h"
class TrajectorySender : public QThread
{
Q_OBJECT
public:
explicit TrajectorySender(QString fileName, int numberOfDrive,QObject *parent = nullptr);
TrajectorySender(double x_start, double y_start,double z_start,
double x_end, double y_end, double z_end);
TrajectorySender();
int getNumberOfPoint();
int getTimeOfTrajectory();
void loadPointFromCsv();
void testLinear();
void ptpCore(double inverse_start_output[],double inverse_end_output[],InverseKinematicsCore core);
void sendPointsToDrives(QVector<QVector<double>> &points_for_drives);
void sendPointsToDrives();
static bool isDistanceZero(double start_drive1,double end_drive1,
double start_drive2,double end_drive2,
double start_drive3,double end_drive3);
protected:
void run();
signals:
void finishedLoading(int number_of_points,int time);
void startedSendingPoints();
void startedSendingArrayPoints();
void finishedSendingPoints();
void finishedSendingArrayPoints();
public slots:
void startSendingArrayPointsSlot();
private:
int numberOfPoint = 0;
int numberOfDrive = 0;
bool is_initiated = 0;
bool is_in_kinematics_state = 0;
bool go_home_for_all_drives=0;
double x_start;
double y_start;
double z_start;
double x_end;
double y_end;
double z_end;
int NUMBER_OF_motorpuls =524288;
QVector<QVector<double>> loadedPoints;
QVector<QVector<double>> arrayPoints;
QString trajectoryFilePath;
};
#endif // TRAJECTORYSENDER_H