Stage 1A Solution CTRE#34
Conversation
Co-authored-by: Tim Winters <twinters007@gmail.com>
|
@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 |
There was a problem hiding this comment.
Yeah this is better. It might read better if you invert the if statement:
if (hasElapsed(4) {
stop the drivetrain
} else {
drive forward
}
DylanB5402
left a comment
There was a problem hiding this comment.
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
|
@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 |
|
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"); |
There was a problem hiding this comment.
Rename the subsystems in the sim here too
| null); | ||
|
|
||
| private final StructPublisher<Pose2d> simPosePublisher = NetworkTableInstance.getDefault() | ||
| .getStructTopic("SimPose", Pose2d.struct) |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Intake should have opposite signs to outtake, let's also set feeder speed to -1 for consistency without outtake
DylanB5402
left a comment
There was a problem hiding this comment.
Looks good, thank you for the changes!
b599032 to
63aae35
Compare
b5680fd to
6ca05c8
Compare
For #29
Solution for Stage 1A - Mostly a copy of #24 but with formating added and replacing any rev motors with ctre.