1516X High Stakes 2.0
Codebase for 1516X High Stakes season
Loading...
Searching...
No Matches
auton.cpp
Go to the documentation of this file.
1#include "robot/auton.h"
2#include "main.h" // IWYU pragma: export
3
4using namespace Robot;
5using namespace Robot::Globals;
6
8std::string Autonomous::autonName;
9
10// Red Left
11void Autonomous::Auton1(Intake &intake, Latch &latch, DistanceSensor &distance) {}
12
13// Red Right
14void Autonomous::Auton2(Intake &intake, Latch &latch, DistanceSensor &distance) {}
15
16// Blue left
17void Autonomous::Auton3(Intake &intake, Latch &latch, DistanceSensor &distance) {}
18
19/*
20 * @todo Flesh out this method before the competition in order to make it a full
21 * solo awp autonomous. Blue right
22 */
23void Autonomous::Auton4(Intake &intake, Latch &latch, DistanceSensor &distance) {}
24
25void Autonomous::Auton5(Intake &intake, Latch &latch, DistanceSensor &distance) {
26 // Autonomous routine for the Skills challenge
27}
28
29// Takes in two parameters: The autonomous value as well as the puncher object.
30void Autonomous::AutoDrive(Intake &intake, Latch &latch, DistanceSensor &distance) {
31 // Keep the switcher running while the controller down button has not been pressed and the time period is not
32 // autonomous Compare the current auton value to run the auton routine
33 switch (Autonomous::auton) {
34 case RED_LEFT:
35 Auton1(intake, latch, distance);
36 break;
37 case RED_RIGHT:
38 Auton2(intake, latch, distance);
39 break;
40 case BLUE_LEFT:
41 Auton3(intake, latch, distance);
42 break;
43 case BLUE_RIGHT:
44 Auton4(intake, latch, distance);
45 break;
46 case SKILLS:
47 Auton5(intake, latch, distance);
48 break;
49 }
50}
51
52void Autonomous::AutonSwitcher(int autonNum) {
53 switch (autonNum) {
54 case 1:
55 Autonomous::autonName = "Red Left";
57 break;
58 case 2:
59 Autonomous::autonName = "Red Right";
61 break;
62 case -1:
63 Autonomous::autonName = "Blue Left";
65 break;
66 case -2:
67 Autonomous::autonName = "Blue Right";
69 break;
70 case 0:
71 Autonomous::autonName = "Skills";
73 }
74 std::cout << "Current auton: " + Autonomous::autonName << std::endl;
75}
void Auton2(Intake &intake, Latch &latch, DistanceSensor &distance)
Runs the autonomous path for the near side offensive game strategy.
Definition auton.cpp:14
void Auton1(Intake &intake, Latch &latch, DistanceSensor &distance)
Runs the autonomous path for the far side defensive game strategy.
Definition auton.cpp:11
static std::string autonName
The name of the autonomous program.
Definition auton.h:33
void Auton3(Intake &intake, Latch &latch, DistanceSensor &distance)
Runs the puncher routine for the Skills Challenge.
Definition auton.cpp:17
void Auton4(Intake &intake, Latch &latch, DistanceSensor &distance)
Runs the autonomous path for the far side offensive game strategy. This function executes the autonom...
Definition auton.cpp:23
static AUTON_ROUTINE auton
Sets the number of the autonomous program to use.
Definition auton.h:26
void Auton5(Intake &intake, Latch &latch, DistanceSensor &distance)
Definition auton.cpp:25
static void AutonSwitcher(int autonNum)
Switches the autonomous program.
Definition auton.cpp:52
void AutoDrive(Intake &intake, Latch &latch, DistanceSensor &distance)
Drives the robot autonomously.
Definition auton.cpp:30
The Intake class represents a robot intake system.
Definition intake.h:8
The Latch class represents a latching mechanism.
Definition latch.h:8
Definition auton.h:8