-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFeeder.h
70 lines (57 loc) · 1.47 KB
/
Feeder.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
66
67
68
69
70
#ifndef FEEDER_H
#define FEEDER_H
#include "WPILib.h"
#include "Controllers.h"
#include "PIDControl.h"
#include "Profile.h"
class Feeder
{
public:
enum FEEDER_STATE
{
FEEDER_STATE_HOME = 1,
FEEDER_STATE_DOWN = 2,
FEEDER_STATE_INIT = 3
};
Feeder(Controllers* driverInput, int feederArmInput, int feederWheelInput, int feederAngleAnalog);
void GetInputs();
void SetOutputs();
void ExecStep();
float GetAngle();
void SetState(FEEDER_STATE state);
Victor* GetWheel();
//static const float MIN_FEEDER_ANGLE = 32.0;
//static const float MAX_FEEDER_ANGLE = 135.0;
static const float HOME_FEEDER_ANGLE = 95.0;
//static const float FEEDER_STOP_OUT_ANGLE = 50.0;
//static const float FEEDER_STOP_IN_ANGLE = 95.0;
static const float DOWN_FEEDER_ANGLE = 42.0;
//static const float HOLD_FEEDER_ANGLE = 130.0;
Victor* feederArm;
Victor* feederWheel;
private:
PIDController* ArmPID;
Controllers* driverInput;
AnalogChannel* feederAnglePotentiometer;
float feederAngle;
FEEDER_STATE feederState;
float feederAngleMotorSpeed;
float feederWheelMotorSpeed;
float GetVoltageFromAngle(float angle);
float PrevFeederArmAngle;
float CurrFeederArmSpeed;
float TargetFeederArmSpeed;
float K1;
bool LeftButtonPressed;
bool RightButtonPressed;
bool EjectButtonPressed;
bool EjectButtonFront;
bool FireButtonPressed;
Timer* timer;
Profile profile;
PIDControl pidControl;
float GetAngleFromVoltage(float voltage);
float angles[5];
int arrayIndex;
};
#endif