Skip to content

Commit

Permalink
Delete a lot, move a lot, update a lot
Browse files Browse the repository at this point in the history
  • Loading branch information
virtuald committed Jan 18, 2024
1 parent ae3638e commit eca17a1
Show file tree
Hide file tree
Showing 23 changed files with 85 additions and 1,777 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ become increasingly more difficult to introduce all of the pieces to new
users. This is the foundation for a unified documentation site for all
RobotPy projects, in hopes of reducing that confusion.

Now that Python is an officialy supported language, this site still aims to unify the various API documentation for RobotPy projects. However, much of our documentation has been moved to the [WPILib documentation](https://docs.wpilib.org).

All of our documentation is built using Sphinx, and is hosted at
http://robotpy.readthedocs.io/

Expand Down
35 changes: 24 additions & 11 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,34 @@
}

redirects = {
"getting_started": f"{frc_docs}/docs/zero-to-robot/introduction.html",
"2020_notes": "upgrade_notes.html",
"install/pynetworktables": "pyntcore.html",
"frameworks/command": f"{frc_docs}/docs/software/commandbased/index",
"frameworks/command": f"{frc_docs}/docs/software/commandbased/",
"guide/anatomy": f"{frc_docs}/docs/zero-to-robot/step-4/creating-test-drivetrain-program-cpp-java-python.html",
"guide/index": f"{frc_docs}/docs/software/python/",
"guide/deploy": f"{frc_docs}/docs/software/python/subcommands/deploy.html",
"guide/examples": "https://github.com/robotpy/examples",
"guide/guidelines": "guidelines",
"guide/nt": f"{frc_docs}/docs/software/networktables/index.html",
"guide/running": f"{frc_docs}/docs/software/python/subcommands/index.html",
"guide/python": "https://docs.python-guide.org/en/latest/intro/learning/",
"guide/simulator": f"{frc_docs}/docs/software/wpilib-tools/robot-simulation/introduction.html",
"guide/testing": "testing",
"hw": f"{frc_docs}/docs/hardware/hardware-basics/index.html",
"install/commands": "install/components",
"install/cscore": "install/components",
"install/ctre": "install/components",
"install/navx": "install/components",
"install/pathplannerlib": "install/components",
"install/pwfusion": "install/components",
"install/pyfrc": "install/components",
"install/pyntcore": "install/components",
"install/rev": "install/components",
"install/computer": f"{frc_docs}/docs/zero-to-robot/step-2/python-setup.html",
"install/components": f"{frc_docs}/docs/zero-to-robot/step-2/python-setup.html",
"install/packages": f"{frc_docs}/docs/zero-to-robot/step-2/python-setup.html",
"install/robot": f"{frc_docs}/docs/zero-to-robot/step-2/python-setup.html",
"install/commands": f"{frc_docs}/docs/software/vscode-overview/3rd-party-libraries.html",
"install/cscore": f"{frc_docs}/docs/zero-to-robot/step-2/python-setup.html",
"install/ctre": f"{frc_docs}/docs/software/vscode-overview/3rd-party-libraries.html",
"install/navx": f"{frc_docs}/docs/software/vscode-overview/3rd-party-libraries.html",
"install/pathplannerlib": f"{frc_docs}/docs/software/vscode-overview/3rd-party-libraries.html",
"install/pwfusion": f"{frc_docs}/docs/software/vscode-overview/3rd-party-libraries.html",
"install/pyfrc": f"{frc_docs}/docs/zero-to-robot/step-2/python-setup.html",
"install/pyntcore": f"{frc_docs}/docs/zero-to-robot/step-2/python-setup.html",
"install/rev": f"{frc_docs}/docs/software/vscode-overview/3rd-party-libraries.html",
"vision/code": f"{frc_docs}/docs/software/vision-processing/index.html",
"vision/index": f"{frc_docs}/docs/software/vision-processing/index.html",
"vision/other": f"{frc_docs}/docs/software/vision-processing/index.html",
Expand Down Expand Up @@ -184,7 +197,7 @@
epub_title = "RobotPy"
epub_author = "RobotPy development team"
epub_publisher = "RobotPy development team"
epub_copyright = "2014-2022, RobotPy development team"
epub_copyright = "2014-2024, RobotPy development team"

# A list of files that should not be packed into the epub file.
epub_exclude_files = ["search.html"]
Expand Down
37 changes: 19 additions & 18 deletions dev/deploy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,26 @@
Deploy process details
======================

When the code is uploaded to the robot, the following steps occur:
TODO

* SSH/sftp operations are performed as the ``lvuser`` user (this is REALLY important, don't use the ``admin`` user!)
* pyfrc does some checks to make sure the environment is setup properly
* The directory containing ``robot.py`` is recursively copied to the the directory ``/home/lvuser/py``
* The files ``robotCommand`` and ``robotDebugCommand`` are created
* ``/usr/local/frc/bin/frcKillRobot.sh -t -r`` is called, which causes any existing robot code to be killed, and the new code is launched
..
This is mostly the same, but has a lot of additional steps as of 2024
If you wish for the code to be started up when the roboRIO boots up, you need to
make sure that "Disable RT Startup App" is **not** checked in the roboRIO's web
configuration.
When the code is uploaded to the robot, the following steps occur:

These steps are compatible with what C++/Java does when deployed by GradleRIO,
so you should be able to seamlessly switch between python and other FRC
languages!
* SSH/sftp operations are performed as the ``lvuser`` user (this is REALLY important, don't use the ``admin`` user!)
* robotpy-installer does some checks to make sure the environment is setup properly
* The directory containing ``robot.py`` is recursively copied to the the directory ``/home/lvuser/py``
* The files ``robotCommand`` and ``robotDebugCommand`` are created
* ``/usr/local/frc/bin/frcKillRobot.sh -t -r`` is called, which causes any existing robot code to be killed, and the new code is launched

If you wish for the code to be started up when the roboRIO boots up, you need to
make sure that "Disable RT Startup App" is **not** checked in the roboRIO's web
configuration.

These steps are compatible with what C++/Java does when deployed by GradleRIO,
so you should be able to seamlessly switch between python and other FRC
languages!

.. _manual_code_deploy:

Expand Down Expand Up @@ -67,16 +72,12 @@ Example code:
print(data)
if __name__ == "__main__":
wpilib.run(MyRobot)
How to manually run code
------------------------

.. note:: Generally, you shouldn't need to use this process.

If you don't have (or don't want) to install pyfrc, running code manually is
If you don't have (or don't want) to install robotpy-installer, running code manually is
pretty simple too.

1. Make sure you have RobotPy installed on the robot
Expand All @@ -92,4 +93,4 @@ Your driver station should be able to connect to your code, and it will be able
to operate your robot!

.. note:: This is good for running experimental code, but it won't start the
code when the robot starts up. Use pyfrc to do that.
code when the robot starts up. Use robotpy-installer to do that.
51 changes: 3 additions & 48 deletions dev/design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,7 @@ Design

.. _robotpy_extension_options:

Adding options to robot.py
--------------------------
Adding options to the ``robotpy`` command
-----------------------------------------

When :func:`wpilib.run` is called, that function determines available commands
that can be run, and parses command line arguments to pass to the commands.
Examples of commands include:

* Running the robot code
* Running the robot code, connected to a simulator
* Running unit tests on the robot code
* And lots more!

python setuptools has a feature that allows you to extend the commands available
to robot.py without needing to modify WPILib's code. To add your own command,
do the following:

* Define a setuptools entrypoint in your package's setup.py (see below)
* The entrypoint name is the command to add
* The entrypoint must point at an object that has the following properties:
* Must have a docstring (shown when ``--help`` is given)
* Constructor must take a single argument (it is an argparse parser which options can be added to)
* Must have a 'run' function which takes two arguments: options, and robot_class. It must
also take arbitrary keyword arguments via the ``**kwargs`` mechanism. If it receives arguments
that it does not recognize, the entry point must ignore any such options.

If your command's run function is called, it is your command's responsibility
to execute the robot code (if that is desired). This sample command
demonstrates how to do this::

class SampleCommand:
'''Help text shown to user'''

def __init__(self, parser):
pass

def run(self, options, robot_class, **static_options):
# runs the robot code main loop
robot_class.main(robot_class)

To register your command as a robotpy extension, you must add the following
to your setup.py setup() invocation::

from setuptools import setup

setup(
...
entry_points={'robotpy': ['name_of_command = package.module:CommandClassName']},
...
)
As of 2024 the ``robotpy`` command (also accessed via ``python -m robotpy``) is located in the `robotpy-cli <https://github.com/robotpy/robotpy-cli>`__ package. Instructions for adding custom subcommands is located in the README file.
23 changes: 16 additions & 7 deletions faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Installing and Running RobotPy
How do I install RobotPy?
~~~~~~~~~~~~~~~~~~~~~~~~~

See our :ref:`getting started guide <getting_started>`.
RobotPy installation documentation is now at :doc:`frc-docs <frc:docs/zero-to-robot/step-2/python-setup>`.

What version of Python do RobotPy projects use?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -83,6 +83,8 @@ you are a vendor, please reach out to our team and we'd be happy to assist.
The RobotPy project also provides unofficial wrappers for vendor libraries that don't
take a lot of effort to create and maintain.

.. seealso:: :doc:`frc:docs/software/vscode-overview/3rd-party-libraries`

Competition
-----------

Expand All @@ -103,10 +105,7 @@ using RobotPy since 2010, and the maintainer of RobotPy is a member of the
WPILib team. Much of the time when bugs are found, they are found in the
underlying WPILib, instead of RobotPy itself.

One caveat to this is that because RobotPy doesn't have a beta period like
WPILib does, bugs tend to be found during the first half of competition season.
However, by the time build season ends, RobotPy is just as stable as any of
the officially suported languages.
One caveat to this is that because RobotPy is not yet widely adopted, bugs tend to be found during the first half of competition season. However, by the time build season ends, RobotPy is just as stable.

How often does RobotPy get updated?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -148,8 +147,17 @@ Ross Light, FRC Team 973. Peter is a member of the FIRST WPILib team,
and also created the `ntcore <https://github.com/wpilibsuite/ntcore/>`_
and `cscore <https://github.com/wpilibsuite/cscore/>`_ libraries.

The current RobotPy maintainer is `Dustin
Spicuzza <http://github.com/virtuald>`_, also a member of the FIRST WPILib team.
How is RobotPy different from WPILib?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

All current RobotPy developers are members of the FIRST WPILib team, so in some sense RobotPy is a subgroup of WPILib. However, RobotPy is still separate from WPILib in many ways and has it's own shiny logo, but as time goes on we are aiming to integrate more into the greater WPILib whole.

One thing that makes RobotPy different from WPILib is that we also maintain separate libraries for interacting with various 3rd party vendors, but we expect as Python gets more traction in FRC that vendors will develop and maintain their own libraries.

Who develops RobotPy?
---------------------

The current RobotPy maintainer is `Dustin Spicuzza <http://github.com/virtuald>`_.

Current RobotPy developers include:

Expand All @@ -164,6 +172,7 @@ RobotPy is an open project that all members of the FIRST community can
easily and quickly contribute to. If you find a bug, or have an idea
that you think others can use:

- Add Python documentation to :doc:`the official WPILib documentation <frc:index>`
- Test and report any issues you find.
- Port and test a useful library.
- Write a Python module and share it with others (and contribute it to
Expand Down
5 changes: 0 additions & 5 deletions frameworks/magicbot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ class as your base robot class. You'll note that it's similar to
'''Called when teleop starts; optional'''
def teleopPeriodic(self):
'''Called on each iteration of the control loop'''
if __name__ == '__main__':
wpilib.run(MyRobot)


A robot control program can be divided into several logical parts (think
drivetrain, forklift, elevator, etc). We refer to these parts as
Expand Down
21 changes: 0 additions & 21 deletions getting_started.rst

This file was deleted.

Loading

0 comments on commit eca17a1

Please sign in to comment.