Ravens Robotics FRC 2015
MecanumDrive.h
Go to the documentation of this file.
1 
9 #ifndef SRC_MECANUMDRIVE_H_
10 #define SRC_MECANUMDRIVE_H_
11 
12 #include <RobotComponent.h>
13 #include <SmoothAxis.h>
14 #include <AllRobotControls.h>
15 
25 public:
26  MecanumDrive();
27  virtual ~MecanumDrive();
28 
32  virtual void ComponentInit();
33 
38  virtual void Sense();
39 
58  virtual void DoWork();
59 
70  virtual void SetSmoothAccel(bool enable);
71 
77  bool isSmoothAccel() const {
78  return m_SmoothAccel;
79  }
80 
91  void setSmoothAccel(bool smoothAccel) {
92  m_SmoothAccel = smoothAccel;
93  }
94 
100  bool isGyroEnabled() const {
101  return m_gyroEnabled;
102  }
103 
113  void setGyroEnabled(bool gyroEnabled);
114 
115 private:
116  Joystick *m_DriveStick;
117  RobotDrive *m_Drive;
119  *m_ValueY,
120  *m_ValueRotate;
121  Gyro *m_Gyro;
122  JoystickButton *m_GyroButton;
125  float m_gyroAngle;
127 };
128 
129 #endif /* SRC_MECANUMDRIVE_H_ */
virtual ~MecanumDrive()
virtual void SetSmoothAccel(bool enable)
Joystick * m_DriveStick
joystick controller
Definition: MecanumDrive.h:116
bool isGyroEnabled() const
Definition: MecanumDrive.h:100
void setGyroEnabled(bool gyroEnabled)
SmoothAxis * m_ValueX
left/right speed [-1.0..1.0]
Definition: MecanumDrive.h:118
bool isSmoothAccel() const
Definition: MecanumDrive.h:77
SmoothAxis * m_ValueRotate
Rate of rotation [-1.0..1.0].
Definition: MecanumDrive.h:118
bool m_SmoothAccel
State of smooth acceleration capability.
Definition: MecanumDrive.h:126
float m_gyroAngle
Gyroscope angle measurement.
Definition: MecanumDrive.h:125
Header file for Robot Component base class.
Gyro * m_Gyro
Gyroscope instance to measure robot's heading.
Definition: MecanumDrive.h:121
SmoothAxis * m_ValueY
fwd/bkwd speed, inverted [-1.0..1.0]
Definition: MecanumDrive.h:118
virtual void ComponentInit()
JoystickButton * m_GyroButton
Button to dis/enable gyro.
Definition: MecanumDrive.h:122
virtual void Sense()
bool m_gyroEnabled
Gyroscope enablement.
Definition: MecanumDrive.h:124
void setSmoothAccel(bool smoothAccel)
Definition: MecanumDrive.h:91
Header file of helper class for Drive RobotComponents.
Header file for Robot Controller / Joystick mapping.
bool m_GyroButtonIsPressed
Button state.
Definition: MecanumDrive.h:123
virtual void DoWork()
RobotDrive * m_Drive
drive instance
Definition: MecanumDrive.h:117