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

Commit

Permalink
Programming Skills Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Ish-08 committed Mar 2, 2024
1 parent c38dc1f commit a6f9919
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 16 deletions.
33 changes: 24 additions & 9 deletions src/autonomous.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,25 @@ void autonomous() {
case 4:
// in progress in-depth auton
controller.print(0, 0, "Right Elims Auton");
chassis.setPose(36, -60, 180); // X, Y, Heading (degrees)
chassis.moveToPose(12 + 5, -12, 345, 2500, {.forwards = false, .chasePower = 8});
chassis.waitUntilDone();
ToggleVerticalPneumaticWings();
pros::delay(500);
chassis.moveToPose(48, 0, 100, 2500, {.forwards = false, .chasePower = 8});
chassis.waitUntilDone();
ToggleVerticalPneumaticWings();

// Below is pre- 3/1/24 stuff (I think it was made at Gateway)
/*
chassis.setPose(-48 - (7.0 / 2), -60, 135); // X, Y, Heading (degrees)
ToggleVerticalPneumaticWings();
chassis.turnTo(0, -18, 2000);
ToggleVerticalPneumaticWings();
chassis.moveToPoint(-30, -18, 2000);
AutonIntake(1000,false);
chassis.moveToPoint(-30,-40,2000,false);
*/
/*
pros::delay(500);
chassis.turnTo(24, -48, 5000, false);
Expand All @@ -162,26 +174,29 @@ void autonomous() {
chassis.moveToPose(-60 + 5, -24 + 24, 180, 2500, {.forwards = false, .chasePower = 8});
chassis.waitUntilDone();
chassis.setPose(-72 + 26.5, -29.25, 180); // X, Y, Heading (degrees)
chassis.moveToPose(-48, -48 + 3, 70, 2500, {.forwards = false, .chasePower = 8 + 6});
chassis.moveToPose(-48, -48 + 3, 75, 2500, {.forwards = false, .chasePower = 8 + 6});
chassis.waitUntilDone();
ToggleVerticalPneumaticWings();
pros::delay(500);

//KickerMotor.move(127);
//pros::delay(25000);
//KickerMotor.brake();
KickerMotor.move(120);
pros::delay(33000);
KickerMotor.brake();
pros::delay(500);
ToggleVerticalPneumaticWings();
pros::delay(500);
chassis.turnTo( -36, -60, 2500);
chassis.moveToPoint(-36, -60, 2500);
chassis.turnTo(0,-60,2500);
chassis.moveToPoint(24, -60, 2500);
//chassis.moveToPose(36,-36,0,2500);
//chassis.waitUntilDone();
chassis.moveToPose(30,-36,0,2500);
chassis.moveToPose(12, -12, 270, 2500, {.forwards = false, .chasePower = 8});
chassis.waitUntilDone();
ToggleVerticalPneumaticWings();
chassis.moveToPoint(48,-12, 2500, false);
chassis.waitUntilDone();
ToggleVerticalPneumaticWings();
//ToggleVerticalPneumaticWings();
//chassis.moveToPose(60, -12, 90, 2500);

// chassis.moveToPose(-48 - 5, -48 + 8, 70, 2500, {.forwards = false, .chasePower = 8});
// TODO: Ishika, test line 192 (directly above) to see if it gets the bot closer to the match load position than line 191

Expand Down
16 changes: 10 additions & 6 deletions src/global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pros::Motor_Group LMotors({BLMotor, MLMotor, FLMotor});
pros::Motor_Group RMotors({BRMotor, MRMotor, FRMotor});

// Initializes the kicker motor to port 12, reversed, with a red (torque) gearset
pros::Motor KickerMotor(18, pros::E_MOTOR_GEAR_RED, pros::E_MOTOR_ENCODER_DEGREES);
pros::Motor KickerMotor(-18, pros::E_MOTOR_GEAR_RED, pros::E_MOTOR_ENCODER_DEGREES);
pros::Motor IntakeMotor(7, pros::E_MOTOR_GEAR_BLUE);

// Initializes DigitalOut objects to control the pneumatic wings.
Expand All @@ -51,11 +51,15 @@ bool manualKicker = true;

// Prints driver control information onto the controller for the driver to view
void ControllerDisplay() {
if(!drivetrainReversed) controller.print(0, 0, "Reversed: false");
else if(drivetrainReversed) controller.print(0, 0, "Reversed: true");
double avgTemp = (BLMotor.get_temperature() + MLMotor.get_temperature() + FLMotor.get_temperature() + BRMotor.get_temperature() + MRMotor.get_temperature() + FRMotor.get_temperature()) / 6;
pros::delay(50);
if(manualKicker) controller.print(1, 0, "Kicker: Manual");
else if(!manualKicker) controller.print(1, 0, "Kicker: Automatic");
controller.print(0, 0, "Avg DT Temp: %0.2f", avgTemp);
pros::delay(50);
if(!drivetrainReversed) controller.print(1, 0, "Reversed: false");
else if(drivetrainReversed) controller.print(1, 0, "Reversed: true");
pros::delay(50);
if(manualKicker) controller.print(2, 0, "Kicker: Manual");
else if(!manualKicker) controller.print(2, 0, "Kicker: Automatic");
}

/*
Expand All @@ -71,7 +75,7 @@ void ControllerDisplay() {
7: New Programming Skills
8: Old Programming Skills
*/
unsigned short int autonSelect = 7;
unsigned short int autonSelect = 3;

/*
Integer variable to represent the current game phase
Expand Down
2 changes: 1 addition & 1 deletion src/opcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void opcontrol()
else
IntakeMotor.brake();

if (true) {
if (false) {
// If the kicker is in manual control mode...
if(manualKicker) {
// Then when B is pressed...
Expand Down

0 comments on commit a6f9919

Please sign in to comment.