![]() |
1516X High Stakes 2.0
Codebase for 1516X High Stakes season
|
The Autonomous class contains classes and functions related to the robot's autonomous behavior. More...
#include <auton.h>
Public Types | |
enum | AUTON_ROUTINE { RED_NEG = 1 , RED_POS = 2 , RED_POS_LATE_RUSH = 3 , BLUE_POS = -1 , BLUE_POS_LATE_RUSH = -2 , BLUE_NEG = -3 , SKILLS = 0 } |
Public Member Functions | |
void | AutoDrive (Intake &intake, Latch &latch, Sweeper &sweeper, DistanceSensor &distance, LadyBrown &ladybrown) |
Drives the robot autonomously. | |
Static Public Member Functions | |
static void | AutonSwitcher (int autonNum) |
Switches the autonomous program. | |
Static Public Attributes | |
static AUTON_ROUTINE | auton = RED_POS |
Sets the number of the autonomous program to use. | |
static std::string | autonName = "Red Positive" |
The name of the autonomous program. | |
Private Member Functions | |
void | RedNeg (Intake &intake, Latch &latch, DistanceSensor &distance) |
Runs the autonomous path for the far side defensive game strategy. | |
void | RedPos (Intake &intake, Latch &latch, Sweeper &sweeper, DistanceSensor &distance, LadyBrown &ladybrown) |
Runs the autonomous path for the near side offensive game strategy. | |
void | RedPosLateGoalRush (Intake &intake, Latch &latch, Sweeper &sweeper, DistanceSensor &distance, LadyBrown &ladybrown) |
void | BluePos (Intake &intake, Latch &latch, Sweeper &sweeper, DistanceSensor &distance, LadyBrown &ladybrown) |
Runs the puncher routine for the Skills Challenge. | |
void | BluePosLateGoalRush (Intake &intake, Latch &latch, Sweeper &sweeper, DistanceSensor &distance, LadyBrown &ladybrown) |
void | BlueNeg (Intake &intake, Latch &latch, DistanceSensor &distance) |
Runs the autonomous path for the far side offensive game strategy. This function executes the autonomous path for the far side offensive game strategy. It contains the specific actions and movements required for this strategy. | |
void | Skills (Intake &intake, Latch &latch, DistanceSensor &distance, LadyBrown &ladybrown) |
The Autonomous class contains classes and functions related to the robot's autonomous behavior.
We use Lemlib extensively for our documentation. You can find the documentation for Lemlib at Lemlib documentation.
Enumerator | |
---|---|
RED_NEG | |
RED_POS | |
RED_POS_LATE_RUSH | |
BLUE_POS | |
BLUE_POS_LATE_RUSH | |
BLUE_NEG | |
SKILLS |
Definition at line 18 of file auton.h.
void Autonomous::AutoDrive | ( | Intake & | intake, |
Latch & | latch, | ||
Sweeper & | sweeper, | ||
DistanceSensor & | distance, | ||
LadyBrown & | ladybrown ) |
Drives the robot autonomously.
This function drives the robot autonomously based on the selected autonomous program. It takes a reference to a Puncher object and a boolean value indicating whether to use autonomous mode.
puncher | A reference to the Puncher object. |
autono | A boolean value indicating whether to use autonomous mode. |
Definition at line 295 of file autons.cpp.
References auton, autonName, BLUE_NEG, BLUE_POS, BLUE_POS_LATE_RUSH, BlueNeg(), BluePos(), BluePosLateGoalRush(), RED_NEG, RED_POS, RED_POS_LATE_RUSH, RedNeg(), RedPos(), RedPosLateGoalRush(), SKILLS, and Skills().
|
static |
Switches the autonomous program.
This function switches the autonomous program to the next available program. It allows the user to cycle through different autonomous programs during runtime.
Definition at line 331 of file autons.cpp.
References auton, autonName, BLUE_NEG, BLUE_POS, BLUE_POS_LATE_RUSH, RED_NEG, RED_POS, RED_POS_LATE_RUSH, and SKILLS.
Runs the autonomous path for the far side offensive game strategy. This function executes the autonomous path for the far side offensive game strategy. It contains the specific actions and movements required for this strategy.
Definition at line 277 of file autons.cpp.
References Robot::Globals::chassis(), Robot::Globals::drive_(), Robot::Globals::HookMotor(), Robot::Globals::IntakeMotor(), and Robot::Globals::LatchControl().
Referenced by AutoDrive().
|
private |
Runs the puncher routine for the Skills Challenge.
This function executes the puncher routine for the Skills Challenge. It takes a reference to a Puncher object and performs the necessary actions for the challenge.
puncher | A reference to the Puncher object. |
Definition at line 81 of file autons.cpp.
References Robot::Globals::chassis(), Robot::Globals::drive_(), Robot::Globals::HookMotor(), Robot::Globals::IntakeMotor(), Robot::LadyBrown::LOAD_STATE, Robot::LadyBrown::MoveToPoint(), Robot::Globals::SweeperControl(), and Robot::Latch::toggle().
Referenced by AutoDrive().
|
private |
Definition at line 124 of file autons.cpp.
References Robot::Globals::chassis(), Robot::Globals::drive_(), Robot::Globals::HookMotor(), Robot::Globals::IntakeMotor(), and Robot::Latch::toggle().
Referenced by AutoDrive().
Runs the autonomous path for the far side defensive game strategy.
This function executes the autonomous path for the far side defensive game strategy. It contains the specific actions and movements required for this strategy.
Definition at line 22 of file autons.cpp.
References Robot::Globals::chassis(), Robot::Globals::drive_(), Robot::Globals::HookMotor(), Robot::Globals::IntakeMotor(), and Robot::Globals::LatchControl().
Referenced by AutoDrive().
|
private |
Runs the autonomous path for the near side offensive game strategy.
This function executes the autonomous path for the near side offensive game strategy. It contains the specific actions and movements required for this strategy.
Definition at line 39 of file autons.cpp.
References Robot::Globals::chassis(), Robot::Globals::drive_(), Robot::Globals::HookMotor(), Robot::Globals::IntakeMotor(), Robot::LadyBrown::LOAD_STATE, Robot::LadyBrown::MoveToPoint(), Robot::Globals::SweeperControl(), and Robot::Latch::toggle().
Referenced by AutoDrive().
|
private |
Definition at line 199 of file autons.cpp.
References Robot::Globals::chassis(), Robot::Globals::drive_(), Robot::Globals::HookMotor(), Robot::Globals::IntakeMotor(), and Robot::Latch::toggle().
Referenced by AutoDrive().
|
private |
Executes the Skills challenge autonomous.
This function controls the robot's actions during autonomous routine 5. It takes references to the Intake
and Latch
objects as parameters.
Definition at line 13 of file skills.cpp.
References Robot::LadyBrown::ATTACK_STATE, Robot::LadyBrown::BASE_STATE, Robot::Globals::chassis(), Robot::Globals::colorSensor(), Robot::Globals::drive_(), Robot::Globals::HookMotor(), Robot::Globals::IntakeMotor(), Robot::Globals::LatchControl(), Robot::LadyBrown::LOAD_STATE, and Robot::LadyBrown::MoveToPoint().
Referenced by AutoDrive().
|
static |
Sets the number of the autonomous program to use.
This function allows the user to specify the autonomous program to be executed by the robot. The autonomous program number determines the specific actions and movements the robot will perform.
auton | The number of the autonomous program to use. |
Definition at line 28 of file auton.h.
Referenced by AutoDrive(), autonomous(), and AutonSwitcher().
|
static |
The name of the autonomous program.
This variable stores the name of the autonomous program currently selected. It is handled by the switching functions and the screen.
Definition at line 35 of file auton.h.
Referenced by AutoDrive(), and AutonSwitcher().