Skip to content

BlueAuto first auto path created#17

Open
ThanhLamTr wants to merge 4 commits into
masterfrom
AutoBlue
Open

BlueAuto first auto path created#17
ThanhLamTr wants to merge 4 commits into
masterfrom
AutoBlue

Conversation

@ThanhLamTr
Copy link
Copy Markdown

robot shoot the ball and wait 5s each time shooting

Before issuing a pull request, please see the contributing page.

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))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. If no longer needed consider removing this commented code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a tip, but it might help to explain why this file is also being changed in this commit.

Copy link
Copy Markdown
Contributor

@danzuo danzuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(){
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add an @Override above public void runOpMode()

import org.firstinspires.ftc.teamcode.MecanumDrive;

@Autonomous(name = "BlueAuto", group = "Autonomous")
public class BlueAuto {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add extend LinearOpMode

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 BlueSmallToBigTriangleAuto with 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 {

Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing @OverRide annotation. All runOpMode() methods in LinearOpMode subclasses should be annotated with @OverRide for consistency with other auto files in the codebase (e.g., RedSmallTriangleAuto.java, RedMainAuto.java).

Suggested change
@Override

Copilot uses AI. Check for mistakes.
Comment on lines +15 to +44
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();
}
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +17
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();
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
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();

Copilot uses AI. Check for mistakes.
Comment on lines +110 to 152
//.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();
}
} */


Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
//.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();
}
} */

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants