-Each subsystem on our robot (turret, drivetrain, ramp device, etc) is an object/class in our code. Each has an "operator_update" function called in teleop where inputs on the joysticks are given - this allows for all calculations and commands to be handled in each class.
Piece of Main Teleop Loop:
Code:
Launcher->UpdateLaunch_Operator(turretStick->GetTrigger(),turretStick->GetRawButton(6));
-An autonomous object is used in our code as well. Inside of the class, the routines are comprised of single-line commands such as "LaunchBall", "GyroTurn(angle)", and "SetWheelState(state)".
-An autonomous routine would look like this:
Code:
void AutoController::AUTO_Layup()
{
Shooter->SetState(state_RPM)
SetShooter(1550);
Drive_GyroEnc(.6f,0.0f,450);
SetTurret(-45.0f);
IntakeOn();
FullLaunch();
WaitForBall();
FullLaunch();
}
In the main Autonomous Loop:
Code:
if(DIP_1 == 1)
{
AutonController->AUTO_Layup();
}
else.....
-Functions on the robot are all condensed to one-button commands (like the 254 auto-score).
-We use bitbucket for source control.