From 353e97e05df30818a0ab132f009b58650449b889 Mon Sep 17 00:00:00 2001 From: awallis06 Date: Fri, 7 Aug 2026 12:39:49 -0400 Subject: [PATCH 01/15] Update creating-test-drivetrain-program-cpp-java-python.rst --- ...est-drivetrain-program-cpp-java-python.rst | 153 +++++++----------- 1 file changed, 54 insertions(+), 99 deletions(-) diff --git a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst index fdf02190ba..52862fd3e2 100644 --- a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst +++ b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst @@ -2,14 +2,9 @@ Once everything is installed, we're ready to create a robot program. WPILib comes with several templates for robot programs. Use of these templates is highly recommended for new users; however, advanced users are free to write their own robot code from scratch. This article walks through creating a project from one of the provided examples which has some code already written to drive a basic robot. -* :ref:`create_java_cpp_project` -* :ref:`create_python_project` - .. important:: This guide includes code examples that involve vendor hardware for the convenience of the user. In this document, :term:`PWM` refers to the motor controller included in the KOP. The CTRE tab references the Talon FX motor controller (Falcon 500 motor), but usage is similar for TalonSRX and VictorSPX. The REV tab references the CAN SPARK MAX controlling a brushless motor, but it's similar for brushed motor. There is an assumption that the user has already installed the required :doc:`vendordeps ` and configured the device(s) (update firmware, assign CAN IDs, etc) according to the manufacturer documentation ([CTRE](https://docs.ctr-electronics.com/) / [REV](https://docs.revrobotics.com/brushless/spark-max/gs)). -.. _create_java_cpp_project: - -## Creating a New WPILib Project (Java/C++) +## Creating a New WPILib Project (Java/C++/Python) In Visual Studio Code, click the WPILib logo in the top right to launch the WPILib Command Palette. Select :guilabel:`Create a new project`: @@ -28,7 +23,7 @@ This will bring up the language and base selection window. .. image:: /docs/software/vscode-overview/images/creating-robot-program/new-project-creator-language.png :alt: The language and base page of the WPILib New Project Creator -1. **Language**: This is the language (C++ or Java) that will be used for this project. +1. **Language**: This is the language (C++, Java or Python) that will be used for this project. 2. **Project Base**: This box is used to select the base class or example to generate the project from. For this example, select **Getting Started** After making the selections, click :guilabel:`Next`. @@ -81,42 +76,6 @@ For C++ projects, there is one more step to set up IntelliSense. Whenever we op .. image:: /docs/software/vscode-overview/images/importing-previous-project/cpp-configurations.png :alt: You must choose "Yes" to refresh the C++ configurations. -.. _create_python_project: - -## Creating a New WPILib Project (Python) - -Running the ``robotpy init`` command will initialize a new robot project: - -.. tab-set:: - - .. tab-item:: Windows - :sync: windows - - ```sh - py -3 -m robotpy init - ``` - - .. tab-item:: macOS - :sync: macos - - ```sh - python3 -m robotpy init - ``` - - .. tab-item:: Linux - :sync: linux - - ```sh - python3 -m robotpy init - ``` - -This will create a ``robot.py`` and ``pyproject.toml`` file, but will not overwrite an existing file. - -* The ``pyproject.toml`` file contains the requirements for your project, which are downloaded and installed via the ``robotpy sync`` command. -* The ``robot.py`` file is where you will put the your Robot class. - -.. seealso:: :ref:`docs/zero-to-robot/step-2/python-setup:Download RobotPy for roboRIO` - ## Basic Drivetrain example @@ -196,9 +155,9 @@ Now let's look at various parts of the code. ``` ```python - import wpilib # Used to get the joysticks - import wpilib.drive # Used for the DifferentialDrive class - import phoenix6 # CTRE library + import wpilib # Used to get the joysticks + from wpilib import DifferentialDrive # Used for the DifferentialDrive class + import phoenix6 # CTRE library ``` .. tab-item:: REV @@ -224,9 +183,9 @@ Now let's look at various parts of the code. ``` ```python - import wpilib # Used to get the joysticks - import wpilib.drive # Used for the DifferentialDrive class - import rev # REV library + import wpilib # Used to get the joysticks + from wpilib import DifferentialDrive # Used for the DifferentialDrive class + import rev # REV library ``` .. tab-item:: CTRE-Phoenix5 @@ -253,9 +212,9 @@ Now let's look at various parts of the code. ``` ```python - import wpilib # Used to get the joysticks - import wpilib.drive # Used for the DifferentialDrive class - import ctre # CTRE library + import wpilib # Used to get the joysticks + from wpilib import DifferentialDrive # Used for the DifferentialDrive class + import ctre # CTRE library ``` Our code needs to reference the components of WPILib that are used. In C++ this is accomplished using ``#include`` statements; in Java and Python it is done with ``import`` statements. The program references classes for ``Gamepad`` (for driving), ``PWMSparkMax`` / ``TalonFX`` / ``CANSparkMax`` / ``WPI_TalonSRX`` (for controlling motors), ``TimedRobot`` (the base class used for the example), ``Timer`` (used for autonomous), and ``DifferentialDrive`` (for connecting the Gamepad to the motors). @@ -342,7 +301,7 @@ Our code needs to reference the components of WPILib that are used. In C++ this super().__init__() self.leftDrive = phoenix6.hardware.TalonFX(1) self.rightDrive = phoenix6.hardware.TalonFX(2) - self.robotDrive = wpilib.drive.DifferentialDrive( + self.robotDrive = DifferentialDrive( self.leftDrive, self.rightDrive ) self.controller = wpilib.Gamepad(0) @@ -389,11 +348,24 @@ Our code needs to reference the components of WPILib that are used. In C++ this .. tab-item:: Python :sync: python - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/robotpy-rev/bc3ebc4/examples/getting-started/robot.py - :language: python - :linenos: - :lines: 13-30 - :lineno-start: 13 + ```python + class MyRobot(wpilib.TimedRobot): + def robotInit(self): + """ + This function is called upon program startup and + should be used for any initialization code. + """ + self.leftDrive = rev.SparkMax(0, 1, rev.SparkMax.MotorType.kBrushless) + self.rightDrive = rev.SparkMax(0, 2, rev.SparkMax.MotorType.kBrushless) + self.robotDrive = DifferentialDrive(self.leftDrive, self.rightDrive) + self.controller = wpilib.Gamepad(0) + self.timer = wpilib.Timer() + + # We need to invert one side of the drivetrain so that positive voltages + # result in both sides moving forward. Depending on how your robot's + # gearbox is constructed, you might have to invert the left side instead. + self.rightDrive.setInverted(True) + ``` .. tab-item:: CTRE-Phoenix5 :sync: ctre5 @@ -430,11 +402,24 @@ Our code needs to reference the components of WPILib that are used. In C++ this .. tab-item:: Python :sync: python - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/robotpy-ctre/5b8d33f/examples/getting-started/robot.py - :language: python - :linenos: - :lines: 13-30 - :lineno-start: 13 + ```python + class MyRobot(wpilib.TimedRobot): + def robotInit(self): + """ + This function is called upon program startup and + should be used for any initialization code. + """ + self.leftDrive = ctre.WPI_TalonFX(1) + self.rightDrive = ctre.WPI_TalonFX(2) + self.robotDrive = DifferentialDrive(self.leftDrive, self.rightDrive) + self.controller = wpilib.Gamepad(0) + self.timer = wpilib.Timer() + + # We need to invert one side of the drivetrain so that positive voltages + # result in both sides moving forward. Depending on how your robot's + # gearbox is constructed, you might have to invert the left side instead. + self.rightDrive.setInverted(True) + ``` The sample robot in our examples will have an Xbox Controller (or other Gamepad) on USB port 0 for arcade drive and two motors on PWM ports 0 and 1 (Vendor examples use CAN with IDs 1 and 2). Here we create objects of type ``DifferentialDrive`` (robotDrive), ``Gamepad`` (controller) and ``Timer`` (timer). This section of the code does three things: @@ -540,44 +525,14 @@ Like in Autonomous, the Teleop mode has a ``TeleopInit`` and ``TeleopPeriodic`` Utility Mode is used for testing robot functionality or running other code that shouldn't be run in a match. Similar to ``TeleopInit``, the ``UtilityInit`` and ``UtilityPeriodic`` methods are provided here for illustrative purposes only. -## Deploying the Project to a Robot - -.. tab-set:: - - .. tab-item:: Java/C++ - - In Visual Studio Code, click the WPILib logo in the top right to launch the WPILib Command Palette. Select :guilabel:`Deploy Robot Code` to deploy the code to the robot. - - .. note:: The run button in VS Code's debug view is not used to run robot code. Instead, use the :guilabel:`Deploy Robot Code` command as described above. The debug view's run button is used for running and debugging code on the local machine in simulation, which is not applicable for robot code that runs on Systemcore. - - For more detailed instructions, see :ref:`Deploy Java/C++ code `. +## Sync Code (Python only) - .. tab-item:: Python - - In the terminal, run the following command to deploy the code to the robot: - - .. tab-set:: - - .. tab-item:: Windows - :sync: windows - - ```sh - py -3 -m robotpy deploy - ``` - - .. tab-item:: macOS - :sync: macos - - ```sh - python3 -m robotpy deploy - ``` +For Python project, make sure to run the WPILib Command Palette command :guilabel:`RobotPy: Sync Robot Code` while online before connecting to your robot and deploying. - .. tab-item:: Linux - :sync: linux +## Deploying the Project to a Robot - ```sh - python3 -m robotpy deploy - ``` +In Visual Studio Code, click the WPILib logo in the top right to launch the WPILib Command Palette. Select :guilabel:`Deploy Robot Code` to deploy the code to the robot. - For more detailed instructions, see :doc:`Deploy Python code `. +.. note:: The run button in VS Code's debug view is not used to run robot code. Instead, use the :guilabel:`Deploy Robot Code` command as described above. The debug view's run button is used for running and debugging code on the local machine in simulation, which is not applicable for robot code that runs on Systemcore. +For more detailed instructions, see :ref:`Deploy Java/C++ code ` or :doc:`Deploy Python code `. From ea75e10b2a226b0b909e4041eaee56ce005e3e49 Mon Sep 17 00:00:00 2001 From: awallis06 Date: Fri, 7 Aug 2026 12:55:46 -0400 Subject: [PATCH 02/15] Update git-getting-started.rst --- source/docs/software/basic-programming/git-getting-started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/docs/software/basic-programming/git-getting-started.rst b/source/docs/software/basic-programming/git-getting-started.rst index 65e17d733a..6cc6ca3578 100644 --- a/source/docs/software/basic-programming/git-getting-started.rst +++ b/source/docs/software/basic-programming/git-getting-started.rst @@ -93,7 +93,7 @@ Now you'll want to open a PowerShell window and navigate to your project directo .. image:: images/git-getting-started/powershell.png :alt: An empty powershell window. -If a directory is empty, a file needs to be created in order for git to have something to track. In the below Empty Directory example, we created a file called ``README.md`` with the contents of ``# Example Repo``. For FRC\ |reg| Robot projects, the below Existing Project commands should be run in the root of a project :ref:`created by the VS Code WPILib Project Creator `. More details on the various commands can be found in the subsequent sections. +If a directory is empty, a file needs to be created in order for git to have something to track. In the below Empty Directory example, we created a file called ``README.md`` with the contents of ``# Example Repo``. For FRC\ |reg| Robot projects, the below Existing Project commands should be run in the root of a project :ref:`created by the VS Code WPILib Project Creator `. More details on the various commands can be found in the subsequent sections. .. note:: Replace the filepath ``"C:\Users\ExampleUser9007\Documents\Example Folder"`` with the one you want to create the repo in, and replace the remote URL ``https://github.com/ExampleUser9007/ExampleRepo.git`` with the URL for the repo you created in the previous steps. From ff9053e8d95dfe7d3d4d6d254c2942c56708b830 Mon Sep 17 00:00:00 2001 From: awallis06 Date: Fri, 7 Aug 2026 13:07:56 -0400 Subject: [PATCH 03/15] Update git-getting-started.rst --- source/docs/software/basic-programming/git-getting-started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/docs/software/basic-programming/git-getting-started.rst b/source/docs/software/basic-programming/git-getting-started.rst index 6cc6ca3578..6ebb6d34f6 100644 --- a/source/docs/software/basic-programming/git-getting-started.rst +++ b/source/docs/software/basic-programming/git-getting-started.rst @@ -93,7 +93,7 @@ Now you'll want to open a PowerShell window and navigate to your project directo .. image:: images/git-getting-started/powershell.png :alt: An empty powershell window. -If a directory is empty, a file needs to be created in order for git to have something to track. In the below Empty Directory example, we created a file called ``README.md`` with the contents of ``# Example Repo``. For FRC\ |reg| Robot projects, the below Existing Project commands should be run in the root of a project :ref:`created by the VS Code WPILib Project Creator `. More details on the various commands can be found in the subsequent sections. +If a directory is empty, a file needs to be created in order for git to have something to track. In the below Empty Directory example, we created a file called ``README.md`` with the contents of ``# Example Repo``. For FRC\ |reg| Robot projects, the below Existing Project commands should be run in the root of a project :ref:`created by the VS Code WPILib Project Creator `. More details on the various commands can be found in the subsequent sections. .. note:: Replace the filepath ``"C:\Users\ExampleUser9007\Documents\Example Folder"`` with the one you want to create the repo in, and replace the remote URL ``https://github.com/ExampleUser9007/ExampleRepo.git`` with the URL for the repo you created in the previous steps. From 43c881ae1628823a034c7e2bd0d81046bd2a130a Mon Sep 17 00:00:00 2001 From: awallis06 Date: Fri, 7 Aug 2026 13:08:50 -0400 Subject: [PATCH 04/15] got rid of unnecessary specification --- source/docs/software/basic-programming/git-getting-started.rst | 2 +- .../step-4/creating-test-drivetrain-program-cpp-java-python.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/docs/software/basic-programming/git-getting-started.rst b/source/docs/software/basic-programming/git-getting-started.rst index 6ebb6d34f6..6cc6ca3578 100644 --- a/source/docs/software/basic-programming/git-getting-started.rst +++ b/source/docs/software/basic-programming/git-getting-started.rst @@ -93,7 +93,7 @@ Now you'll want to open a PowerShell window and navigate to your project directo .. image:: images/git-getting-started/powershell.png :alt: An empty powershell window. -If a directory is empty, a file needs to be created in order for git to have something to track. In the below Empty Directory example, we created a file called ``README.md`` with the contents of ``# Example Repo``. For FRC\ |reg| Robot projects, the below Existing Project commands should be run in the root of a project :ref:`created by the VS Code WPILib Project Creator `. More details on the various commands can be found in the subsequent sections. +If a directory is empty, a file needs to be created in order for git to have something to track. In the below Empty Directory example, we created a file called ``README.md`` with the contents of ``# Example Repo``. For FRC\ |reg| Robot projects, the below Existing Project commands should be run in the root of a project :ref:`created by the VS Code WPILib Project Creator `. More details on the various commands can be found in the subsequent sections. .. note:: Replace the filepath ``"C:\Users\ExampleUser9007\Documents\Example Folder"`` with the one you want to create the repo in, and replace the remote URL ``https://github.com/ExampleUser9007/ExampleRepo.git`` with the URL for the repo you created in the previous steps. diff --git a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst index 52862fd3e2..64586fbc4b 100644 --- a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst +++ b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst @@ -4,7 +4,7 @@ Once everything is installed, we're ready to create a robot program. WPILib com .. important:: This guide includes code examples that involve vendor hardware for the convenience of the user. In this document, :term:`PWM` refers to the motor controller included in the KOP. The CTRE tab references the Talon FX motor controller (Falcon 500 motor), but usage is similar for TalonSRX and VictorSPX. The REV tab references the CAN SPARK MAX controlling a brushless motor, but it's similar for brushed motor. There is an assumption that the user has already installed the required :doc:`vendordeps ` and configured the device(s) (update firmware, assign CAN IDs, etc) according to the manufacturer documentation ([CTRE](https://docs.ctr-electronics.com/) / [REV](https://docs.revrobotics.com/brushless/spark-max/gs)). -## Creating a New WPILib Project (Java/C++/Python) +## Creating a New WPILib Project In Visual Studio Code, click the WPILib logo in the top right to launch the WPILib Command Palette. Select :guilabel:`Create a new project`: From d250a5cb18872c9ce9785e873f0762ca62996232 Mon Sep 17 00:00:00 2001 From: awallis06 Date: Wed, 12 Aug 2026 09:34:36 -0400 Subject: [PATCH 05/15] added back in RLIs for rev/ctre python drivetrain code --- ...est-drivetrain-program-cpp-java-python.rst | 46 ++++--------------- 1 file changed, 10 insertions(+), 36 deletions(-) diff --git a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst index 64586fbc4b..8796b6fe07 100644 --- a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst +++ b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst @@ -348,24 +348,11 @@ Our code needs to reference the components of WPILib that are used. In C++ this .. tab-item:: Python :sync: python - ```python - class MyRobot(wpilib.TimedRobot): - def robotInit(self): - """ - This function is called upon program startup and - should be used for any initialization code. - """ - self.leftDrive = rev.SparkMax(0, 1, rev.SparkMax.MotorType.kBrushless) - self.rightDrive = rev.SparkMax(0, 2, rev.SparkMax.MotorType.kBrushless) - self.robotDrive = DifferentialDrive(self.leftDrive, self.rightDrive) - self.controller = wpilib.Gamepad(0) - self.timer = wpilib.Timer() - - # We need to invert one side of the drivetrain so that positive voltages - # result in both sides moving forward. Depending on how your robot's - # gearbox is constructed, you might have to invert the left side instead. - self.rightDrive.setInverted(True) - ``` + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/robotpy-rev/bc3ebc4/examples/getting-started/robot.py + :language: python + :linenos: + :lines: 13-30 + :lineno-start: 13 .. tab-item:: CTRE-Phoenix5 :sync: ctre5 @@ -402,24 +389,11 @@ Our code needs to reference the components of WPILib that are used. In C++ this .. tab-item:: Python :sync: python - ```python - class MyRobot(wpilib.TimedRobot): - def robotInit(self): - """ - This function is called upon program startup and - should be used for any initialization code. - """ - self.leftDrive = ctre.WPI_TalonFX(1) - self.rightDrive = ctre.WPI_TalonFX(2) - self.robotDrive = DifferentialDrive(self.leftDrive, self.rightDrive) - self.controller = wpilib.Gamepad(0) - self.timer = wpilib.Timer() - - # We need to invert one side of the drivetrain so that positive voltages - # result in both sides moving forward. Depending on how your robot's - # gearbox is constructed, you might have to invert the left side instead. - self.rightDrive.setInverted(True) - ``` + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/robotpy-ctre/5b8d33f/examples/getting-started/robot.py + :language: python + :linenos: + :lines: 13-30 + :lineno-start: 13 The sample robot in our examples will have an Xbox Controller (or other Gamepad) on USB port 0 for arcade drive and two motors on PWM ports 0 and 1 (Vendor examples use CAN with IDs 1 and 2). Here we create objects of type ``DifferentialDrive`` (robotDrive), ``Gamepad`` (controller) and ``Timer`` (timer). This section of the code does three things: From e2f30867c94b1b81779bc90261a48de5e6e71cd3 Mon Sep 17 00:00:00 2001 From: awallis06 Date: Wed, 12 Aug 2026 16:31:43 -0400 Subject: [PATCH 06/15] updated rli links --- ...ng-test-drivetrain-program-cpp-java-python.rst | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst index 8796b6fe07..8c39d7c602 100644 --- a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst +++ b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst @@ -183,9 +183,8 @@ Now let's look at various parts of the code. ``` ```python - import wpilib # Used to get the joysticks - from wpilib import DifferentialDrive # Used for the DifferentialDrive class - import rev # REV library + import wpilib # Used to get the joysticks and DifferentialDrive class + import rev # REV library ``` .. tab-item:: CTRE-Phoenix5 @@ -214,7 +213,7 @@ Now let's look at various parts of the code. ```python import wpilib # Used to get the joysticks from wpilib import DifferentialDrive # Used for the DifferentialDrive class - import ctre # CTRE library + import phoenix5 # Phoenix5 library ``` Our code needs to reference the components of WPILib that are used. In C++ this is accomplished using ``#include`` statements; in Java and Python it is done with ``import`` statements. The program references classes for ``Gamepad`` (for driving), ``PWMSparkMax`` / ``TalonFX`` / ``CANSparkMax`` / ``WPI_TalonSRX`` (for controlling motors), ``TimedRobot`` (the base class used for the example), ``Timer`` (used for autonomous), and ``DifferentialDrive`` (for connecting the Gamepad to the motors). @@ -348,11 +347,11 @@ Our code needs to reference the components of WPILib that are used. In C++ this .. tab-item:: Python :sync: python - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/robotpy-rev/bc3ebc4/examples/getting-started/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/robotpy-rev/2027.0.0a5/examples/getting-started/robot.py :language: python :linenos: - :lines: 13-30 - :lineno-start: 13 + :lines: 12-28 + :lineno-start: 12 .. tab-item:: CTRE-Phoenix5 :sync: ctre5 @@ -389,7 +388,7 @@ Our code needs to reference the components of WPILib that are used. In C++ this .. tab-item:: Python :sync: python - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/robotpy-ctre/5b8d33f/examples/getting-started/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/robotpy-ctre/2026.1.0.1/examples/getting-started/robot.py :language: python :linenos: :lines: 13-30 From b0ad6dff26c21ff329903af0de14402fbfb02106 Mon Sep 17 00:00:00 2001 From: awallis06 Date: Wed, 12 Aug 2026 16:44:05 -0400 Subject: [PATCH 07/15] Revert "updated rli links" This reverts commit e2f30867c94b1b81779bc90261a48de5e6e71cd3. --- ...ng-test-drivetrain-program-cpp-java-python.rst | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst index 8c39d7c602..8796b6fe07 100644 --- a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst +++ b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst @@ -183,8 +183,9 @@ Now let's look at various parts of the code. ``` ```python - import wpilib # Used to get the joysticks and DifferentialDrive class - import rev # REV library + import wpilib # Used to get the joysticks + from wpilib import DifferentialDrive # Used for the DifferentialDrive class + import rev # REV library ``` .. tab-item:: CTRE-Phoenix5 @@ -213,7 +214,7 @@ Now let's look at various parts of the code. ```python import wpilib # Used to get the joysticks from wpilib import DifferentialDrive # Used for the DifferentialDrive class - import phoenix5 # Phoenix5 library + import ctre # CTRE library ``` Our code needs to reference the components of WPILib that are used. In C++ this is accomplished using ``#include`` statements; in Java and Python it is done with ``import`` statements. The program references classes for ``Gamepad`` (for driving), ``PWMSparkMax`` / ``TalonFX`` / ``CANSparkMax`` / ``WPI_TalonSRX`` (for controlling motors), ``TimedRobot`` (the base class used for the example), ``Timer`` (used for autonomous), and ``DifferentialDrive`` (for connecting the Gamepad to the motors). @@ -347,11 +348,11 @@ Our code needs to reference the components of WPILib that are used. In C++ this .. tab-item:: Python :sync: python - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/robotpy-rev/2027.0.0a5/examples/getting-started/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/robotpy-rev/bc3ebc4/examples/getting-started/robot.py :language: python :linenos: - :lines: 12-28 - :lineno-start: 12 + :lines: 13-30 + :lineno-start: 13 .. tab-item:: CTRE-Phoenix5 :sync: ctre5 @@ -388,7 +389,7 @@ Our code needs to reference the components of WPILib that are used. In C++ this .. tab-item:: Python :sync: python - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/robotpy-ctre/2026.1.0.1/examples/getting-started/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/robotpy-ctre/5b8d33f/examples/getting-started/robot.py :language: python :linenos: :lines: 13-30 From 1b5913de52b01adf925fc362eadd64bf2f954705 Mon Sep 17 00:00:00 2001 From: awallis06 Date: Thu, 13 Aug 2026 09:25:42 -0400 Subject: [PATCH 08/15] removed unused redirect --- source/redirects.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/source/redirects.txt b/source/redirects.txt index 7f4075a167..72f6ccecf8 100644 --- a/source/redirects.txt +++ b/source/redirects.txt @@ -309,7 +309,6 @@ "docs/software/wpilib-tools/choreo/index.rst" "docs/software/pathplanning/choreo/index.rst" "docs/networking/networking-introduction/om5p-ac-radio-modification.rst" "docs/zero-to-robot/step-3/radio-programming.rst" "docs/software/driverstation/programming-radios-for-fms-offseason.rst" "docs/zero-to-robot/step-3/radio-programming.rst" -"docs/yearly-overview/2026-Game-Data.rst" "docs/yearly-overview/2026-game-data.rst" "docs/software/hardware-apis/sensors/counters.rst" "docs/yearly-overview/removed-features.rst" "docs/software/hardware-apis/sensors/ultrasonics-software.rst" "docs/yearly-overview/removed-features.rst" "docs/hardware/sensors/ultrasonics-hardware.rst" "docs/yearly-overview/removed-features.rst" From 87ac0f17b9aa2e74c57d92c050d60aa9abc2011f Mon Sep 17 00:00:00 2001 From: awallis06 Date: Thu, 13 Aug 2026 09:27:03 -0400 Subject: [PATCH 09/15] Revert "removed unused redirect" This reverts commit 1b5913de52b01adf925fc362eadd64bf2f954705. --- source/redirects.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/source/redirects.txt b/source/redirects.txt index 72f6ccecf8..7f4075a167 100644 --- a/source/redirects.txt +++ b/source/redirects.txt @@ -309,6 +309,7 @@ "docs/software/wpilib-tools/choreo/index.rst" "docs/software/pathplanning/choreo/index.rst" "docs/networking/networking-introduction/om5p-ac-radio-modification.rst" "docs/zero-to-robot/step-3/radio-programming.rst" "docs/software/driverstation/programming-radios-for-fms-offseason.rst" "docs/zero-to-robot/step-3/radio-programming.rst" +"docs/yearly-overview/2026-Game-Data.rst" "docs/yearly-overview/2026-game-data.rst" "docs/software/hardware-apis/sensors/counters.rst" "docs/yearly-overview/removed-features.rst" "docs/software/hardware-apis/sensors/ultrasonics-software.rst" "docs/yearly-overview/removed-features.rst" "docs/hardware/sensors/ultrasonics-hardware.rst" "docs/yearly-overview/removed-features.rst" From 20dcde5b7517cbbef5353adfa0b2007decfb45e1 Mon Sep 17 00:00:00 2001 From: awallis06 Date: Thu, 13 Aug 2026 11:37:07 -0400 Subject: [PATCH 10/15] updated rli links for robotpy-rev and robotpy-ctre getting started examples --- ...ng-test-drivetrain-program-cpp-java-python.rst | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst index 8796b6fe07..634851117a 100644 --- a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst +++ b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst @@ -183,9 +183,8 @@ Now let's look at various parts of the code. ``` ```python - import wpilib # Used to get the joysticks - from wpilib import DifferentialDrive # Used for the DifferentialDrive class - import rev # REV library + import wpilib # Used to get the joysticks and DifferentialDrive class + import rev # REV library ``` .. tab-item:: CTRE-Phoenix5 @@ -214,7 +213,7 @@ Now let's look at various parts of the code. ```python import wpilib # Used to get the joysticks from wpilib import DifferentialDrive # Used for the DifferentialDrive class - import ctre # CTRE library + import phoenix5 # Phoenix5 library ``` Our code needs to reference the components of WPILib that are used. In C++ this is accomplished using ``#include`` statements; in Java and Python it is done with ``import`` statements. The program references classes for ``Gamepad`` (for driving), ``PWMSparkMax`` / ``TalonFX`` / ``CANSparkMax`` / ``WPI_TalonSRX`` (for controlling motors), ``TimedRobot`` (the base class used for the example), ``Timer`` (used for autonomous), and ``DifferentialDrive`` (for connecting the Gamepad to the motors). @@ -348,11 +347,11 @@ Our code needs to reference the components of WPILib that are used. In C++ this .. tab-item:: Python :sync: python - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/robotpy-rev/bc3ebc4/examples/getting-started/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/robotpy-rev/29651ec/examples/getting-started/robot.py :language: python :linenos: - :lines: 13-30 - :lineno-start: 13 + :lines: 12-28 + :lineno-start: 12 .. tab-item:: CTRE-Phoenix5 :sync: ctre5 @@ -389,7 +388,7 @@ Our code needs to reference the components of WPILib that are used. In C++ this .. tab-item:: Python :sync: python - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/robotpy-ctre/5b8d33f/examples/getting-started/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/robotpy-ctre/126e0a4/examples/getting-started/robot.py :language: python :linenos: :lines: 13-30 From 3b82904cc0e36f2e2c1359f7d9a9a73666d61b1c Mon Sep 17 00:00:00 2001 From: sciencewhiz Date: Sat, 5 Sep 2026 11:42:33 -0700 Subject: [PATCH 11/15] Remove parts dependent on python VSCode --- ...est-drivetrain-program-cpp-java-python.rst | 50 ++++++++++++++++--- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst index 8ff9e77e50..de278e97a0 100644 --- a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst +++ b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst @@ -1,10 +1,15 @@ # Creating your Test Drivetrain Program (Java/C++/Python) Once everything is installed, we're ready to create a robot program. WPILib comes with several templates for robot programs. Use of these templates is highly recommended for new users; however, advanced users are free to write their own robot code from scratch. This article walks through creating a project from one of the provided examples which has some code already written to drive a basic robot. + +* :ref:`create_java_cpp_project` +* :ref:`create_python_project` .. important:: This guide includes code examples that involve vendor hardware for the convenience of the user. In this document, :term:`PWM` refers to the motor controller included in the KOP. The CTRE tab references the Talon FX motor controller (Falcon 500 motor), but usage is similar for TalonSRX and VictorSPX. The REV tab references the CAN SPARK MAX controlling a brushless motor, but it's similar for brushed motor. There is an assumption that the user has already installed the required :doc:`vendordeps ` and configured the device(s) (update firmware, assign CAN IDs, etc) according to the manufacturer documentation ([CTRE](https://docs.ctr-electronics.com/) / [REV](https://docs.revrobotics.com/brushless/spark-max/gs)). -## Creating a New WPILib Project +.. _create_java_cpp_project: + +## Creating a New WPILib Project (Java/C++) In Visual Studio Code, click the WPILib logo in the top right to launch the WPILib Command Palette. Select :guilabel:`Create a new project`: @@ -23,7 +28,7 @@ This will bring up the language and base selection window. .. image:: /docs/software/vscode-overview/images/creating-robot-program/new-project-creator-language.png :alt: The language and base page of the WPILib New Project Creator -1. **Language**: This is the language (C++, Java or Python) that will be used for this project. +1. **Language**: This is the language (C++ or Java) that will be used for this project. 2. **Project Base**: This box is used to select the base class or example to generate the project from. For this example, select **Getting Started** After making the selections, click :guilabel:`Next`. @@ -534,14 +539,43 @@ Like in Autonomous, the Teleop mode has a ``TeleopInit`` and ``TeleopPeriodic`` Utility Mode is used for testing robot functionality or running other code that shouldn't be run in a match. Similar to ``TeleopInit``, the ``UtilityInit`` and ``UtilityPeriodic`` methods are provided here for illustrative purposes only. -## Sync Code (Python only) +## Deploying the Project to a Robot -For Python project, make sure to run the WPILib Command Palette command :guilabel:`RobotPy: Sync Robot Code` while online before connecting to your robot and deploying. +.. tab-set:: -## Deploying the Project to a Robot + .. tab-item:: Java/C++ + + In Visual Studio Code, click the WPILib logo in the top right to launch the WPILib Command Palette. Select :guilabel:`Deploy Robot Code` to deploy the code to the robot. -In Visual Studio Code, click the WPILib logo in the top right to launch the WPILib Command Palette. Select :guilabel:`Deploy Robot Code` to deploy the code to the robot. + .. note:: The run button in VS Code's debug view is not used to run robot code. Instead, use the :guilabel:`Deploy Robot Code` command as described above. The debug view's run button is used for running and debugging code on the local machine in simulation, which is not applicable for robot code that runs on Systemcore. -.. note:: The run button in VS Code's debug view is not used to run robot code. Instead, use the :guilabel:`Deploy Robot Code` command as described above. The debug view's run button is used for running and debugging code on the local machine in simulation, which is not applicable for robot code that runs on Systemcore. + For more detailed instructions, see :ref:`Deploy Java/C++ code `. + + .. tab-item:: Python + + In the terminal, run the following command to deploy the code to the robot: + + .. tab-set:: + + .. tab-item:: Windows + :sync: windows + + ```sh + py -3 -m robotpy deploy + ``` + + .. tab-item:: macOS + :sync: macos + + ```sh + python3 -m robotpy deploy + ``` + + .. tab-item:: Linux + :sync: linux + + ```sh + python3 -m robotpy deploy + ``` -For more detailed instructions, see :ref:`Deploy Java/C++ code ` or :doc:`Deploy Python code `. + For more detailed instructions, see :doc:`Deploy Python code `. \ No newline at end of file From bf7967969f63faf41584618373008e822b572b7d Mon Sep 17 00:00:00 2001 From: sciencewhiz Date: Sat, 5 Sep 2026 11:51:43 -0700 Subject: [PATCH 12/15] Fix broken link --- .../docs/software/basic-programming/git-getting-started.rst | 2 +- .../creating-test-drivetrain-program-cpp-java-python.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/docs/software/basic-programming/git-getting-started.rst b/source/docs/software/basic-programming/git-getting-started.rst index 6cc6ca3578..65e17d733a 100644 --- a/source/docs/software/basic-programming/git-getting-started.rst +++ b/source/docs/software/basic-programming/git-getting-started.rst @@ -93,7 +93,7 @@ Now you'll want to open a PowerShell window and navigate to your project directo .. image:: images/git-getting-started/powershell.png :alt: An empty powershell window. -If a directory is empty, a file needs to be created in order for git to have something to track. In the below Empty Directory example, we created a file called ``README.md`` with the contents of ``# Example Repo``. For FRC\ |reg| Robot projects, the below Existing Project commands should be run in the root of a project :ref:`created by the VS Code WPILib Project Creator `. More details on the various commands can be found in the subsequent sections. +If a directory is empty, a file needs to be created in order for git to have something to track. In the below Empty Directory example, we created a file called ``README.md`` with the contents of ``# Example Repo``. For FRC\ |reg| Robot projects, the below Existing Project commands should be run in the root of a project :ref:`created by the VS Code WPILib Project Creator `. More details on the various commands can be found in the subsequent sections. .. note:: Replace the filepath ``"C:\Users\ExampleUser9007\Documents\Example Folder"`` with the one you want to create the repo in, and replace the remote URL ``https://github.com/ExampleUser9007/ExampleRepo.git`` with the URL for the repo you created in the previous steps. diff --git a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst index de278e97a0..71be83fe82 100644 --- a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst +++ b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst @@ -1,7 +1,7 @@ # Creating your Test Drivetrain Program (Java/C++/Python) Once everything is installed, we're ready to create a robot program. WPILib comes with several templates for robot programs. Use of these templates is highly recommended for new users; however, advanced users are free to write their own robot code from scratch. This article walks through creating a project from one of the provided examples which has some code already written to drive a basic robot. - + * :ref:`create_java_cpp_project` * :ref:`create_python_project` @@ -578,4 +578,4 @@ Utility Mode is used for testing robot functionality or running other code that python3 -m robotpy deploy ``` - For more detailed instructions, see :doc:`Deploy Python code `. \ No newline at end of file + For more detailed instructions, see :doc:`Deploy Python code `. From c3dfb79646bd4d0628691cc3ba42277840f4a73a Mon Sep 17 00:00:00 2001 From: sciencewhiz Date: Sat, 5 Sep 2026 13:38:12 -0700 Subject: [PATCH 13/15] Manually update RLIs --- ...est-drivetrain-program-cpp-java-python.rst | 69 +++++++++---------- 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst index 71be83fe82..b693467147 100644 --- a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst +++ b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst @@ -126,11 +126,11 @@ First, here is what a simple code can look like for a Drivetrain with PWM contro .. tab-set-code:: - .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-6/wpilibjExamples/src/main/java/org/wpilib/examples/gettingstarted/Robot.java + .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-7/wpilibjExamples/src/main/java/org/wpilib/examples/gettingstarted/Robot.java :language: java :linenos: - .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-6/wpilibcExamples/src/main/cpp/examples/GettingStarted/cpp/Robot.cpp + .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-7/wpilibcExamples/src/main/cpp/examples/GettingStarted/cpp/Robot.cpp :language: c++ :linenos: @@ -152,15 +152,15 @@ Now let's look at various parts of the code. .. tab-item:: Java :sync: java - .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-6/wpilibjExamples/src/main/java/org/wpilib/examples/gettingstarted/Robot.java + .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-7/wpilibjExamples/src/main/java/org/wpilib/examples/gettingstarted/Robot.java :language: java - :lines: 7-12 + :lines: 7-11 :linenos: .. tab-item:: C++ :sync: c++ - .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-6/wpilibcExamples/src/main/cpp/examples/GettingStarted/cpp/Robot.cpp + .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-7/wpilibcExamples/src/main/cpp/examples/GettingStarted/cpp/Robot.cpp :language: c++ :lines: 5-9 :lineno-match: @@ -273,17 +273,17 @@ Our code needs to reference the components of WPILib that are used. In C++ this .. tab-item:: Java :sync: java - .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-6/wpilibjExamples/src/main/java/org/wpilib/examples/gettingstarted/Robot.java + .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-7/wpilibjExamples/src/main/java/org/wpilib/examples/gettingstarted/Robot.java :language: java - :lines: 19-25 + :lines: 18-24 :lineno-match: .. tab-item:: C++ :sync: c++ - .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-6/wpilibcExamples/src/main/cpp/examples/GettingStarted/cpp/Robot.cpp + .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-7/wpilibcExamples/src/main/cpp/examples/GettingStarted/cpp/Robot.cpp :language: c++ - :lines: 50-60 + :lines: 47-56 :lineno-match: .. tab-item:: Python @@ -291,9 +291,8 @@ Our code needs to reference the components of WPILib that are used. In C++ this .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a6/examples/robot/GettingStarted/robot.py :language: python - :linenos: + :lineno-match: :lines: 11-28 - :lineno-start: 11 .. tab-item:: CTRE-Phoenix6 :sync: ctre6 @@ -440,7 +439,7 @@ The sample robot in our examples will have an Xbox Controller (or other Gamepad) 1. Defines the variables as members of our Robot class. 2. Initializes the variables. -.. note:: The variable initializations for C++ are in the ``private`` section at the bottom of the program. This means they are private to the class (``Robot``). The C++ code also sets the Motor Safety expiration to 0.1 seconds (the drive will shut off if we don't give it a command every .1 seconds) and starts the ``Timer`` used for autonomous. +.. note:: The variable initializations for C++ are in the ``private`` section at the bottom of the program. This means they are private to the class (``Robot``). ## Robot Initialization @@ -449,28 +448,26 @@ The sample robot in our examples will have an Xbox Controller (or other Gamepad) .. tab-item:: Java :sync: java - .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-6/wpilibjExamples/src/main/java/org/wpilib/examples/gettingstarted/Robot.java + .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-7/wpilibjExamples/src/main/java/org/wpilib/examples/gettingstarted/Robot.java :language: java - :lines: 27-28,32-36 - :linenos: - :lineno-start: 27 + :lines: 27-32 + :lineno-match: .. tab-item:: C++ :sync: c++ - .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-6/wpilibcExamples/src/main/cpp/examples/GettingStarted/cpp/Robot.cpp + .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-7/wpilibcExamples/src/main/cpp/examples/GettingStarted/cpp/Robot.cpp :language: c++ - :lines: 12-13,17-24 - :linenos: - :lineno-start: 12 + :lines: 13-20 + :lineno-match: .. tab-item:: Python :sync: python - ```python - def __init__(self): - super().__init__() - ``` + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a6/examples/robot/GettingStarted/robot.py + :language: python + :lines: 12-27 + :lineno-match: The ``Robot`` constructor for our sample program inverts the right side of the drivetrain. Depending on your drive setup, you might need to invert the left side instead. @@ -478,14 +475,14 @@ The ``Robot`` constructor for our sample program inverts the right side of the d .. tab-set-code:: - .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-6/wpilibjExamples/src/main/java/org/wpilib/examples/gettingstarted/Robot.java + .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-7/wpilibjExamples/src/main/java/org/wpilib/examples/gettingstarted/Robot.java :language: java - :lines: 38-54 + :lines: 34-50 :lineno-match: - .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-6/wpilibcExamples/src/main/cpp/examples/GettingStarted/cpp/Robot.cpp + .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-7/wpilibcExamples/src/main/cpp/examples/GettingStarted/cpp/Robot.cpp :language: c++ - :lines: 25-36 + :lines: 22-33 :lineno-match: .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a6/examples/robot/GettingStarted/robot.py @@ -501,14 +498,14 @@ The ``AutonomousInit`` method is run once each time the robot transitions to aut .. tab-set-code:: - .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-6/wpilibjExamples/src/main/java/org/wpilib/examples/gettingstarted/Robot.java + .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-7/wpilibjExamples/src/main/java/org/wpilib/examples/gettingstarted/Robot.java :language: java - :lines: 56-64 + :lines: 52-60 :lineno-match: - .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-6/wpilibcExamples/src/main/cpp/examples/GettingStarted/cpp/Robot.cpp + .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-7/wpilibcExamples/src/main/cpp/examples/GettingStarted/cpp/Robot.cpp :language: c++ - :lines: 38-45 + :lines: 35-40 :lineno-match: .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a6/examples/robot/GettingStarted/robot.py @@ -522,14 +519,14 @@ Like in Autonomous, the Teleop mode has a ``TeleopInit`` and ``TeleopPeriodic`` .. tab-set-code:: - .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-6/wpilibjExamples/src/main/java/org/wpilib/examples/gettingstarted/Robot.java + .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-7/wpilibjExamples/src/main/java/org/wpilib/examples/gettingstarted/Robot.java :language: java - :lines: 66-73 + :lines: 62-68 :lineno-match: - .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-6/wpilibcExamples/src/main/cpp/examples/GettingStarted/cpp/Robot.cpp + .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-7/wpilibcExamples/src/main/cpp/examples/GettingStarted/cpp/Robot.cpp :language: c++ - :lines: 45-48 + :lines: 42-44 :lineno-match: .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a6/examples/robot/GettingStarted/robot.py From 622e892fbe46c637e304c46aada823b649d2f44b Mon Sep 17 00:00:00 2001 From: sciencewhiz Date: Sat, 5 Sep 2026 14:24:08 -0700 Subject: [PATCH 14/15] Fix some RLIs --- .../creating-test-drivetrain-program-cpp-java-python.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst index b693467147..25e065a07c 100644 --- a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst +++ b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst @@ -283,7 +283,7 @@ Our code needs to reference the components of WPILib that are used. In C++ this .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2027.0.0-alpha-7/wpilibcExamples/src/main/cpp/examples/GettingStarted/cpp/Robot.cpp :language: c++ - :lines: 47-56 + :lines: 46-55 :lineno-match: .. tab-item:: Python @@ -466,7 +466,7 @@ The sample robot in our examples will have an Xbox Controller (or other Gamepad) .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a6/examples/robot/GettingStarted/robot.py :language: python - :lines: 12-27 + :lines: 12-17, 24-27 :lineno-match: The ``Robot`` constructor for our sample program inverts the right side of the drivetrain. Depending on your drive setup, you might need to invert the left side instead. From 896fafb8ce9decc6e77a6c8c3c6c4f57f5f1f20e Mon Sep 17 00:00:00 2001 From: sciencewhiz Date: Sat, 5 Sep 2026 15:26:35 -0700 Subject: [PATCH 15/15] Fix line no --- .../creating-test-drivetrain-program-cpp-java-python.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst index 25e065a07c..24f4a66ba3 100644 --- a/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst +++ b/source/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.rst @@ -467,7 +467,8 @@ The sample robot in our examples will have an Xbox Controller (or other Gamepad) .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a6/examples/robot/GettingStarted/robot.py :language: python :lines: 12-17, 24-27 - :lineno-match: + :linesnos: + :lineno-start: 12 The ``Robot`` constructor for our sample program inverts the right side of the drivetrain. Depending on your drive setup, you might need to invert the left side instead.