Skip to content

Commit

Permalink
Update Python Example RLIs (#2901)
Browse files Browse the repository at this point in the history
* Update Python Example RLIs

* Autofix RLIs

---------

Co-authored-by: github-actions <[email protected]>
  • Loading branch information
sciencewhiz and github-actions authored Jan 3, 2025
1 parent 8640b32 commit 78c4e88
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/inspector.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/",
Expand Down
2 changes: 1 addition & 1 deletion source/docs/contributing/frc-docs/style-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions source/docs/software/basic-programming/robot-preferences.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 78c4e88

Please sign in to comment.