Skip to content

Commit b0da04b

Browse files
committed
Initial 2024 updates
1 parent 6019b0d commit b0da04b

35 files changed

+118
-1276
lines changed

conf.py

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,9 @@
7070
copyright = f"2014-{date.today().year}, RobotPy development team"
7171

7272

73+
frc_docs = "https://docs.wpilib.org/en/stable"
74+
7375
intersphinx_mapping = {
74-
"commandsv1": (
75-
"https://robotpy.readthedocs.io/projects/commands-v1/en/%s/" % rtd_version,
76-
None,
77-
),
7876
"commandsv2": (
7977
"https://robotpy.readthedocs.io/projects/commands-v2/en/%s/" % rtd_version,
8078
None,
@@ -83,40 +81,47 @@
8381
"https://robotpy.readthedocs.io/projects/pyfrc/en/%s/" % rtd_version,
8482
None,
8583
),
86-
"ntcore": (
87-
"https://robotpy.readthedocs.io/projects/pyntcore/en/%s/" % rtd_version,
88-
None,
89-
),
90-
"wpilib": (
91-
"https://robotpy.readthedocs.io/projects/wpilib/en/%s/" % rtd_version,
92-
None,
93-
),
94-
"hal": (
95-
"https://robotpy.readthedocs.io/projects/hal/en/%s/" % rtd_version,
84+
"robotpy": (
85+
"https://robotpy.readthedocs.io/projects/robotpy/en/%s/" % rtd_version,
9686
None,
9787
),
9888
"robotpy_ext": (
9989
"https://robotpy.readthedocs.io/projects/utilities/en/%s/" % rtd_version,
10090
None,
10191
),
102-
"cscore": (
103-
"https://robotpy.readthedocs.io/projects/cscore/en/%s/" % rtd_version,
104-
None,
105-
),
106-
"frc": ("https://docs.wpilib.org/en/stable", None),
92+
"frc": (frc_docs, None),
10793
}
10894

10995
redirects = {
11096
"2020_notes": "upgrade_notes.html",
111-
"install/pynetworktables": "pyntcore.html"
97+
"install/pynetworktables": "pyntcore.html",
98+
"frameworks/command": f"{frc_docs}/docs/software/commandbased/index",
99+
"guide/examples": "https://github.com/robotpy/examples",
100+
"guide/nt": f"{frc_docs}/docs/software/networktables/index.html",
101+
"hw": f"{frc_docs}/docs/hardware/hardware-basics/index.html",
102+
"install/commands": "install/components",
103+
"install/cscore": "install/components",
104+
"install/ctre": "install/components",
105+
"install/navx": "install/components",
106+
"install/pathplannerlib": "install/components",
107+
"install/pwfusion": "install/components",
108+
"install/pyfrc": "install/components",
109+
"install/pyntcore": "install/components",
110+
"install/rev": "install/components",
111+
"vision/code": f"{frc_docs}/docs/software/vision-processing/index.html",
112+
"vision/index": f"{frc_docs}/docs/software/vision-processing/index.html",
113+
"vision/other": f"{frc_docs}/docs/software/vision-processing/index.html",
114+
"vision/roborio": f"{frc_docs}/docs/software/vision-processing/roborio/index.html",
112115
}
113116

114117
# The version info for the project you're documenting, acts as replacement for
115118
# |version| and |release|, also used in various other places throughout the
116119
# built documents.
117120
#
118121
# The short X.Y version.
119-
version = subprocess.check_output(("git", "describe", "--tags"), text=True).split(".")[0]
122+
version = subprocess.check_output(("git", "describe", "--tags"), text=True).split(".")[
123+
0
124+
]
120125
# The full version, including alpha/beta/rc tags.
121126
release = version
122127

@@ -133,15 +138,7 @@
133138

134139
# The theme to use for HTML and HTML Help pages. See the documentation for
135140
# a list of builtin themes.
136-
html_theme = "default"
137-
138-
if not on_rtd: # only import and set the theme if we're building docs locally
139-
import sphinx_rtd_theme
140-
141-
html_theme = "sphinx_rtd_theme"
142-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
143-
else:
144-
html_theme = "default"
141+
html_theme = "sphinx_rtd_theme"
145142

146143
# Output file base name for HTML help builder.
147144
htmlhelp_basename = "RobotPy"

dev/deploy.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pretty simple too.
8686

8787
::
8888

89-
python3 robot.py run
89+
python3 -m robotpy run
9090

9191
Your driver station should be able to connect to your code, and it will be able
9292
to operate your robot!

faq.rst

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ documentation <https://docs.python.org/3/>`__ instead of the Python
3838
2.x documentation.
3939

4040
- RobotPy WPILib on the roboRIO uses the latest version of Python 3 at kickoff.
41-
In 2023, this was Python 3.11. When using pyfrc or similar projects,
42-
you should use a Python 3.7 or newer interpreter (the latest is recommended).
41+
In 2024, this was Python 3.12. When using pyfrc or similar projects,
42+
you should use a Python 3.8 or newer interpreter (the latest is recommended).
4343
- RobotPy 2014.x is based on Python 3.2.5.
4444

4545
`pynetworktables <https://github.com/robotpy/pynetworktables>`__ is
@@ -71,15 +71,17 @@ Prior to 2015, the API matched the C++ version of WPILib.
7171
Is Command-based programming available?
7272
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7373

74-
Of course! Check out the :mod:`commands2 <commands2>` package. There
75-
is also some :ref:`python-specific documentation available <command_framework_docs>`.
74+
Of course! Check out the :mod:`commands2 <commands2>` package.
7675

77-
Is there an easy way to test my code outside of the robot?
78-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
76+
Are Vendor libraries available?
77+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7978

80-
Glad you asked! Our pyfrc project has a built in :ref:`lightweight robot simulator <simulator>`
81-
you can use to run your code, and also has builtin support for unit testing
82-
with `py.test <http://pytest.org>`_.
79+
We encourage vendors to make Python versions of their libraries available. Since
80+
Python support has only been official since 2024, not all vendors do this. If
81+
you are a vendor, please reach out to our team and we'd be happy to assist.
82+
83+
The RobotPy project also provides unofficial wrappers for vendor libraries that don't
84+
take a lot of effort to create and maintain.
8385

8486
Competition
8587
-----------
@@ -89,38 +91,14 @@ Competition
8991
Is RobotPy competition-legal?
9092
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9193

92-
Python is not an official FRC language yet, but we are working with
93-
the WPILib team to make it official in 2024. See
94-
https://wpilib.org/blog/bringing-python-to-frc for the announcement.
95-
96-
As RobotPy was not written by anyone involved with the GDC, we can't
97-
provide a guaranteed answer (particularly not for future years).
98-
However, we see no reason that RobotPy would not be legal: to the
99-
cRIO/RoboRIO, it looks just like any other C++ WPILib-using program that
100-
reads text files. RobotPy itself should be considered COTS software as
101-
it is freely available to all teams. Teams have been using RobotPy since
102-
2010 without any problems from FIRST, and we expect that to continue.
103-
104-
Caveat emptor: while RobotPy is almost certainly legal to use, your team
105-
should carefully consider the risk of using such a large piece of
106-
unofficial software; unless RobotPy is used by many teams, if you run
107-
into trouble at a competition, there may not be anyone else there to
108-
help! However, we've found that most problems teams run into are
109-
problems with WPILib itself, and not RobotPy.
110-
111-
Also, be sure to keep in mind the fact that Python is a dynamic language
112-
and is NOT compiled. This means that typos can easily go undetected
113-
until your robot runs that particular line of code, resulting in an
114-
exception and 5 second restart. Make sure to test your code thoroughly
115-
(see our :ref:`unit testing documentation <unit_tests>`).
116-
94+
As of 2024, Python is officially supported for use in FRC.
11795

11896
.. _is_stable:
11997

12098
Is RobotPy stable?
12199
~~~~~~~~~~~~~~~~~~
122100

123-
Yes! While Python is not an officially supported language, teams have been
101+
Yes! Teams have been
124102
using RobotPy since 2010, and the maintainer of RobotPy is a member of the
125103
WPILib team. Much of the time when bugs are found, they are found in the
126104
underlying WPILib, instead of RobotPy itself.

frameworks/command.rst

Lines changed: 0 additions & 16 deletions
This file was deleted.

frameworks/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ While frameworks sometimes have a learning curve associated with them, once you
1212
learn how they work you will find that they can save you a lot of effort and
1313
prevent you from making certain kinds of mistakes.
1414

15-
* :ref:`command_framework_docs`: this framework comes with WPILib
15+
* :doc:`Command Framework <frc:docs/software/commandbased/index>`: this framework comes with WPILib
1616
* :ref:`magicbot_framework_docs`: Created as a pythonic alternative to the Command framework
1717

1818
.. toctree::
1919
:maxdepth: 2
20+
:hidden:
2021

21-
command
2222
magicbot

frameworks/magicbot.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,6 @@ The simplest method to communicate with other programs external to your robot
300300
code (examples include dashboards and image processing code) is using
301301
NetworkTables. NetworkTables is a distributed keystore, or put more simply,
302302
it is similar to a python dictionary that is shared across multiple processes.
303-
304-
.. note:: For more information about NetworkTables, see :ref:`networktables_guide`
305303

306304
Magicbot provides a simple way to interact with NetworkTables, using the
307305
:func:`tunable <robotpy_ext:magicbot.magic_tunable.tunable>` property.

getting_started.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,3 @@ the following steps:
1919

2020
Once you've played around with some code in simulation, then you should
2121
:ref:`install RobotPy on your robot <install_robotpy>`.
22-
23-
If you're looking to use NetworkTables on the driver station or on a
24-
coprocessor, then check out the :ref:`pyntcore install docs <install_pyntcore>`.
25-

guide/anatomy.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Adding motors and sensors
7777

7878
Everything that interacts with the robot hardware directly must use the wpilib
7979
library to do so. Starting in 2015, full documentation for the python version
80-
of WPILib is published online. Check out the API documentation (:external+wpilib:doc:`wpilib`)
80+
of WPILib is published online. Check out the API documentation (:external+robotpy:doc:`wpilib`)
8181
for details on all the objects available in WPILib.
8282

8383
.. note::
@@ -90,7 +90,7 @@ Creating individual devices
9090
~~~~~~~~~~~~~~~~~~~~~~~~~~~
9191

9292
Let's say you wanted to create an object that interacted with a Jaguar motor
93-
controller via PWM. First, you would read through the table (:external+wpilib:doc:`wpilib`) and
93+
controller via PWM. First, you would read through the table (:external+robotpy:doc:`wpilib`) and
9494
see that there is a :class:`.Jaguar` object. Looking further, you can see that
9595
the constructor takes a single argument that indicates which PWM port to
9696
connect to. You could create the `Jaguar` object that is using port 4 using the
@@ -142,7 +142,7 @@ Once you have one of these objects, it has various methods that you can use
142142
to control the robot via joystick, or you can specify the control inputs
143143
manually.
144144

145-
.. seealso:: Documentation for the :external+wpilib:doc:`wpilib.drive`, and the FIRST WPILib Programming Guide.
145+
.. seealso:: Documentation for the :external+robotpy:doc:`wpilib.drive`, and the FIRST WPILib Programming Guide.
146146

147147
Robot Operating Modes (TimedRobot)
148148
--------------------------------------

guide/deploy.rst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,20 @@ code, and if they pass then it will upload the robot code to the roboRIO.
1212
Running the tests is really important, it allows you to catch errors in your
1313
code before you run it on the robot.
1414

15-
1. Make sure you have RobotPy installed on the robot (:ref:`RobotPy install guide <install_robotpy>`)
16-
2. Make sure you have pyfrc installed (:ref:`pyfrc install guide <install_pyfrc>`)
17-
3. Once that is done, you can just run the following command and it will upload the code and start it immediately.
15+
1. Make sure you have RobotPy installed on the robot (:ref:`RobotPy install guide <install_robotpy>`) and on your computer
16+
2. Once that is done, you can just run the following command and it will upload the code and start it immediately.
1817

1918
.. tab:: Windows
2019

2120
.. code-block:: sh
2221
23-
py -3 robot.py deploy
22+
py -3 -m robotpy deploy
2423
2524
.. tab:: Linux/macOS
2625

2726
.. code-block:: sh
2827
29-
python3 robot.py deploy
28+
python3 -m robotpy deploy
3029
3130
You can watch your robot code's output (and see any problems) by using the
3231
netconsole program (you can either use NI's tool, or `pynetconsole <https://github.com/robotpy/pynetconsole>`_.
@@ -49,13 +48,13 @@ your program's console output, by launching a netconsole listener.
4948

5049
.. code-block:: sh
5150
52-
py -3 robot.py deploy --nc
51+
py -3 -m robotpy deploy --nc
5352
5453
.. tab:: Linux/macOS
5554

5655
.. code-block:: sh
5756
58-
python3 robot.py deploy --nc
57+
python3 -m robotpy deploy --nc
5958
6059
.. note:: This requires the driver station software to be connected to your robot
6160

@@ -69,13 +68,13 @@ don't care about the tests. That's OK, you can still upload code to the robot:
6968

7069
.. code-block:: sh
7170
72-
py -3 robot.py deploy --skip-tests
71+
py -3 -m robotpy deploy --skip-tests
7372
7473
.. tab:: Linux/macOS
7574

7675
.. code-block:: sh
7776
78-
python3 robot.py deploy --skip-tests
77+
python3 -m robotpy deploy --skip-tests
7978
8079
Starting deployed code at boot
8180
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

guide/examples.rst

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)