Skip to content

Update wpi drive classes for 2027 - #3317

Open
sciencewhiz wants to merge 13 commits into
wpilibsuite:mainfrom
sciencewhiz:wpi-drive-classes2027
Open

Update wpi drive classes for 2027#3317
sciencewhiz wants to merge 13 commits into
wpilibsuite:mainfrom
sciencewhiz:wpi-drive-classes2027

Conversation

@sciencewhiz

@sciencewhiz sciencewhiz commented May 23, 2026

Copy link
Copy Markdown
Collaborator

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.

@github-actions github-actions Bot added the 2027 label May 23, 2026
@sciencewhiz

Copy link
Copy Markdown
Collaborator Author

\inspector fix all

@sciencewhiz

Copy link
Copy Markdown
Collaborator Author

\inspector check all

@github-actions

github-actions Bot commented May 24, 2026

Copy link
Copy Markdown
Contributor

Inspector Report


Up To Date

Details
ALL @ <source/docs/contributing/wpilib-docs/style-guide.rst>
ALL @ <source/docs/romi-robot/programming-romi.rst>
ALL @ <source/docs/software/advanced-controls/controllers/profiled-pidcontroller.rst>
ALL @ <source/docs/software/advanced-controls/controllers/trapezoidal-profiles.rst>
ALL @ <source/docs/software/advanced-controls/state-space/state-space-flywheel-walkthrough.rst>
ALL @ <source/docs/software/advanced-controls/state-space/state-space-observers.rst>
ALL @ <source/docs/software/advanced-gradlerio/code-formatting.rst>
ALL @ <source/docs/software/advanced-gradlerio/profiling-with-visualvm.rst>
ALL @ <source/docs/software/basic-programming/deploy-directory.rst>
ALL @ <source/docs/software/basic-programming/java-gc.rst>
ALL @ <source/docs/software/basic-programming/robot-preferences.rst>
ALL @ <source/docs/software/can-devices/power-distribution-module.rst>
ALL @ <source/docs/software/commandbased/commands-v2/binding-commands-to-triggers.rst>
ALL @ <source/docs/software/commandbased/commands-v2/command-compositions.rst>
ALL @ <source/docs/software/commandbased/commands-v2/commands.rst>
ALL @ <source/docs/software/commandbased/commands-v2/cpp-command-discussion.rst>
ALL @ <source/docs/software/commandbased/commands-v2/pid-subsystems-commands.rst>
ALL @ <source/docs/software/commandbased/commands-v2/profile-subsystems-commands.rst>
ALL @ <source/docs/software/commandbased/commands-v2/profilepid-subsystems-commands.rst>
ALL @ <source/docs/software/commandbased/commands-v2/structuring-command-based-project.rst>
ALL @ <source/docs/software/dashboards/glass/mech2d-widget.rst>
ALL @ <source/docs/software/hardware-apis/sensors/analog-inputs-software.rst>
ALL @ <source/docs/software/hardware-apis/sensors/analog-potentiometers-software.rst>
ALL @ <source/docs/software/hardware-apis/sensors/digital-inputs-software.rst>
ALL @ <source/docs/software/hardware-apis/sensors/limit-switch.rst>
ALL @ <source/docs/software/vision-processing/roborio/using-the-cameraserver-on-the-roborio.rst>
ALL @ <source/docs/software/vscode-overview/creating-robot-program.rst>
ALL @ <source/docs/software/wpilib-tools/robot-simulation/physics-sim.rst>
ALL @ <source/docs/software/wpilib-tools/robot-simulation/unit-testing.rst>
ALL @ <source/docs/xrp-robot/programming-xrp.rst>
ALL @ <source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst>
wpilibjExamples/src/main/java/org/wpilib/examples/tankdrivegamepad/Robot.java#L18,L25,L31,L33 @ <source/docs/software/hardware-apis/motors/wpi-drive-classes.rst:44>
wpilibcExamples/src/main/cpp/examples/TankDriveGamepad/cpp/Robot.cpp#L15,L22-L23,L29,L31 @ <source/docs/software/hardware-apis/motors/wpi-drive-classes.rst:51>
wpilibjExamples/src/main/java/org/wpilib/examples/tankdrivegamepad/Robot.java#L17-L21,L25,L32-L33,L43 @ <source/docs/software/hardware-apis/motors/wpi-drive-classes.rst:117>
wpilibcExamples/src/main/cpp/examples/TankDriveGamepad/cpp/Robot.cpp#L15-L19 @ <source/docs/software/hardware-apis/motors/wpi-drive-classes.rst:124>
wpilibcExamples/src/main/cpp/examples/TankDriveGamepad/cpp/Robot.cpp#L23,L27-L31 @ <source/docs/software/hardware-apis/motors/wpi-drive-classes.rst:131>
examples/robot/TankDrive/robot.py#L17-L24,L27-L30 @ <source/docs/software/hardware-apis/motors/wpi-drive-classes.rst:138>
wpilibjExamples/src/main/java/org/wpilib/examples/hatchbotinlined/subsystems/DriveSubsystem.java#L16-L26 @ <source/docs/software/hardware-apis/motors/wpi-drive-classes.rst:154>
wpilibjExamples/src/main/java/org/wpilib/examples/hatchbotinlined/subsystems/DriveSubsystem.java#L47-L53 @ <source/docs/software/hardware-apis/motors/wpi-drive-classes.rst:160>
wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/subsystems/DriveSubsystem.hpp#L54,L58-L67 @ <source/docs/software/hardware-apis/motors/wpi-drive-classes.rst:167>
wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/subsystems/DriveSubsystem.cpp#L21-L27 @ <source/docs/software/hardware-apis/motors/wpi-drive-classes.rst:176>
wpilibjExamples/src/main/java/org/wpilib/examples/mecanumdrive/Robot.java#L19-L22,L32-L48,L54 @ <source/docs/software/hardware-apis/motors/wpi-drive-classes.rst:226>
wpilibcExamples/src/main/cpp/examples/MecanumDrive/cpp/Robot.cpp#L42-L45,L50-L58,L18,L24-L28 @ <source/docs/software/hardware-apis/motors/wpi-drive-classes.rst:230>
examples/robot/MecanumDrive/robot.py#L18-L22,L25-L42 @ <source/docs/software/hardware-apis/motors/wpi-drive-classes.rst:234>

