|
35 | 35 | import edu.wpi.first.wpilibj2.command.Commands; |
36 | 36 | import edu.wpi.first.wpilibj2.command.button.CommandXboxController; |
37 | 37 | import edu.wpi.first.wpilibj2.command.button.RobotModeTriggers; |
| 38 | +import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine; |
38 | 39 | import frc.robot.Constants.AprilTagConstants.AprilTagLayoutType; |
39 | 40 | import frc.robot.Constants.OperatorConstants; |
40 | 41 | import frc.robot.commands.DriveCommands; |
@@ -193,32 +194,6 @@ public RobotContainer() { |
193 | 194 | configureBindings(); |
194 | 195 | } |
195 | 196 |
|
196 | | - // // Create a list of waypoints from poses. Each pose represents one waypoint. |
197 | | - // // The rotation component of the pose should be the direction of travel. Do not use holonomic |
198 | | - // rotation. |
199 | | - // List<Waypoint> waypoints = PathPlannerPath.waypointsFromPoses( |
200 | | - // new Pose2d(1.0, 1.0, Rotation2d.fromDegrees(0)), |
201 | | - // new Pose2d(5.0, 3.0, Rotation2d.fromDegrees(90)) |
202 | | - // ); |
203 | | - |
204 | | - // PathConstraints constraints = new PathConstraints(3.0, 3.0, 2 * Math.PI, 4 * Math.PI); // The |
205 | | - // constraints for this path. |
206 | | - // // PathConstraints constraints = PathConstraints.unlimitedConstraints(12.0); // You can also |
207 | | - // use unlimited constraints, only limited by motor torque and nominal battery voltage |
208 | | - |
209 | | - // // Create the path using the waypoints created above |
210 | | - // PathPlannerPath path = new PathPlannerPath( |
211 | | - // waypoints, |
212 | | - // constraints, |
213 | | - // null, // The ideal starting state, this is only relevant for pre-planned paths, so can be |
214 | | - // null for on-the-fly paths. |
215 | | - // new GoalEndState(0.0, Rotation2d.fromDegrees(-90)) // Goal end state. You can set a holonomic |
216 | | - // rotation here. If using a differential drivetrain, the rotation will have no effect. |
217 | | - // ); |
218 | | - |
219 | | - // // Prevent the path from being flipped if the coordinates are already correct |
220 | | - // path.preventFlipping = true; |
221 | | - |
222 | 197 | /** Use this method to define your Autonomous commands for use with PathPlanner / Choreo */ |
223 | 198 | private void defineAutoCommands() { |
224 | 199 |
|
@@ -288,10 +263,6 @@ private void configureBindings() { |
288 | 263 | m_drivebase) |
289 | 264 | .ignoringDisable(true)); |
290 | 265 |
|
291 | | - driverController |
292 | | - .leftBumper() |
293 | | - .onTrue(Commands.runOnce(() -> new Pose2d(10.0, 10.0, new Rotation2d()))); |
294 | | - |
295 | 266 | // Press RIGHT BUMPER --> Run the example flywheel |
296 | 267 | driverController |
297 | 268 | .rightBumper() |
@@ -351,38 +322,38 @@ public void updateAlerts() { |
351 | 322 | private void definesysIdRoutines() { |
352 | 323 | if (Constants.getAutoType() == RBSIEnum.AutoType.PATHPLANNER) { |
353 | 324 | // Drivebase characterization |
354 | | - // autoChooserPathPlanner.addOption( |
355 | | - // "Drive Wheel Radius Characterization", |
356 | | - // DriveCommands.wheelRadiusCharacterization(m_drivebase)); |
357 | | - // autoChooserPathPlanner.addOption( |
358 | | - // "Drive Simple FF Characterization", |
359 | | - // DriveCommands.feedforwardCharacterization(m_drivebase)); |
360 | | - // autoChooserPathPlanner.addOption( |
361 | | - // "Drive SysId (Quasistatic Forward)", |
362 | | - // m_drivebase.sysIdQuasistatic(SysIdRoutine.Direction.kForward)); |
363 | | - // autoChooserPathPlanner.addOption( |
364 | | - // "Drive SysId (Quasistatic Reverse)", |
365 | | - // m_drivebase.sysIdQuasistatic(SysIdRoutine.Direction.kReverse)); |
366 | | - // autoChooserPathPlanner.addOption( |
367 | | - // "Drive SysId (Dynamic Forward)", |
368 | | - // m_drivebase.sysIdDynamic(SysIdRoutine.Direction.kForward)); |
369 | | - // autoChooserPathPlanner.addOption( |
370 | | - // "Drive SysId (Dynamic Reverse)", |
371 | | - // m_drivebase.sysIdDynamic(SysIdRoutine.Direction.kReverse)); |
372 | | - |
373 | | - // // Example Flywheel SysId Characterization |
374 | | - // autoChooserPathPlanner.addOption( |
375 | | - // "Flywheel SysId (Quasistatic Forward)", |
376 | | - // m_flywheel.sysIdQuasistatic(SysIdRoutine.Direction.kForward)); |
377 | | - // autoChooserPathPlanner.addOption( |
378 | | - // "Flywheel SysId (Quasistatic Reverse)", |
379 | | - // m_flywheel.sysIdQuasistatic(SysIdRoutine.Direction.kReverse)); |
380 | | - // autoChooserPathPlanner.addOption( |
381 | | - // "Flywheel SysId (Dynamic Forward)", |
382 | | - // m_flywheel.sysIdDynamic(SysIdRoutine.Direction.kForward)); |
383 | | - // autoChooserPathPlanner.addOption( |
384 | | - // "Flywheel SysId (Dynamic Reverse)", |
385 | | - // m_flywheel.sysIdDynamic(SysIdRoutine.Direction.kReverse)); |
| 325 | + autoChooserPathPlanner.addOption( |
| 326 | + "Drive Wheel Radius Characterization", |
| 327 | + DriveCommands.wheelRadiusCharacterization(m_drivebase)); |
| 328 | + autoChooserPathPlanner.addOption( |
| 329 | + "Drive Simple FF Characterization", |
| 330 | + DriveCommands.feedforwardCharacterization(m_drivebase)); |
| 331 | + autoChooserPathPlanner.addOption( |
| 332 | + "Drive SysId (Quasistatic Forward)", |
| 333 | + m_drivebase.sysIdQuasistatic(SysIdRoutine.Direction.kForward)); |
| 334 | + autoChooserPathPlanner.addOption( |
| 335 | + "Drive SysId (Quasistatic Reverse)", |
| 336 | + m_drivebase.sysIdQuasistatic(SysIdRoutine.Direction.kReverse)); |
| 337 | + autoChooserPathPlanner.addOption( |
| 338 | + "Drive SysId (Dynamic Forward)", |
| 339 | + m_drivebase.sysIdDynamic(SysIdRoutine.Direction.kForward)); |
| 340 | + autoChooserPathPlanner.addOption( |
| 341 | + "Drive SysId (Dynamic Reverse)", |
| 342 | + m_drivebase.sysIdDynamic(SysIdRoutine.Direction.kReverse)); |
| 343 | + |
| 344 | + // Example Flywheel SysId Characterization |
| 345 | + autoChooserPathPlanner.addOption( |
| 346 | + "Flywheel SysId (Quasistatic Forward)", |
| 347 | + m_flywheel.sysIdQuasistatic(SysIdRoutine.Direction.kForward)); |
| 348 | + autoChooserPathPlanner.addOption( |
| 349 | + "Flywheel SysId (Quasistatic Reverse)", |
| 350 | + m_flywheel.sysIdQuasistatic(SysIdRoutine.Direction.kReverse)); |
| 351 | + autoChooserPathPlanner.addOption( |
| 352 | + "Flywheel SysId (Dynamic Forward)", |
| 353 | + m_flywheel.sysIdDynamic(SysIdRoutine.Direction.kForward)); |
| 354 | + autoChooserPathPlanner.addOption( |
| 355 | + "Flywheel SysId (Dynamic Reverse)", |
| 356 | + m_flywheel.sysIdDynamic(SysIdRoutine.Direction.kReverse)); |
386 | 357 | } |
387 | 358 | } |
388 | 359 |
|
|
0 commit comments