BlueAuto first auto path created#17
Conversation
robot shoot the ball and wait 5s each time shooting
| .strafeToLinearHeading(new Vector2d(-40, -34), Math.toRadians(-130)) | ||
| .waitSeconds(5) | ||
| .strafeToLinearHeading(new Vector2d(38, -32), Math.toRadians(270)) | ||
| //.splineTo(new Vector2d(38, -32), Math.toRadians(90)) |
There was a problem hiding this comment.
Do you need to keep this commented code? Consider removing or adding some description for why it is here to help readbility of the code
|
|
||
| import org.firstinspires.ftc.teamcode.MecanumDrive; | ||
|
|
||
| @Autonomous(name = "BlueAuto", group = "Autonomous") |
There was a problem hiding this comment.
Can we name this to be more specific? Like BlueAutoFarSide? Or something more specific to the route?
| .start(); | ||
| } | ||
| } | ||
| //.splineTo(new Vector2d(38, -32), Math.toRadians(90)) |
There was a problem hiding this comment.
Same as above. If no longer needed consider removing this commented code.
There was a problem hiding this comment.
Just a tip, but it might help to explain why this file is also being changed in this commit.
danzuo
left a comment
There was a problem hiding this comment.
Looks fine, but think about why you would be adding commented blocks of navigation code. Is it for reference?
|
|
||
| @Autonomous(name = "BlueAuto", group = "Autonomous") | ||
| public class BlueAuto { | ||
| public void runOpMode(){ |
There was a problem hiding this comment.
We need to add an @Override above public void runOpMode()
| import org.firstinspires.ftc.teamcode.MecanumDrive; | ||
|
|
||
| @Autonomous(name = "BlueAuto", group = "Autonomous") | ||
| public class BlueAuto { |
There was a problem hiding this comment.
Need to add extend LinearOpMode
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new autonomous path for the Blue alliance team, implementing a routine where the robot moves to shooting positions, waits 5 seconds to shoot, collects balls from two locations, and parks.
Key changes:
- New autonomous OpMode
BlueSmallToBigTriangleAutowith a defined trajectory for the Blue alliance - Minor updates to the MeepMeep testing file including background theme change and commented test code
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| BlueSmallToBigTriangleAuto.java | New autonomous program defining the Blue alliance's robot path with shooting and ball collection sequences |
| MeepMeepTesting.java | Updated background theme and added commented-out test code for the new Blue auto path |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| @Autonomous(name = "BlueAuto", group = "Autonomous") | ||
| public class BlueSmallToBigTriangleAuto extends LinearOpMode { | ||
|
|
There was a problem hiding this comment.
| public void runOpMode(){ | ||
| Pose2d startingPose = new Pose2d(68, -10, Math.toRadians(0)); | ||
|
|
||
| MecanumDrive drive = new MecanumDrive(hardwareMap, startingPose); | ||
|
|
||
| Action trajectoryAction = drive.actionBuilder(startingPose) | ||
| .strafeToLinearHeading(new Vector2d(-40, -34), Math.toRadians(230)) | ||
| //come to destination to shoot | ||
| .waitSeconds(5) | ||
| // wait 5s to shoot | ||
| .strafeToLinearHeading(new Vector2d(-13, -30), Math.toRadians(270)) | ||
| //come to the 1st location to take the ball and start the intake | ||
| .strafeToLinearHeading(new Vector2d(-13, -47),Math.toRadians(270)) | ||
| //take the ball | ||
| .strafeToLinearHeading(new Vector2d(-40, -34), Math.toRadians(-130)) | ||
| //back to the location to shoot stop intake | ||
| .waitSeconds(5) | ||
| //wait 5s to shoot | ||
| .strafeToLinearHeading(new Vector2d(12, -30), Math.toRadians(270)) | ||
| //come to 2nd location to take the ball start intake | ||
| .strafeToLinearHeading(new Vector2d(12, -47),Math.toRadians(270)) | ||
| //take 2nd line of ball | ||
| .strafeToLinearHeading(new Vector2d(-40, -34), Math.toRadians(-130)) | ||
| //back to location to shoot stop intake | ||
| .waitSeconds(5) | ||
| //5s to shoot | ||
| .strafeToLinearHeading(new Vector2d(38, -32), Math.toRadians(270)) | ||
| //go to the location to park | ||
| .build(); | ||
| } |
There was a problem hiding this comment.
The autonomous OpMode builds the trajectory action but never waits for start or executes it. Add waitForStart(); before building the action, and use Actions.runBlocking(trajectoryAction); after building it to execute the trajectory. See SplineTest.java and ManualFeedbackTuner.java for reference implementations.
| RoadRunnerBotEntity myBot = new DefaultBotBuilder(meepMeep) | ||
| // Set bot constraints: maxVel, maxAccel, maxAngVel, maxAngAccel, track width | ||
| .setConstraints(60, 60, Math.toRadians(180), Math.toRadians(180), 15) | ||
| .build(); |
There was a problem hiding this comment.
The myBot entity is created but never used. Either remove this unused variable or integrate it into the visualization by calling myBot.runAction() and adding it via .addEntity(myBot).
| RoadRunnerBotEntity myBot = new DefaultBotBuilder(meepMeep) | |
| // Set bot constraints: maxVel, maxAccel, maxAngVel, maxAngAccel, track width | |
| .setConstraints(60, 60, Math.toRadians(180), Math.toRadians(180), 15) | |
| .build(); |
| //.splineTo(new Vector2d(38, -32), Math.toRadians(90)) | ||
| //.waitSeconds(3) | ||
| /*.splineTo(new Vector2d(-40, -34), Math.toRadians(-150)) | ||
| .waitSeconds(6) | ||
| .splineTo(new Vector2d(38, -30), Math.toRadians(-90)) | ||
| .turn(Math.toRadians(180)) | ||
| .waitSeconds(4) | ||
| .splineTo(new Vector2d(-40, -34), Math.toRadians(-150)) | ||
| .waitSeconds(6) | ||
| .splineTo(new Vector2d(12, -30), Math.toRadians(-90)) | ||
| .turn(Math.toRadians(180)) | ||
| .waitSeconds(4) | ||
| .splineTo(new Vector2d(-40, -34), Math.toRadians(-150)) | ||
| .waitSeconds(6) | ||
| .splineTo(new Vector2d(-14, -30), Math.toRadians(-90)) | ||
| .turn(Math.toRadians(180)) | ||
| .waitSeconds(4) | ||
| .splineTo(new Vector2d(-40, -34), Math.toRadians(-150)) | ||
| .waitSeconds(6) | ||
| .splineTo(new Vector2d(38, -32), Math.toRadians(-90)) | ||
| .turn(Math.toRadians(180))*/ | ||
|
|
||
|
|
||
| /*.lineToX(-20) | ||
| .turn(Math.toRadians(220)) | ||
| .lineToY(-24) | ||
| .turn(Math.toRadians(90)) | ||
| .lineToX(0) | ||
| .turn(Math.toRadians(90)) | ||
| .lineToY(0) | ||
| .turn(Math.toRadians(90)) | ||
| .build()); | ||
|
|
||
|
|
||
| /* meepMeep.setBackground(MeepMeep.Background.FIELD_DECODE_JUICE_BLACK) | ||
| .setDarkMode(true) | ||
| .setBackgroundAlpha(0.95f) | ||
| .addEntity(myBot) | ||
| .start(); | ||
| } | ||
| } */ | ||
|
|
||
|
|
There was a problem hiding this comment.
Large blocks of commented-out code added outside of any class or method structure (lines 110-150). This creates invalid code structure and should be removed or moved to proper documentation/comments if the code snippets are needed for reference.
| //.splineTo(new Vector2d(38, -32), Math.toRadians(90)) | |
| //.waitSeconds(3) | |
| /*.splineTo(new Vector2d(-40, -34), Math.toRadians(-150)) | |
| .waitSeconds(6) | |
| .splineTo(new Vector2d(38, -30), Math.toRadians(-90)) | |
| .turn(Math.toRadians(180)) | |
| .waitSeconds(4) | |
| .splineTo(new Vector2d(-40, -34), Math.toRadians(-150)) | |
| .waitSeconds(6) | |
| .splineTo(new Vector2d(12, -30), Math.toRadians(-90)) | |
| .turn(Math.toRadians(180)) | |
| .waitSeconds(4) | |
| .splineTo(new Vector2d(-40, -34), Math.toRadians(-150)) | |
| .waitSeconds(6) | |
| .splineTo(new Vector2d(-14, -30), Math.toRadians(-90)) | |
| .turn(Math.toRadians(180)) | |
| .waitSeconds(4) | |
| .splineTo(new Vector2d(-40, -34), Math.toRadians(-150)) | |
| .waitSeconds(6) | |
| .splineTo(new Vector2d(38, -32), Math.toRadians(-90)) | |
| .turn(Math.toRadians(180))*/ | |
| /*.lineToX(-20) | |
| .turn(Math.toRadians(220)) | |
| .lineToY(-24) | |
| .turn(Math.toRadians(90)) | |
| .lineToX(0) | |
| .turn(Math.toRadians(90)) | |
| .lineToY(0) | |
| .turn(Math.toRadians(90)) | |
| .build()); | |
| /* meepMeep.setBackground(MeepMeep.Background.FIELD_DECODE_JUICE_BLACK) | |
| .setDarkMode(true) | |
| .setBackgroundAlpha(0.95f) | |
| .addEntity(myBot) | |
| .start(); | |
| } | |
| } */ |
robot shoot the ball and wait 5s each time shooting
Before issuing a pull request, please see the contributing page.