Middle area red auto path#30
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new autonomous mode for the red team called "RedMainMiddleAreaAuto", which positions the robot farther away from the goal at the right angle of the big triangle, compared to the main auto path. The changes include creating the new auto class and updating the MeepMeep testing configuration to visualize this path.
Key changes:
- New RedMainMiddleAreaAuto autonomous class with trajectory path starting at position (-56, 45) and moving to (0, 0) before collecting game pieces
- Updated MeepMeepTesting configuration to use the new trajectory path instead of the previous straight line to goal path
- Added commented code block documenting the middle area auto path
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| TeamCode/src/main/java/org/firstinspires/ftc/teamcode/auto/RedMainMiddleAreaAuto.java | New autonomous mode implementing the middle area path with intake and shooting actions |
| MeepMeepTesting/src/main/java/com/example/meepmeeptesting/MeepMeepTesting.java | Updated red bot trajectory to test the new middle area path and added commented documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| @Override | ||
| public void runOpMode(){ | ||
| Pose2d startingPose = new Pose2d(-startPoseX, startPoseY, Math.toRadians(0)); |
There was a problem hiding this comment.
The startPoseX variable is already set to -56, but it is negated again here, resulting in a starting position of (56, 45) instead of the intended (-56, 45). Remove the negation: new Pose2d(startPoseX, startPoseY, Math.toRadians(0))
| Pose2d startingPose = new Pose2d(-startPoseX, startPoseY, Math.toRadians(0)); | |
| Pose2d startingPose = new Pose2d(startPoseX, startPoseY, Math.toRadians(0)); |
| public void runOpMode(){ | ||
| Pose2d startingPose = new Pose2d(-startPoseX, startPoseY, Math.toRadians(0)); | ||
|
|
||
| MecanumDrive drive = new MecanumDrive(hardwareMap, startingPose); | ||
|
|
||
| Action trajectoryAction = drive.actionBuilder(startingPose) | ||
| .strafeToSplineHeading(new Vector2d(0,0),Math.toRadians(135)) | ||
|
|
||
| .waitSeconds(6) //Replace this with shoot code | ||
|
|
||
| .strafeToSplineHeading(new Vector2d(-10,minYValue), Math.toRadians(90)) | ||
| //Start intake | ||
| .splineToConstantHeading(new Vector2d(-11,maxYValue),Math.toRadians(90)) | ||
|
|
||
| .strafeToSplineHeading(new Vector2d(0,0),Math.toRadians(135)) | ||
| //stop intake | ||
| .waitSeconds(6) //Replace this with the shoot code | ||
|
|
||
| .strafeToSplineHeading(new Vector2d(11,minYValue), Math.toRadians(90)) | ||
| //Start intake | ||
| .splineToConstantHeading(new Vector2d(12,maxYValue),Math.toRadians(90)) | ||
|
|
||
| .strafeToSplineHeading(new Vector2d(0,0),Math.toRadians(135)) | ||
| //stop intake | ||
| .waitSeconds(6) | ||
| //Replace this shooter code | ||
| .build(); | ||
| } |
There was a problem hiding this comment.
The runOpMode method creates a trajectoryAction but never waits for start or executes it. Add waitForStart() after building the trajectory, then execute the action using Actions.runBlocking(new SequentialAction(trajectoryAction)) similar to RedEmergencyAuto.java. You'll also need to import the required classes: com.acmerobotics.roadrunner.SequentialAction and com.acmerobotics.roadrunner.ftc.Actions.
| .strafeToSplineHeading(new Vector2d(0,0),Math.toRadians(135)) | ||
| //stop intake | ||
| .waitSeconds(6) | ||
| //Replace this shooter code |
There was a problem hiding this comment.
Corrected 'shooter' to 'shoot' for consistency with similar comments on lines 28 and 36.
| //Replace this shooter code | |
| //Replace this with shoot code |
|
|
||
| .strafeToSplineHeading(new Vector2d(0,0),Math.toRadians(135)) | ||
| //stop intake | ||
| .waitSeconds(6) //Replace this shooter code |
There was a problem hiding this comment.
Corrected 'shooter' to 'shoot' for consistency with similar comments.
| .waitSeconds(6) //Replace this shooter code | |
| .waitSeconds(6) //Replace this with shoot code |
|
Please port it to blue auto too. |
This auto is intended for the red team
This is similar to main auto, but instead of being close to the the goal, its farther away on the right angle of the big triangle