Skip to content

Commit

Permalink
new funny shit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sir-Encoded committed Jan 29, 2025
1 parent 58515fa commit 3eae0e5
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 30 deletions.
14 changes: 7 additions & 7 deletions include/deviceGlobals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ inline pros::adi::Pneumatics doinkerPiston('B', false);

/* Declare sensors */
inline pros::Optical optical(19);
inline pros::Imu inertial1(17);
inline pros::Imu inertial2(15);
inline pros::Imu inertial1(12);
inline pros::Imu inertial2(18);
inline pros::Rotation wallStakeRotationSensor(11);

inline pros::Rotation verticalEncoder(1);
Expand All @@ -42,18 +42,18 @@ inline lemlib::Drivetrain drivetrain(&leftDrive, // left motor group
13.5, // track width
lemlib::Omniwheel::NEW_325,
450, // drivetrain rpm
8 // chase power is 2. If we had traction wheels, it would have been 8
2 // chase power is 2. If we had traction wheels, it would have been 8
);
// lateral motion controller
inline lemlib::ControllerSettings lateralController(10, // proportional gain (kP)
inline lemlib::ControllerSettings lateralController(1.8, // proportional gain (kP)
0, // integral gain (kI)
10, // derivative gain (kD)
3, // anti windup
0, // derivative gain (kD)
0, // anti windup
1, // small error range, in inches
100, // small error range timeout, in milliseconds
3, // large error range, in inches
500, // large error range timeout, in milliseconds
40 // maximum acceleration (slew)
127 // maximum acceleration (slew)
);
// angular motion controller
inline lemlib::ControllerSettings angularController(4, // proportional gain (kP)
Expand Down
46 changes: 27 additions & 19 deletions src/auton/autonomous.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@
*/

void testPID() {
clampPiston.set_value(true);
pros::delay(1000);
// chassis.moveToPoint(0, 24, 5000);
chassis.turnToHeading(90, 1000);
// chassis.moveToPoint(24, 24, 5000)
chassis.moveToPoint(0, 0, 1000);
chassis.moveToPoint(0, 24, 1000);
}
void testBM() {
chassis.moveToPose(52, 6, 320, 1000, {.forwards = false});
Expand All @@ -26,28 +23,28 @@ void calibrateOdomOffsets() {

}



rd::Selector gui_selector({
// {"E 5 Ring", Five_Ring},
// {"Q 4 Ring + Bar", four_ring_bar},
// {"Q SAWP 2 Mogo", SAWP_4},

{"Skills", skills, "", 0},

{ "Test PID", testPID, "", 220 },
{ "Test BM", testBM, "", 220 },
{ "Odom Offsets", calibrateOdomOffsets, "", 220 }
});

void autonomous() {
//initializeColourSort();
chassis.setPose(0, 0, 0);
field_status = "autonomous";
console.println("Running auton...");
gui_selector.run_auton();
}
void SIG_SAWP() {
chassis.moveToPoint(0, 0, 1000);
chassis.moveToPose(-11.922, -29.782, 10, 1200, {.forwards = false, .minSpeed = 80});
pros::delay(750);
clampPiston.set_value(true);
// chassis.moveTo(-12.737, -60.17, 5000);
// chassis.moveTo(0.732, -69.73, 5000);
// chassis.moveTo(1.925, -20.201, 5000);
// chassis.moveTo(-13.005, -4.77, 5000);
// chassis.moveTo(-26.775, 8.237, 5000);
// chassis.moveTo(-43.333, -2.844, 5000);
// chassis.moveTo(-26.943, 17.381, 5000);
// chassis.moveTo(-45.866, -19.014, 5000);

}

/* Legacy Auton Routines */
void four_ring_bar() {
Expand Down Expand Up @@ -238,3 +235,14 @@ void SAWP_4() {
}
}

rd::Selector gui_selector({
// {"E 5 Ring", Five_Ring},
// {"Q 4 Ring + Bar", four_ring_bar},
// {"Q SAWP 2 Mogo", SAWP_4},
{"Mecha SAWP", SIG_SAWP},
{"Skills", skills, "", 0},

{ "Test PID", testPID, "", 220 },
{ "Test BM", testBM, "", 220 },
{ "Odom Offsets", calibrateOdomOffsets, "", 220 }
});
8 changes: 4 additions & 4 deletions src/subsystem/colourSort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ void initializeColourSort() {
// eject blue rings
console.println("eject blue impostor");
intakeLock = true;
pros::delay(230);
pros::delay(240);
intake.brake();
pros::delay(168);
pros::delay(175);
intake.move_voltage(12000);
intakeLock = false;
}
if (alliance == "blue" && optical.get_hue() > 15 && optical.get_hue() < 27) {
// eject red rings
console.println("eject red impostor");
intakeLock = true;
pros::delay(230);
pros::delay(240);
intake.brake();
pros::delay(168);
pros::delay(175);
intake.move_voltage(12000);
intakeLock = false;
}
Expand Down

0 comments on commit 3eae0e5

Please sign in to comment.