DeepSpace  2019
PullArm.cpp
Go to the documentation of this file.
1 //< Manual arm override
2 #include "Commands/PullArm.h"
4 #include "Robot.h"
5 
7  Requires(Robot::m_Arm);
8  Requires(Robot::m_CrawlDrive);
10 }
11 
12 // Called just before this Command runs the first time
14  //set Speed Multiplyer
15  this->speedMultiplier = 1;
16  //set Speed
17  this->speed = 0.0;
18 }
19 
20 // Called repeatedly when this Command is scheduled to run
22  this->speed =(this->pJoyDebug->GetY(Hand::kLeftHand));
23 
24  Robot::m_Arm->MoveArm(this->speed);
25 
26  Robot::m_CrawlDrive->Move(this->pJoyDebug->GetTriggerAxis(Hand::kRightHand) - this->pJoyDebug->GetTriggerAxis(Hand::kLeftHand));
27 }
28 
29 // Make this return true when this Command no longer needs to run execute()
30 bool PullArm::IsFinished() { return ClimbManager::CurrentClimbState == ClimbManager::ClimbState::kActive; }
31 
32 // Called once after isFinished returns true
33 void PullArm::End() {}
34 
35 // Called when another command which requires one or more of the same
36 // subsystems is scheduled to run
static CrawlDrive * m_CrawlDrive
Pointer for the DriveTrain.
Definition: Robot.h:65
double speed
Definition: PullArm.h:31
static Arm * m_Arm
Pointer for the Arm.
Definition: Robot.h:66
PullArm()
Class constructor.
Definition: PullArm.cpp:6
bool IsFinished() override
Definition: PullArm.cpp:30
double speedMultiplier
Definition: PullArm.h:29
frc::XboxController * pJoyDebug
Definition: PullArm.h:33
void Interrupted() override
Runs once if the command is forced to stop.
Definition: PullArm.cpp:37
void Initialize() override
Runs once on initalization.
Definition: PullArm.cpp:13
static OI * m_oi
Pointer for the Operator Interface (OI)
Definition: Robot.h:68
void Move(double Speed)
Drive, (or crawl), forwards or backwards Moves the wheels attached to the arms. What wheels do...
Definition: CrawlDrive.cpp:32
void End() override
Runs once when IsFinished() returns true.
Definition: PullArm.cpp:33
frc::XboxController * GetJoystickDebug(void)
Definition: OI.cpp:18
static ClimbState CurrentClimbState
Definition: ClimbManager.h:15
void MoveArm(double Speed)
Move Arm arm up or down.
Definition: Arm.cpp:37
void Execute() override
Called in a loop during Teleop.
Definition: PullArm.cpp:21