From 78c4e886e7f319993e547f89eb9c613a0783c70d Mon Sep 17 00:00:00 2001 From: sciencewhiz Date: Thu, 2 Jan 2025 18:29:42 -0800 Subject: [PATCH] Update Python Example RLIs (#2901) * Update Python Example RLIs * Autofix RLIs --------- Co-authored-by: github-actions --- .github/workflows/inspector.json | 2 +- .../docs/contributing/frc-docs/style-guide.rst | 2 +- .../controllers/profiled-pidcontroller.rst | 2 +- .../controllers/trapezoidal-profiles.rst | 2 +- .../state-space-flywheel-walkthrough.rst | 16 ++++++++-------- .../state-space/state-space-observers.rst | 2 +- .../basic-programming/robot-preferences.rst | 10 +++++----- .../can-devices/power-distribution-module.rst | 8 ++++---- .../using-the-cameraserver-on-the-roborio.rst | 6 +++--- ...g-test-drivetrain-program-cpp-java-python.rst | 8 ++++---- 10 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/inspector.json b/.github/workflows/inspector.json index 6f3e432edd..cce43ed60c 100644 --- a/.github/workflows/inspector.json +++ b/.github/workflows/inspector.json @@ -13,7 +13,7 @@ { "baseUrl": "https://raw.githubusercontent.com/robotpy/examples/", "versionScheme": "\\d{4}\\.\\d\\.\\d\\.\\d(?:-(?:alpha|beta)-\\d)?|[0-9a-f]{40}", - "latestVersion": "d89b0587a1e1111239728140466c7dc4324d4005" + "latestVersion": "36c64f286a38478f5e04d60321c57b0a9d1c5f17" }, { "baseUrl": "https://raw.githubusercontent.com/wpilibsuite/vscode-wpilib/", diff --git a/source/docs/contributing/frc-docs/style-guide.rst b/source/docs/contributing/frc-docs/style-guide.rst index a7decb2ecd..3b7d6cc9df 100644 --- a/source/docs/contributing/frc-docs/style-guide.rst +++ b/source/docs/contributing/frc-docs/style-guide.rst @@ -111,7 +111,7 @@ When possible, instead of using code blocks, an RLI should be used. This pulls :lines: 50-60 :lineno-match: -.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/GettingStarted/robot.py +.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/GettingStarted/robot.py :language: python :lines: 12-29 :lineno-match: diff --git a/source/docs/software/advanced-controls/controllers/profiled-pidcontroller.rst b/source/docs/software/advanced-controls/controllers/profiled-pidcontroller.rst index ca413670bf..9783635b6f 100644 --- a/source/docs/software/advanced-controls/controllers/profiled-pidcontroller.rst +++ b/source/docs/software/advanced-controls/controllers/profiled-pidcontroller.rst @@ -153,7 +153,7 @@ A more complete example of ``ProfiledPIDController`` usage is provided in the El :lines: 5- :lineno-match: - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/ElevatorProfiledPID/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/ElevatorProfiledPID/robot.py :language: python :lines: 8- :lineno-match: diff --git a/source/docs/software/advanced-controls/controllers/trapezoidal-profiles.rst b/source/docs/software/advanced-controls/controllers/trapezoidal-profiles.rst index 99c88f60b8..2031eadcad 100644 --- a/source/docs/software/advanced-controls/controllers/trapezoidal-profiles.rst +++ b/source/docs/software/advanced-controls/controllers/trapezoidal-profiles.rst @@ -172,7 +172,7 @@ A more complete example of ``TrapezoidProfile`` usage is provided in the Elevato :lines: 5- :lineno-match: - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/ElevatorTrapezoidProfile/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/ElevatorTrapezoidProfile/robot.py :language: python :lines: 8- :lineno-match: diff --git a/source/docs/software/advanced-controls/state-space/state-space-flywheel-walkthrough.rst b/source/docs/software/advanced-controls/state-space/state-space-flywheel-walkthrough.rst index 98582fffde..e6a62dd4cf 100644 --- a/source/docs/software/advanced-controls/state-space/state-space-flywheel-walkthrough.rst +++ b/source/docs/software/advanced-controls/state-space/state-space-flywheel-walkthrough.rst @@ -86,12 +86,12 @@ The ``LinearSystem`` class contains methods for easily creating state-space syst .. tab-item:: Python - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/StateSpaceFlywheelSysId/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/StateSpaceFlywheelSysId/robot.py :language: python :lines: 23-27 :lineno-match: - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/StateSpaceFlywheelSysId/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/StateSpaceFlywheelSysId/robot.py :language: python :lines: 37-48 :lineno-match: @@ -133,12 +133,12 @@ The ``LinearSystem`` class contains methods to easily create a model of a flywhe .. tab-item:: Python :sync: python - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/StateSpaceFlywheel/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/StateSpaceFlywheel/robot.py :language: python :lines: 21-25 :lineno-match: - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/StateSpaceFlywheel/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/StateSpaceFlywheel/robot.py :language: python :lines: 37-46 :lineno-match: @@ -182,7 +182,7 @@ Because the feedback controller computes error using the :term:`x-hat` estimated .. tab-item:: Python :sync: python - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/StateSpaceFlywheel/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/StateSpaceFlywheel/robot.py :language: python :lines: 48-54 :lineno-match: @@ -223,7 +223,7 @@ Much like ``SimpleMotorFeedforward`` can be used to generate feedforward voltage .. tab-item:: Python :sync: python - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/StateSpaceFlywheel/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/StateSpaceFlywheel/robot.py :language: python :lines: 56-66 :lineno-match: @@ -258,7 +258,7 @@ LinearSystemLoop combines our system, controller, and observer that we created e .. tab-item:: Python :sync: python - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/StateSpaceFlywheel/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/StateSpaceFlywheel/robot.py :language: python :lines: 68-71 :lineno-match: @@ -291,7 +291,7 @@ Once we have our ``LinearSystemLoop``, the only thing left to do is actually run .. tab-item:: Python :sync: python - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/StateSpaceFlywheel/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/StateSpaceFlywheel/robot.py :language: python :lines: 87-109 :lineno-match: diff --git a/source/docs/software/advanced-controls/state-space/state-space-observers.rst b/source/docs/software/advanced-controls/state-space/state-space-observers.rst index 1a41b1c123..53ca8cb70d 100644 --- a/source/docs/software/advanced-controls/state-space/state-space-observers.rst +++ b/source/docs/software/advanced-controls/state-space/state-space-observers.rst @@ -110,7 +110,7 @@ WPILib's Kalman Filter classes' constructors take a linear system, a vector of p .. tab-item:: Python - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/StateSpaceFlywheel/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/StateSpaceFlywheel/robot.py :language: python :lines: 48-54 :lineno-match: diff --git a/source/docs/software/basic-programming/robot-preferences.rst b/source/docs/software/basic-programming/robot-preferences.rst index d256e06f08..cbc7870644 100644 --- a/source/docs/software/basic-programming/robot-preferences.rst +++ b/source/docs/software/basic-programming/robot-preferences.rst @@ -34,11 +34,11 @@ This example shows how to utilize Preferences to change the setpoint of a PID co .. tab-item:: Python :sync: Python - .. rli:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/ArmSimulation/constants.py + .. rli:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/ArmSimulation/constants.py :language: python :lines: 18-23 - .. rli:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/ArmSimulation/subsytems/arm.py + .. rli:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/ArmSimulation/subsytems/arm.py :language: python :lines: 20-23,37-41 @@ -69,7 +69,7 @@ If using the Command Framework, this type of code could be placed in the constru .. tab-item:: Python :sync: Python - .. rli:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/ArmSimulation/subsytems/arm.py + .. rli:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/ArmSimulation/subsytems/arm.py :language: python :lines: 43-50 @@ -102,10 +102,10 @@ Depending on the data that is stored in preferences, you can use it when you rea .. tab-item:: Python :sync: Python - .. rli:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/ArmSimulation/robot.py + .. rli:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/ArmSimulation/robot.py :language: python :lines: 22-28 - .. rli:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/ArmSimulation/subsytems/arm.py + .. rli:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/ArmSimulation/subsytems/arm.py :language: python :lines: 52-57 diff --git a/source/docs/software/can-devices/power-distribution-module.rst b/source/docs/software/can-devices/power-distribution-module.rst index d4e5b07fe8..54e055fbbd 100644 --- a/source/docs/software/can-devices/power-distribution-module.rst +++ b/source/docs/software/can-devices/power-distribution-module.rst @@ -42,7 +42,7 @@ Note: it is not necessary to create a PowerDistribution object unless you need t :language: c++ :lines: 28-31 - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/CANPDP/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/CANPDP/robot.py :language: python :lines: 34-37 @@ -61,7 +61,7 @@ Monitoring the bus voltage can be useful for (among other things) detecting when :language: c++ :lines: 33-35 - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/CANPDP/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/CANPDP/robot.py :language: python :lines: 39-41 @@ -80,7 +80,7 @@ Monitoring the temperature can be useful for detecting if the robot has been dra :language: c++ :lines: 37-49 - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/CANPDP/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/CANPDP/robot.py :language: python :lines: 43-55 @@ -101,7 +101,7 @@ The PDP/PDH also allows users to monitor the current drawn by the individual dev :language: c++ :lines: 22-26 - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/CANPDP/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/CANPDP/robot.py :language: python :lines: 28-32 diff --git a/source/docs/software/vision-processing/roborio/using-the-cameraserver-on-the-roborio.rst b/source/docs/software/vision-processing/roborio/using-the-cameraserver-on-the-roborio.rst index 71d8d827e5..0b184e9794 100644 --- a/source/docs/software/vision-processing/roborio/using-the-cameraserver-on-the-roborio.rst +++ b/source/docs/software/vision-processing/roborio/using-the-cameraserver-on-the-roborio.rst @@ -18,7 +18,7 @@ The following program starts automatic capture of a USB camera like the Microsof :language: c++ :lines: 7-8, 16-18, 20, 25-31 - .. rli:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/QuickVision/robot.py + .. rli:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/QuickVision/robot.py :language: python :lines: 8-17 :linenos: @@ -69,14 +69,14 @@ In the following example a thread created in ``Robot`` constructor gets the Came Here's what your ``robot.py`` needs to contain to launch the image processing process: - .. rli:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/IntermediateVision/robot.py + .. rli:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/IntermediateVision/robot.py :language: python :lines: 8-17 :linenos: The ``launch("vision.py")`` function says to launch ``vision.py`` and call the ``run`` function in that file. Here's what is in ``vision.py``: - .. rli:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/IntermediateVision/vision.py + .. rli:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/IntermediateVision/vision.py :language: python :lines: 12-55 :linenos: 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 cbfe81b168..dc4fc5e0f6 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 @@ -148,7 +148,7 @@ Now let's look at various parts of the code. .. tab-item:: Python - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/GettingStarted/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/GettingStarted/robot.py :language: python :lines: 8-9 :lineno-match: @@ -496,7 +496,7 @@ The ``Robot`` constructor for our sample program inverts the right side of the d :lines: 25-36 :lineno-match: - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/GettingStarted/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/GettingStarted/robot.py :language: python :lines: 31-43 :lineno-match: @@ -519,7 +519,7 @@ The ``AutonomousInit`` method is run once each time the robot transitions to aut :lines: 38-45 :lineno-match: - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/GettingStarted/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/GettingStarted/robot.py :language: python :lines: 45-52 :lineno-match: @@ -540,7 +540,7 @@ Like in Autonomous, the Teleop mode has a ``TeleopInit`` and ``TeleopPeriodic`` :lines: 45-48 :lineno-match: - .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/d89b0587a1e1111239728140466c7dc4324d4005/GettingStarted/robot.py + .. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/36c64f286a38478f5e04d60321c57b0a9d1c5f17/GettingStarted/robot.py :language: python :lines: 54-58 :lineno-match: