DeepSpace  2019
PullLeg.cpp
Go to the documentation of this file.
1 //< Manual leg override
2 #include "Commands/PullLeg.h"
4 #include "Robot.h"
5 
7  Requires(Robot::m_Leg);
9 }
10 
11 // Called just before this Command runs the first time
13  //set Speed
14  this->speed = 0.0;
15 }
16 
17 // Called repeatedly when this Command is scheduled to run
19  this->speed = this->pJoyDebug->GetY(Hand::kRightHand);
20 
21  if(frc::RobotController::GetUserButton()){
22  this->speed = 1;
23  }
24 
25  Robot::m_Leg->MoveLeg(this->speed);
26 }
27 
28 // Make this return true when this Command no longer needs to run execute()
29 bool PullLeg::IsFinished() { return ClimbManager::CurrentClimbState == ClimbManager::ClimbState::kActive; }
30 
31 // Called once after isFinished returns true
32 void PullLeg::End() {}
33 
34 // Called when another command which requires one or more of the same
35 // subsystems is scheduled to run
void MoveLeg(double Speed)
Move climb leg up or down.
Definition: Leg.cpp:23
bool IsFinished() override
Definition: PullLeg.cpp:29
frc::XboxController * pJoyDebug
Definition: PullLeg.h:33
void Interrupted() override
Runs once if the command is forced to stop.
Definition: PullLeg.cpp:36
static OI * m_oi
Pointer for the Operator Interface (OI)
Definition: Robot.h:68
void End() override
Runs once when IsFinished() returns true.
Definition: PullLeg.cpp:32
double speed
Definition: PullLeg.h:31
PullLeg()
Class constructor.
Definition: PullLeg.cpp:6
frc::XboxController * GetJoystickDebug(void)
Definition: OI.cpp:18
static ClimbState CurrentClimbState
Definition: ClimbManager.h:15
void Execute() override
Called in a loop during Teleop.
Definition: PullLeg.cpp:18
static Leg * m_Leg
Pointer for the Leg.
Definition: Robot.h:67
void Initialize() override
Runs once on initalization.
Definition: PullLeg.cpp:12