Skip to content

Stage 1A Solution CTRE#34

Open
Spaceman113138 wants to merge 14 commits into
frcsoftware:mainfrom
Spaceman113138:Stage1A-CTRE
Open

Stage 1A Solution CTRE#34
Spaceman113138 wants to merge 14 commits into
frcsoftware:mainfrom
Spaceman113138:Stage1A-CTRE

Conversation

@Spaceman113138

Copy link
Copy Markdown

For #29

Solution for Stage 1A - Mostly a copy of #24 but with formating added and replacing any rev motors with ctre.

Comment thread stage1/ctre/solution/src/main/java/first/robot/Robot.java Outdated
@Spaceman113138

Copy link
Copy Markdown
Author

@ArchdukeTim is this what you were looking for as far as using timer?

*/
@Override
public void periodic() {
if (!autoTimer.hasElapsed(4.0)) { // Drive for 4 seconds after the start of auto

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yeah this is better. It might read better if you invert the if statement:

if (hasElapsed(4) {
  stop the drivetrain
} else {
  drive forward
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yeah that reads better

@DylanB5402 DylanB5402 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For CTRE, we should use their Sim API directly. You can look at my 2026 version of this PR for reference: #8

I rolled a custom sim impl for REV because their sim is broken right now, but CTRE's should be working

@DylanB5402

DylanB5402 commented Jun 19, 2026

Copy link
Copy Markdown
Member

@Spaceman113138 we're going to update #24 to be a little more accurate to the actual kitbot - I'll work that out in my PR and we can port them over here after

@DylanB5402

Copy link
Copy Markdown
Member

@Spaceman113138

Can you make the same updates I did in #24 here? rename the mechanisms and update the teleop controls


private DrivetrainSim drivetrainSim = new DrivetrainSim(leftLeader, rightLeader);
private SingleFlywheelSim intakeLauncherSim = new SingleFlywheelSim(intakeLauncher, "intake");
private SingleFlywheelSim feederSim = new SingleFlywheelSim(feeder, "shooter");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rename the subsystems in the sim here too

null);

private final StructPublisher<Pose2d> simPosePublisher = NetworkTableInstance.getDefault()
.getStructTopic("SimPose", Pose2d.struct)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's publish this under Drivetrain/Pose for consistency. Also change all the publishers below to use Drivetrain instead of DrivetrainSim

} else if (xboxController.getLeftBumperButton()) {
// intake
robot.intakeLauncher.setThrottle(0.8);
robot.feeder.setThrottle(0.8);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Intake should have opposite signs to outtake, let's also set feeder speed to -1 for consistency without outtake

@DylanB5402 DylanB5402 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, thank you for the changes!

@samfreund samfreund force-pushed the main branch 2 times, most recently from b599032 to 63aae35 Compare June 25, 2026 04:20
@samfreund samfreund force-pushed the main branch 7 times, most recently from b5680fd to 6ca05c8 Compare June 25, 2026 06:59
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.

3 participants