Outdated - Automatically Fixed

Details

Invalid - Manual Intervention Needed

Details

v2027.0.0-alpha-6 | a3c18d24a7953fbc454c5c8fb93d2d59e72eda55/wpilibjExamples/src/main/java/org/wpilib/snippets/motorcontrol/Robot.java#L50-L53 @ <source/docs/software/hardware-apis/motors/wpi-drive-classes.rst:83>

-	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

v2027.0.0-alpha-6 | a3c18d24a7953fbc454c5c8fb93d2d59e72eda55/wpilibcExamples/src/main/cpp/snippets/MotorControl/cpp/Robot.cpp#L49-L52 @ <source/docs/software/hardware-apis/motors/wpi-drive-classes.rst:87>

-	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

2027.0.0a6 | 011945f5752f8f8faf66e9176a58339639833b5d/snippets/robot/MotorControl/robot.py#L49-L52 @ <source/docs/software/hardware-apis/motors/wpi-drive-classes.rst:91>

-	49	 	        self.motor.setSafetyEnabled(True)
-	50	 	        self.motor.setSafetyEnabled(False)
-	51	 	        self.motor.setExpiration(0.1)
-	52	 	        self.motor.feed()
+	 	49	

v2027.0.0-alpha-6 | a3c18d24a7953fbc454c5c8fb93d2d59e72eda55/wpilibjExamples/src/main/java/org/wpilib/snippets/differentialdrive/Robot.java#L34-L42 @ <source/docs/software/hardware-apis/motors/wpi-drive-classes.rst:200>

-	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	

v2027.0.0-alpha-6 | a3c18d24a7953fbc454c5c8fb93d2d59e72eda55/wpilibcExamples/src/main/cpp/snippets/DifferentialDrive/cpp/Robot.cpp#L37-L47 @ <source/docs/software/hardware-apis/motors/wpi-drive-classes.rst:204>

-	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	

v2027.0.0-alpha-6 | a3c18d24a7953fbc454c5c8fb93d2d59e72eda55/wpilibjExamples/src/main/java/org/wpilib/snippets/mecanumdrive/Robot.java#L68-L73 @ <source/docs/software/hardware-apis/motors/wpi-drive-classes.rst:250>

-	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	

v2027.0.0-alpha-6 | a3c18d24a7953fbc454c5c8fb93d2d59e72eda55/wpilibcExamples/src/main/cpp/snippets/MecanumDrive/cpp/Robot.cpp#L43-L48 @ <source/docs/software/hardware-apis/motors/wpi-drive-classes.rst:254>

-	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	

@sciencewhiz

Copy link
Copy Markdown
Collaborator Author

\inspector check all

@sciencewhiz
sciencewhiz force-pushed the wpi-drive-classes2027 branch from 3d30b7c to a40b35c Compare May 31, 2026 23:48
@sciencewhiz
sciencewhiz force-pushed the wpi-drive-classes2027 branch from d2ded69 to 7c05ac5 Compare June 1, 2026 00:37
@sciencewhiz
sciencewhiz marked this pull request as ready for review June 1, 2026 01:23
@sciencewhiz
sciencewhiz changed the base branch from 2027 to main June 1, 2026 13:06
@sciencewhiz

Copy link
Copy Markdown
Collaborator Author

\inspector check all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant