Update wpi drive classes for 2027 - #3317
Conversation
|
\inspector fix all |
|
\inspector check all |
Inspector ReportUp To DateDetailsOutdated - Automatically FixedDetailsInvalid - Manual Intervention NeededDetails
- 50 motor.setSafetyEnabled(true);
- 51 motor.setSafetyEnabled(false);
- 52 motor.setExpiration(0.1);
- 53 motor.feed();
+ 50 }
+ 51
+ 52 /** The teleop periodic function is called every control packet in teleop. */
+ 53 @Override
- 49 motor.SetSafetyEnabled(true);
- 50 motor.SetSafetyEnabled(false);
- 51 motor.SetExpiration(0.1_s);
- 52 motor.Feed();
+ 49 int main() {
+ 50 return wpi::StartRobot<Robot>();
+ 51 }
+ 52 #endif
- 49 self.motor.setSafetyEnabled(True)
- 50 self.motor.setSafetyEnabled(False)
- 51 self.motor.setExpiration(0.1)
- 52 self.motor.feed()
+ 49
- 34 // Tank drive with a given left and right rates
- 35 robotDrive.tankDrive(-driverController.getLeftY(), -driverController.getRightY());
- 36 // Arcade drive with a given forward and turn rate
- 37 robotDrive.arcadeDrive(-driverController.getLeftY(), -driverController.getLeftX());
- 38 // Curvature drive with a given forward and turn rate, as well as a button for turning in-place.
- 39 robotDrive.curvatureDrive(
- 40 -driverController.getLeftY(),
- 41 -driverController.getLeftX(),
- 42 driverController.getFaceUpButton());
+ 34
- 37 // Tank drive with a given left and right rates
- 38 robotDrive.TankDrive(-driverController.GetLeftY(),
- 39 -driverController.GetRightY());
- 40 // Arcade drive with a given forward and turn rate
- 41 robotDrive.ArcadeDrive(-driverController.GetLeftY(),
- 42 -driverController.GetLeftX());
- 43 // Curvature drive with a given forward and turn rate, as well as a
- 44 // quick-turn button
- 45 robotDrive.CurvatureDrive(-driverController.GetLeftY(),
- 46 -driverController.GetLeftX(),
- 47 driverController.GetFaceUpButton());
+ 37
- 68 // Use the joystick Y axis for forward movement, X axis for lateral
- 69 // movement, and Z axis for rotation.
- 70 robotDrive.driveCartesian(-joystick.getY(), -joystick.getX(), -joystick.getZ());
- 71 // Drive at 45 degrees relative to the robot, at the speed given by the Y axis of the joystick,
- 72 // with no rotation.
- 73 robotDrive.drivePolar(-joystick.getY(), Rotation2d.fromDegrees(45), 0);
+ 68
- 43 // Drive using the X, Y, and Z axes of the joystick.
- 44 robotDrive.DriveCartesian(-joystick.GetY(), -joystick.GetX(),
- 45 -joystick.GetZ());
- 46 // Drive at 45 degrees relative to the robot, at the speed given by the Y
- 47 // axis of the joystick, with no rotation.
- 48 robotDrive.DrivePolar(-joystick.GetY(), 45_deg, 0);
+ 43 |
|
\inspector check all |
3d30b7c to
a40b35c
Compare
d2ded69 to
7c05ac5
Compare
|
\inspector check all |
Update RLIs, replacing the multi-motor ones with RLIs from HatchBot.
Made new snippets for all code blocks (except python that needs wpilibsuite/allwpilib#8833 and wpilibsuite/allwpilib#8830 for snippets infrastructure (added todo)
Add swerve drive section with links to popular 3rd party libraries.