Skip to content

Commit 17fd4f5

Browse files
sciencewhizgithub-actions
andauthored
Update python RLIs to 2027.0.0a4 (#3278)
Update regex for mostrobotpy tags --------- Co-authored-by: github-actions <github-actions@github.com>
1 parent 59bcf24 commit 17fd4f5

File tree

14 files changed

+74
-74
lines changed

14 files changed

+74
-74
lines changed

.github/workflows/inspector.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
},
1313
{
1414
"baseUrl": "https://raw.githubusercontent.com/robotpy/mostrobotpy/",
15-
"versionScheme": "\\d{4}\\.\\d\\.\\d\\.\\d(?:-(?:alpha|beta)-\\d)?|[0-9a-f]{40}",
16-
"latestVersion": "d88ac48cd5f1d0f11ec03c493301dc2048bb314a"
15+
"versionScheme": "\\d{4}\\.\\d\\.\\d(?:(?:a|b)\\d)?|[0-9a-f]{40}",
16+
"latestVersion": "2027.0.0a4"
1717
},
1818
{
1919
"baseUrl": "https://raw.githubusercontent.com/wpilibsuite/vscode-wpilib/",

source/docs/contributing/frc-docs/style-guide.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ When possible, instead of using code blocks, an RLI should be used. This pulls
112112
:lines: 50-60
113113
:lineno-match:
114114
115-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/GettingStarted/robot.py
115+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/GettingStarted/robot.py
116116
:language: python
117-
:lines: 12-29
117+
:lines: 10-27
118118
:lineno-match:
119119
```
120120

source/docs/software/advanced-controls/controllers/profiled-pidcontroller.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ A more complete example of ``ProfiledPIDController`` usage is provided in the El
126126
:lines: 5-
127127
:lineno-match:
128128

129-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/ElevatorProfiledPID/robot.py
129+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/ElevatorProfiledPID/robot.py
130130
:language: python
131131
:lines: 8-
132132
:lineno-match:

source/docs/software/advanced-controls/controllers/trapezoidal-profiles.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ A more complete example of ``TrapezoidProfile`` usage is provided in the Elevato
172172
:lines: 5-
173173
:lineno-match:
174174

175-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/ElevatorTrapezoidProfile/robot.py
175+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/ElevatorTrapezoidProfile/robot.py
176176
:language: python
177177
:lines: 8-
178178
:lineno-match:

source/docs/software/advanced-controls/state-space/state-space-flywheel-walkthrough.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ The ``LinearSystem`` class contains methods for easily creating state-space syst
8686

8787
.. tab-item:: Python
8888

89-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/StateSpaceFlywheelSysId/robot.py
89+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/StateSpaceFlywheelSysId/robot.py
9090
:language: python
91-
:lines: 23-27
91+
:lines: 19-23
9292
:lineno-match:
9393

94-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/StateSpaceFlywheelSysId/robot.py
94+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/StateSpaceFlywheelSysId/robot.py
9595
:language: python
96-
:lines: 37-48
96+
:lines: 35-50
9797
:lineno-match:
9898

9999

@@ -133,14 +133,14 @@ The ``LinearSystem`` class contains methods to easily create a model of a flywhe
133133
.. tab-item:: Python
134134
:sync: python
135135

136-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/StateSpaceFlywheel/robot.py
136+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/StateSpaceFlywheel/robot.py
137137
:language: python
138-
:lines: 22-26
138+
:lines: 19-23
139139
:lineno-match:
140140

141-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/StateSpaceFlywheel/robot.py
141+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/StateSpaceFlywheel/robot.py
142142
:language: python
143-
:lines: 38-47
143+
:lines: 37-46
144144
:lineno-match:
145145

146146
## Kalman Filters: Observing Flywheel State
@@ -182,9 +182,9 @@ Because the feedback controller computes error using the :term:`x-hat` estimated
182182
.. tab-item:: Python
183183
:sync: python
184184

185-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/StateSpaceFlywheel/robot.py
185+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/StateSpaceFlywheel/robot.py
186186
:language: python
187-
:lines: 49-55
187+
:lines: 48-54
188188
:lineno-match:
189189

190190
Because Kalman filters use our state-space model in the :ref:`docs/software/advanced-controls/state-space/state-space-observers:Predict step`, it is important that our model is as accurate as possible. One way to verify this is to record a flywheel's input voltage and velocity over time, and replay this data by calling only ``predict`` on the Kalman filter. Then, the kV and kA gains (or moment of inertia and other constants) can be adjusted until the model closely matches the recorded data.
@@ -223,9 +223,9 @@ Much like ``SimpleMotorFeedforward`` can be used to generate feedforward voltage
223223
.. tab-item:: Python
224224
:sync: python
225225

226-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/StateSpaceFlywheel/robot.py
226+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/StateSpaceFlywheel/robot.py
227227
:language: python
228-
:lines: 57-67
228+
:lines: 56-69
229229
:lineno-match:
230230

231231
## Bringing it All Together: LinearSystemLoop
@@ -258,9 +258,9 @@ LinearSystemLoop combines our system, controller, and observer that we created e
258258
.. tab-item:: Python
259259
:sync: python
260260

261-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/StateSpaceFlywheel/robot.py
261+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/StateSpaceFlywheel/robot.py
262262
:language: python
263-
:lines: 69-72
263+
:lines: 71-74
264264
:lineno-match:
265265

266266
Once we have our ``LinearSystemLoop``, the only thing left to do is actually run it. To do that, we'll periodically update our Kalman filter with our new encoder velocity measurements and apply new voltage commands to it. To do that, we first set the :term:`reference`, then ``correct`` with the current flywheel speed, ``predict`` the Kalman filter into the next timestep, and apply the inputs generated using ``getU``.
@@ -291,9 +291,9 @@ Once we have our ``LinearSystemLoop``, the only thing left to do is actually run
291291
.. tab-item:: Python
292292
:sync: python
293293

294-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/StateSpaceFlywheel/robot.py
294+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/StateSpaceFlywheel/robot.py
295295
:language: python
296-
:lines: 88-110
296+
:lines: 90-113
297297
:lineno-match:
298298

299299
## Angle Wrap with LQR

source/docs/software/advanced-controls/state-space/state-space-observers.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ WPILib's Kalman Filter classes' constructors take a linear system, a vector of p
110110

111111
.. tab-item:: Python
112112

113-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/StateSpaceFlywheel/robot.py
113+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/StateSpaceFlywheel/robot.py
114114
:language: python
115-
:lines: 49-55
115+
:lines: 48-54
116116
:lineno-match:
117117

118118
## Footnotes

source/docs/software/basic-programming/robot-preferences.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ This example shows how to utilize Preferences to change the setpoint of a PID co
3434
.. tab-item:: Python
3535
:sync: Python
3636

37-
.. rli:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/ArmSimulation/constants.py
37+
.. rli:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/ArmSimulation/constants.py
3838
:language: python
3939
:lines: 18-23
4040

41-
.. rli:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/ArmSimulation/subsytems/arm.py
41+
.. rli:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/ArmSimulation/subsystems/arm.py
4242
:language: python
43-
:lines: 20-23,37-41
43+
:lines: 18-20,69-73
4444

4545
Preferences are stored using a name, the key. It's helpful to store the key in a constant, like ``kArmPositionKey`` and ``kArmPKey`` in the code above to avoid typing it multiple times and avoid typos. We also declare variables, ``kArmKp`` and ``armPositionDeg`` to hold the data retrieved from preferences.
4646

@@ -69,9 +69,9 @@ If using the Command Framework, this type of code could be placed in the constru
6969
.. tab-item:: Python
7070
:sync: Python
7171

72-
.. rli:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/ArmSimulation/subsytems/arm.py
72+
.. rli:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/ArmSimulation/subsystems/arm.py
7373
:language: python
74-
:lines: 43-50
74+
:lines: 97-104
7575

7676
Reading a preference is easy. The ``getDouble`` method takes two parameters, the key to read, and a default value to use in case the preference doesn't exist. There are similar methods for other data types like booleans, ints, and strings.
7777

@@ -102,12 +102,12 @@ Depending on the data that is stored in preferences, you can use it when you rea
102102
.. tab-item:: Python
103103
:sync: Python
104104

105-
.. rli:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/ArmSimulation/robot.py
105+
.. rli:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/ArmSimulation/robot.py
106106
:language: python
107-
:lines: 22-28
108-
.. rli:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/ArmSimulation/subsytems/arm.py
107+
:lines: 28-34
108+
.. rli:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/ArmSimulation/subsystems/arm.py
109109
:language: python
110-
:lines: 52-57
110+
:lines: 106-111
111111

112112
## Using Preferences in SmartDashboard
113113

source/docs/software/can-devices/power-distribution-module.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ Note: it is not necessary to create a PowerDistribution object unless you need t
4242
:language: c++
4343
:lines: 28-31
4444

45-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/CANPDP/robot.py
45+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/CANPDP/robot.py
4646
:language: python
47-
:lines: 34-37
47+
:lines: 35-38
4848

4949

5050
Monitoring the bus voltage can be useful for (among other things) detecting when the robot is near a brownout, so that action can be taken to avoid brownout in a controlled manner. See the :doc:`roboRIO Brownouts document</docs/software/systemcore-info/roborio-brownouts>` for more information.
@@ -61,9 +61,9 @@ Monitoring the bus voltage can be useful for (among other things) detecting when
6161
:language: c++
6262
:lines: 33-35
6363

64-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/CANPDP/robot.py
64+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/CANPDP/robot.py
6565
:language: python
66-
:lines: 39-41
66+
:lines: 40-42
6767

6868

6969
Monitoring the temperature can be useful for detecting if the robot has been drawing too much power and needs to be shut down for a while, or if there is a short or other wiring problem.
@@ -80,9 +80,9 @@ Monitoring the temperature can be useful for detecting if the robot has been dra
8080
:language: c++
8181
:lines: 37-49
8282

83-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/CANPDP/robot.py
83+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/CANPDP/robot.py
8484
:language: python
85-
:lines: 43-55
85+
:lines: 44-56
8686

8787

8888
Monitoring the total current, power, and energy can be useful for controlling how much power is being drawn from the battery, both for preventing brownouts and ensuring that mechanisms have sufficient power available to perform the actions required. Power is the bus voltage multiplied by the current with the units Watts. Energy is the power summed over time with units Joules.
@@ -101,9 +101,9 @@ The PDP/PDH also allows users to monitor the current drawn by the individual dev
101101
:language: c++
102102
:lines: 22-26
103103

104-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot/CANPDP/robot.py
104+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot/CANPDP/robot.py
105105
:language: python
106-
:lines: 28-32
106+
:lines: 29-33
107107

108108

109109
Monitoring individual device current draws can be useful for detecting shorts or stalled motors.

source/docs/software/commandbased/commands-v2/command-compositions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ Command compositions can also be written as a constructor-only subclass of the m
322322
.. tab-item:: Python
323323
:sync: Python
324324

325-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot//HatchbotTraditional/commands/complexauto.py
325+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot//HatchbotTraditional/commands/complexauto.py
326326
:language: python
327327
:lines: 7-
328328
:lineno-match:

source/docs/software/commandbased/commands-v2/commands.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ The ``runOnce`` factory, backed by the ``InstantCommand`` ([Java](https://github
135135
.. tab-item:: Python
136136
:sync: tabcode-python
137137

138-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot//HatchbotInlined/subsystems/hatchsubsystem.py
138+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot//HatchbotInlined/subsystems/hatchsubsystem.py
139139
:language: python
140-
:lines: 24-34
140+
:lines: 23-33
141141
:lineno-match:
142142

143143
The ``run`` factory, backed by the ``RunCommand`` ([Java](https://github.wpilib.org/allwpilib/docs/2027/java/org/wpilib/command2/RunCommand.html), [C++](https://github.wpilib.org/allwpilib/docs/2027/cpp/classwpi_1_1cmd_1_1_run_command.html), :external:py:class:`Python <commands2.RunCommand>`) class, creates a command that calls a lambda repeatedly, until interrupted.
@@ -361,7 +361,7 @@ What might a functional command look like in practice? As before, below is a sim
361361
.. tab-item:: Python
362362
:sync: tabcode-python
363363

364-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot//HatchbotTraditional/commands/grabhatch.py
364+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot//HatchbotTraditional/commands/grabhatch.py
365365
:language: python
366366
:lines: 7-
367367
:lineno-match:
@@ -401,7 +401,7 @@ What about a more complicated case? Below is a drive command, from the same exam
401401
.. tab-item:: Python
402402
:sync: tabcode-python
403403

404-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot//HatchbotTraditional/commands/defaultdrive.py
404+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot//HatchbotTraditional/commands/defaultdrive.py
405405
:language: python
406406
:lines: 7-
407407
:lineno-match:
@@ -420,9 +420,9 @@ And then usage:
420420
:lines: 30-33
421421
:lineno-match:
422422

423-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot//HatchbotTraditional/robotcontainer.py
423+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot//HatchbotTraditional/robotcontainer.py
424424
:language: python
425-
:lines: 65-72
425+
:lines: 64-71
426426
:lineno-match:
427427

428428
Notice that this command does not override ``isFinished()``, and thus will never end; this is the norm for commands that are intended to be used as default commands. Once more, this command is rather simple and calls the subsystem method only from one place, and as such, could be more concisely written using factories:
@@ -439,7 +439,7 @@ Notice that this command does not override ``isFinished()``, and thus will never
439439
:lines: 26-32
440440
:lineno-match:
441441

442-
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/d88ac48cd5f1d0f11ec03c493301dc2048bb314a/examples/robot//HatchbotInlined/robotcontainer.py
442+
.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/mostrobotpy/2027.0.0a4/examples/robot//HatchbotInlined/robotcontainer.py
443443
:language: python
444-
:lines: 53-65
444+
:lines: 52-64
445445
:lineno-match:

0 commit comments

Comments
 (0)