-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDroneArm.h
59 lines (45 loc) · 1.28 KB
/
DroneArm.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
///////////////////////////////////////////
//
// DroneArm
// Author: Jose Maria Aguilar
// Modified: Pablo R.S.
//
///////////////////////////////////////////
// Interface with arm mounted on the drone (vigus grvc us).
#ifndef DRONEARM_DRONEARM_H_
#define DRONEARM_DRONEARM_H_
#include "VarSpeedServo.h"
#include <math.h>
const double pi = 3.14159265359;
class DroneArm{
public:
bool setup();
void speed(const int _speed);
int speed();
void move(const double &_x,const double &_y, const double &_z);
void openGripper();
void closeGripper();
void stopGripper();
void home();
private:
bool inverseKinematic(const double _target[3], double _joints[4]);
private:
const double mHumerus = 13.5;
const double mRadius = 28;
VarSpeedServo mServo1, // Yaw
mServo2, // pitch 1
mServo3, // pitch 2
mServo4, // Wirst
mServo5; // gripper
int mOffset1 = 90,
mOffset2 = 0,
mOffset3 = 0,
mOffset4 = 100,
mOffset5 = 90;
// Loseness of the servos 2 and 3 due to gravity.
const int mLosenessServo2 = 15;
const int mLosenessServo3 = 15;
// Default speed of servos.
int mSpeed = 10;
};
#endif // DRONEARM_DRONEARM_H_