-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRobotArm.h
49 lines (34 loc) · 1.01 KB
/
RobotArm.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
#ifndef ROBOT_ARM_H__
#define ROBOT_ARM_H__
#include "CANJaguar.h"
#include "Potentiometer.h"
#include "MotionProfile.h"
class RobotArm
{
static int ArmState;
public:
static void Init();
static void Process();
static void RobotArm::ScheduleMovement(float, float);
static float GetPosition(){ return (m_pot == NULL) ? 2.5 : m_pot->PIDGet(); }
static float GetCommandedPosition() {
return (m_pid == NULL ? 2.5 : m_pid->GetSetpoint());
}
static int GetState() {
return ArmState;
}
static bool DoneWithMove() { return m_pid->OnTarget(); }
private:
RobotArm() { } // This is a singleton.
static CANJaguar * m_motor;
static Potentiometer * m_pot;
static PIDController * m_pid;
static Timer * m_motion_timer;
static float m_start_position;
static float m_end_position;
static float m_time_to_move;
static bool m_manual_override_last;
static MotionProfile * m_motion_profile;
static float CalculateNeutralTorque(float angle);
};
#endif