Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
Semi-final autos done
Browse files Browse the repository at this point in the history
  • Loading branch information
superrm11 committed Apr 23, 2024
1 parent 2bbfebb commit fb81f5d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .vscode/vex_project_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"project": {
"name": "Jover_AutoTest",
"description": "",
"creationDate": "Sun, 07 Apr 2024 18:45:59 GMT",
"creationDate": "Tue, 23 Apr 2024 00:59:37 GMT",
"platform": "V5",
"language": "cpp",
"slot": 8,
Expand Down
17 changes: 14 additions & 3 deletions src/competition/autonomous.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,20 @@ class DebugCommand : public AutoCommand {
}
};

// #define ELIMS

void awp_auto() {

static std::atomic<bool> end_vision_scan(false);
// clang-format off
DebugCommand *tempend = new DebugCommand();

static int vis_tball_num = 0;
#ifdef ELIMS
#define END_EARLY_TIME 40
#else
#define END_EARLY_TIME 37

#endif
CommandController cmd{
// ================ INIT ================
odom.SetPositionCmd({.x=22, .y=21, .rot=225}),
Expand Down Expand Up @@ -299,7 +304,7 @@ void awp_auto() {
cata_sys.Unintake(),
drive_sys.DriveForwardCmd(100, FWD, 0.5)->withTimeout(1),
cata_sys.StopIntake(),
drive_sys.DriveToPointCmd({94,43}, REV),
drive_sys.DriveToPointCmd({94,47}, REV),
new FunctionCommand(light_on),
drive_sys.TurnToHeadingCmd(90),

Expand All @@ -312,16 +317,22 @@ void awp_auto() {
}, (new IfTimePassed(END_EARLY_TIME))->Or(new FunctionCondition([]()->bool{return end_vision_scan;})))),

new FunctionCommand(light_off),
#ifdef ELIMS
drive_sys.TurnToHeadingCmd(305),
drive_sys.DriveToPointCmd({122, 14}, FWD),
drive_sys.TurnToHeadingCmd(55),
#else
// ================ GO TO BAR AWP ================
// drive_sys.TurnToHeadingCmd(180),
// new GPSLocalizeCommand(SIDE),
drive_sys.TurnToHeadingCmd(230),
// drive_sys.DriveToPointCmd({.x=89, .y=52}, FWD),
cata_sys.IntakeToHold(),
drive_sys.DriveForwardCmd(drive_pid, 144, FWD, 0.3)->withCancelCondition(drive_sys.DriveStalledCondition(0.5)),

#endif
cata_sys.StopIntake(),
tempend,


};

Expand Down
2 changes: 1 addition & 1 deletion src/competition/opcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void setupJoeControls()
*/
void opcontrol() {
// ================ TUNING CODE (Disable when not testing) ================
// testing();
testing();

// ================ INIT ================
// Disable catapult while in driver (sadface)
Expand Down

0 comments on commit fb81f5d

Please sign in to comment.