Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/docs/software/python/pyproject_toml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The ``pyproject.toml`` file looks something like this:
robotpy_version = "2024.2.1.0"
# Which extra RobotPy components should be installed
# -> equivalent to `pip install robotpy[extra1, ...]
robotpy_extras = [
components = [
# "all"
# "apriltag"
# "commands2"
Expand All @@ -40,7 +40,7 @@ Each of the following will instruct the deploy process to install packages to th

``robotpy_version`` is the version of the ``robotpy`` PyPI package that this robot code depends on.

``robotpy_extras`` defines extra RobotPy components that can be installed, as only the core RobotPy libraries are installed by default.
``components`` defines extra RobotPy components that can be installed, as only the core RobotPy libraries are installed by default.

``requires`` is a list of strings, and each item is equivalent to a line of a [requirements.txt](https://pip.pypa.io/en/stable/reference/requirements-file-format/) file. You can install any pure python packages on the roboRIO and they will likely work, but any packages that have binary dependencies must be cross-compiled for the roboRIO. For example, if you needed to use ``numpy`` in your robot code:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ If you're interested in just switching what the driver sees, and are using Smart
```toml
[tool.robotpy]
...
# Add cscore to the robotpy-extras list
robotpy_extras = ["cscore"]
# Add cscore to the components list
components = ["cscore"]
```

If you're using some other dashboard, you can change the camera used by the camera server dynamically. If you open a stream viewer nominally to camera1, the robot code will change the stream contents to either camera1 or camera2 based on the joystick trigger.
Expand Down Expand Up @@ -259,8 +259,8 @@ By default, the cscore library is pretty aggressive in turning off cameras not i
```toml
[tool.robotpy]
...
# Add cscore to the robotpy-extras list
robotpy_extras = ["cscore"]
# Add cscore to the components list
components = ["cscore"]
```

.. note::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ In the following example a thread created in ``Robot`` constructor gets the Came
:lines: 12-55
:linenos:

You need to update ``pyproject.toml`` contents to include cscore in the robotpy-extras key (this only shows the portions you need to update):
You need to update ``pyproject.toml`` contents to include cscore in the components key (this only shows the portions you need to update):

```toml
[tool.robotpy]
...
# Add cscore to the robotpy-extras list
robotpy_extras = ["cscore"]
# Add cscore to the components list
components = ["cscore"]
```

Notice that in these examples, the ``PutVideo()`` method writes the video to a named stream. To view that stream on SmartDashboard or Shuffleboard, select that named stream. In this case that is "Rectangle".
70 changes: 35 additions & 35 deletions source/docs/software/vscode-overview/3rd-party-libraries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,50 +44,50 @@ Vendor dependencies are installed on a per-project basis (so each robot project

All RobotPy project dependencies are specified in ``pyproject.toml``. You can add additional vendor-specific dependencies either by:

* Adding the component name to ``robotpy_extras``
* Adding the component name to ``components``
* Adding the PyPI package name to ``requires``

.. seealso:: :doc:`/docs/software/python/pyproject_toml`

Optional WPILib components:

+----------+----------------+---------------------+
| | robotpy_extras | requires |
+==========+================+=====================+
| Apriltag | apriltag | robotpy-apriltag |
+----------+----------------+---------------------+
| Commands | commands2 | robotpy-commands-v2 |
+----------+----------------+---------------------+
| cscore | cscore | robotpy-cscore |
+----------+----------------+---------------------+
| Romi | romi | robotpy-romi |
+----------+----------------+---------------------+
| XRP | xrp | robotpy-xrp |
+----------+----------------+---------------------+
+----------+------------+---------------------+
| | components | requires |
+==========+============+=====================+
| Apriltag | apriltag | robotpy-apriltag |
+----------+------------+---------------------+
| Commands | commands2 | robotpy-commands-v2 |
+----------+------------+---------------------+
| cscore | cscore | robotpy-cscore |
+----------+------------+---------------------+
| Romi | romi | robotpy-romi |
+----------+------------+---------------------+
| XRP | xrp | robotpy-xrp |
+----------+------------+---------------------+

Optional vendor-specific components (not all are available at the beginning of the season):

+---------------------+-----------+-------------------+---------------------------+
| | Origin | robotpy_extras | requires |
+=====================+===========+===================+===========================+
| ChoreoLib | Vendor | | sleipnirgroup-choreolib |
+---------------------+-----------+-------------------+---------------------------+
| CTRE Phoenix 6 | Vendor | phoenix6 | phoenix6 |
+---------------------+-----------+-------------------+---------------------------+
| CTRE Phoenix 5 | Community | phoenix5 | robotpy-ctre |
+---------------------+-----------+-------------------+---------------------------+
| PathPlannerLib | Vendor | pathplannerlib | robotpy-pathplannerlib |
+---------------------+-----------+-------------------+---------------------------+
| PhotonVision | Vendor | photonvision | photonlibpy |
+---------------------+-----------+-------------------+---------------------------+
+---------------------+-----------+-------------+---------------------------+
| | Origin | components | requires |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can no longer install vendor deps via components.

+=====================+===========+=============+===========================+
| ChoreoLib | Vendor | | sleipnirgroup-choreolib |
+---------------------+-----------+-------------+---------------------------+
| CTRE Phoenix 6 | Vendor | phoenix6 | phoenix6 |
+---------------------+-----------+-------------+---------------------------+
| CTRE Phoenix 5 | Community | phoenix5 | robotpy-ctre |
+---------------------+-----------+-------------+---------------------------+
| PathPlannerLib | Vendor | pathplannerlib | robotpy-pathplannerlib |
+---------------------+-----------+-------------+---------------------------+
| PhotonVision | Vendor | photonvision | photonlibpy |
+---------------------+-----------+-------------+---------------------------+
| Playing With Fusion | Community | playingwithfusion | robotpy-playingwithfusion |
+---------------------+-----------+-------------------+---------------------------+
| REVLib | Community | rev | robotpy-rev |
+---------------------+-----------+-------------------+---------------------------+
| Studica | Community | navx | robotpy-navx |
+---------------------+-----------+-------------------+---------------------------+
| URCL | Community | | robotpy-urcl |
+---------------------+-----------+-------------------+---------------------------+
+---------------------+-----------+-------------+---------------------------+
| REVLib | Community | rev | robotpy-rev |
+---------------------+-----------+-------------+---------------------------+
| Studica | Community | navx | robotpy-navx |
+---------------------+-----------+-------------+---------------------------+
| URCL | Community | | robotpy-urcl |
+---------------------+-----------+-------------+---------------------------+

When using ``requires``, you can specify a version by appending ``==<version>`` to the package name, e.g. ``robotpy-commands-v2==2024.0.0``. If you do not specify a version, the latest version will be installed.

Expand Down Expand Up @@ -155,4 +155,4 @@ Vendor dependencies are installed on a per-project basis (so each robot project
.. tab-item:: Python
:sync: python

Third party libraries are packaged into Python wheels and uploaded to PyPI (if pure python) and/or WPILib's artifactory. Users can enable them as dependencies either by adding the component name to ``robotpy_extras`` (recommended) or by adding an explicit dependency for the PyPI package in ``requires``. The dependencies are downloaded when ``robotpy sync`` is executed, and installed on the roboRIO when ``robotpy deploy`` is executed.
Third party libraries are packaged into Python wheels and uploaded to PyPI (if pure python) and/or WPILib's artifactory. Users can enable them as dependencies either by adding the component name to ``components`` (recommended) or by adding an explicit dependency for the PyPI package in ``requires``. The dependencies are downloaded when ``robotpy sync`` is executed, and installed on the roboRIO when ``robotpy deploy`` is executed.
Loading