-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathArmBuilder.h
65 lines (50 loc) · 1.56 KB
/
ArmBuilder.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
65
#ifndef ARM_BUILDER_H
#define ARM_BUILDER_H
#include "Gripper.h"
#include "MultiStepper.h"
#include "RobotArmJoint.h"
#include "Structures.h"
class ArmBuilder
{
private:
RobotArmJoint mBase;
RobotArmJoint mShoulder;
RobotArmJoint mElbow;
RobotArmJoint mWristRotate;
RobotArmJoint mWrist;
Gripper mGripper;
MultiStepper mMultiStepper;
protected:
long getNormalizedValue(const long value);
float calculateTimeToPosition(const long position, const long target, const float speed);
float findMaxInArray(const float* array, const int32_t size);
float mSpeedMultiplier = 1;
float mAccelerationMultiplier = 1;
bool mSyncMotors = false;
public:
ArmBuilder();
void init();
void goTo(const JointPositions& jp);
void goToSyncMultiStepper(const JointPositions& jp);
void goToSync(const JointPositions& jp);
void move(const JointPositions& jp);
void setSpeed(const float speed);
void setAcceleration(const float acceleration);
void setZeroPosition();
void setSpeeds(const JointSpeeds& jp);
void setAccelerations(const JointAccelerations& ja);
bool isSyncEnabled();
void setSyncMotors(const bool sync);
bool reachedPositions(const JointPositions& jp);
JointPositions getPositions();
JointAccelerations getAccelerations();
JointSpeeds getSpeeds();
RobotArmJoint& getBase();
RobotArmJoint& getShoulder();
RobotArmJoint& getElbow();
RobotArmJoint& getWristRotate();
RobotArmJoint& getWrist();
Gripper& getGripper();
};
// This is the end of the header guard
#endif