Skip to content

Commit

Permalink
Merge pull request #135 from ad101-lab/ad-auton-upload
Browse files Browse the repository at this point in the history
Add option to upload all autons to brain at once
  • Loading branch information
alexDickhans authored May 5, 2022
2 parents 165fcc8 + c16be0d commit 2365b80
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/auton.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define AUTON 8
8 changes: 8 additions & 0 deletions include/defines.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#define AUTON_STEAL_LEFT_LEFT_AWP 1
#define AUTON_STEAL_MID_LEFT_AWP 2
#define AUTON_STEAL_MID_RIGHT_AWP 3
#define AUTON_STEAL_RIGHT_RIGHT_AWP 4
#define AUTON_STEAL_RIGHT_RIGHT_RIGHT_AWP 5
#define AUTON_RIGHT_DOUBLE_STEAL 6
#define AUTON_NONE 7
#define AUTON_SKILLS 8
3 changes: 3 additions & 0 deletions include/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@

#include "autoPaths.hpp"

#include "defines.h"
#include "auton.h"

// Auton
#include "auton/auton.hpp"
#include "auton/autonSelector.hpp"
Expand Down
20 changes: 19 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1705,7 +1705,25 @@ void autonomous() {
// autonRoutines.hpp and the implementation is autonRoutines.cpp
// autonomousSelector.run();
preAutonRun();
skills();

#if AUTON == AUTON_STEAL_LEFT_LEFT_AWP
leftStealLeftAWP();
#elif AUTON == AUTON_STEAL_MID_LEFT_AWP
midStealToLeftAWP();
#elif AUTON == AUTON_STEAL_MID_RIGHT_AWP
midStealToRightAWP();
#elif AUTON == AUTON_STEAL_RIGHT_RIGHT_AWP
rightStealRightAWP();
#elif AUTON == AUTON_STEAL_RIGHT_RIGHT_RIGHT_AWP
rightRightStealToRightAWP();
#elif AUTON == AUTON_RIGHT_DOUBLE_STEAL
rightDoubleSteal();
#elif AUTON == AUTON_NONE
// Do Nothing
#elif AUTON == AUTON_SKILLS
skills();
#endif // AUTON

postAuton();

// autonomousSelector.run();
Expand Down
13 changes: 13 additions & 0 deletions uploadAllAutons.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import os
import time

autons = ["SLeft LAWP", "SMid LAWP", "SMid RAWP", "SRight RAWP", "SRR RAWP", "Right Double Steal", "None", "Skills"]

for i in range(len(autons)):
f = open("include/auton.h", "w")
f.write("#define AUTON " + str(i+1));
f.close()

print ("pros mu --slot " + str(i+1) + " --name \"" + autons[i] + "\"")

os.system("pros mu --slot " + str(i+1) + " --name \"" + autons[i] + "\"")

0 comments on commit 2365b80

Please sign in to comment.