Skip to content

Commit

Permalink
Merge branch 'main' into copybuttonext
Browse files Browse the repository at this point in the history
  • Loading branch information
jasondaming authored Dec 22, 2023
2 parents 42c42e8 + ad34631 commit 710dc31
Show file tree
Hide file tree
Showing 80 changed files with 1,122 additions and 504 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/inspector.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@
{
"baseUrl": "https://raw.githubusercontent.com/wpilibsuite/allwpilib/",
"versionScheme": "v\\d{4}\\.\\d\\.\\d(?:-(?:alpha|beta)-\\d)?|[0-9a-f]{40}",
"latestVersion": "v2024.1.1-beta-3"
"latestVersion": "v2024.1.1-beta-4"
},
{
"baseUrl": "https://github.com/wpilibsuite/allwpilib/raw/",
"versionScheme": "v\\d{4}\\.\\d\\.\\d(?:-(?:alpha|beta)-\\d)?|[0-9a-f]{40}",
"latestVersion": "v2024.1.1-beta-3"
"latestVersion": "v2024.1.1-beta-4"
},
{
"baseUrl": "https://raw.githubusercontent.com/robotpy/examples/",
"versionScheme": "\\d{4}\\.\\d\\.\\d\\.\\d(?:-(?:alpha|beta)-\\d)?|[0-9a-f]{40}",
"latestVersion": "2023.4.3.0"
"latestVersion": "411d9b02dfa1c4ec5d35410a40f88be796f82f70"
},
{
"baseUrl": "https://raw.githubusercontent.com/wpilibsuite/vscode-wpilib/",
"versionScheme": "v\\d{4}\\.\\d\\.\\d(?:-(?:alpha|beta)-\\d)?|[0-9a-f]{40}",
"latestVersion":"v2024.1.1-beta-2"
"latestVersion":"v2024.1.1-beta-4"
},
{
"baseUrl": "https://raw.githubusercontent.com/wpilibsuite/StandaloneAppSamples/",
"versionScheme": "v\\d{4}\\.\\d\\.\\d(?:-(?:alpha|beta)-\\d)?|[0-9a-f]{40}",
"latestVersion":"3b64aadee717c9f0566497a40fd0be7d0eaed96d"
}
],
"ignoredFiles": ["source/docs/software/commandbased/command-scheduler.rst"]
"ignoredFiles": ["source/docs/software/commandbased/command-scheduler.rst", "source/docs/software/hardware-apis/pneumatics/pressure.rst", "source/docs/software/hardware-apis/pneumatics/solenoids.rst", "source/docs/software/advanced-gradlerio/code-formatting.rst"]
}
5 changes: 2 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ sphinx-notfound-page = "==1.0.0"
sphinx-rtd-theme = "2.0.0rc2"
sphinx-tabs = "==3.4.4"
sphinx-toolbox = "==3.5.0"
modern-sphinx-version-warning = "==1.1.4"
modern-sphinx-version-warning = "==1.1.6"
sphinxcontrib-htmlhelp = "==2.0.4"
sphinxcontrib-serializinghtml = "==1.1.9"
sphinxcontrib-svg2pdfconverter = "==1.2.2"
Expand Down
43 changes: 43 additions & 0 deletions source/_extensions/default_latex_image_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from typing import Any, Dict

from docutils import nodes

from sphinx.transforms.post_transforms import SphinxPostTransform
from sphinx.application import Sphinx


class DefaultLaTeXImageSettingsTransform(SphinxPostTransform):
"""
Set a default image width for images which do not have a width attribute
manually set. Also center images which are not centered. This only applies
to LaTeX builds.
"""

default_priority = 100 # chosen arbitrarily

def run(self, **kwargs: Any) -> None:
if not self.app.tags.has("latex"):
return

width = self.app.config["default_latex_image_width"]

for node in self.document.findall(nodes.image):
if "width" not in node.attributes:
node.attributes["width"] = width

if (
self.app.config["default_latex_image_centered"]
and "align" not in node.attributes
):
node.attributes["align"] = "center"


def setup(app: Sphinx) -> Dict[str, Any]:
app.add_config_value("default_latex_image_width", "25em", True)
app.add_config_value("default_latex_image_centered", True, True)
app.add_post_transform(DefaultLaTeXImageSettingsTransform)

return {
"parallel_read_safe": True,
"parallel_write_safe": True,
}
4 changes: 4 additions & 0 deletions source/_static/css/frc-rtd.css
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,8 @@ summary {
font-weight: bold;
margin: -.5em -.5em 0;
padding: .5em;
}

code.py-class {
all: unset!important;
}
14 changes: 14 additions & 0 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"sphinx.ext.mathjax",
"sphinx.ext.todo",
"sphinx.ext.autosectionlabel",
"sphinx.ext.intersphinx",
"sphinxcontrib.rsvgconverter",
"sphinxext.delta",
"sphinxext.opengraph",
Expand All @@ -64,6 +65,7 @@
"_extensions.localization",
"_extensions.controls_js_sim",
"_extensions.wpilib_release",
"_extensions.default_latex_image_settings",
]

extensions += local_extensions
Expand Down Expand Up @@ -324,3 +326,15 @@ def new_send(self, data):


http.client.HTTPConnection.send = new_send

intersphinx_mapping = {
"robotpy": ("https://robotpy.readthedocs.io/projects/robotpy/en/latest/", None),
}

# We recommend adding the following config value.
# Sphinx defaults to automatically resolve *unresolved* labels using all your Intersphinx mappings.
# This behavior has unintended side-effects, namely that documentations local references can
# suddenly resolve to an external location.
# See also:
# https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#confval-intersphinx_disabled_reftypes
intersphinx_disabled_reftypes = ["*"]
6 changes: 3 additions & 3 deletions source/docs/contributing/frc-docs/style-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ When possible, instead of using code blocks, an RLI should be used. This pulls

.. code-block:: ReST
.. rli:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2024.1.1-beta-3/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ramsetecontroller/Robot.java
.. rli:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2024.1.1-beta-4/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ramsetecontroller/Robot.java
:language: java
:lines: 44-61
:linenos:
:lineno-start: 44
.. rli:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2024.1.1-beta-3/wpilibcExamples/src/main/cpp/examples/RamseteController/cpp/Robot.cpp
.. rli:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2024.1.1-beta-4/wpilibcExamples/src/main/cpp/examples/RamseteController/cpp/Robot.cpp
:language: cpp
:lines: 18-30
:linenos:
Expand All @@ -129,7 +129,7 @@ To create code tabs in an article, you can use the ``.. tab-set-code::`` directi
.. tab-set-code::
.. rli:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2024.1.1-beta-3/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ramsetecontroller/Robot.java
.. rli:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2024.1.1-beta-4/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ramsetecontroller/Robot.java
:language: java
:lines: 44-61
:linenos:
Expand Down
2 changes: 1 addition & 1 deletion source/docs/romi-robot/programming-romi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ One aspect where a Romi project differs from a regular FRC robot project is that

To run a Romi program, first, ensure that your Romi is powered on. Next, connect to the ``WPILibPi-<number>`` WiFi network broadcast by the Romi. If you changed the Romi network settings (for example, to connect it to your own WiFi network) you may change the IP address that your program uses to connect to the Romi. To do this, open the ``build.gradle`` file and update the ``wpi.sim.envVar`` line to the appropriate IP address.

.. rli:: https://raw.githubusercontent.com/wpilibsuite/vscode-wpilib/v2024.1.1-beta-2/vscode-wpilib/resources/gradle/javaromi/build.gradle
.. rli:: https://raw.githubusercontent.com/wpilibsuite/vscode-wpilib/v2024.1.1-beta-4/vscode-wpilib/resources/gradle/javaromi/build.gradle
:language: groovy
:lines: 44-47
:linenos:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ A more complete example of ``ProfiledPIDController`` usage is provided in the El

.. tab-set-code::

.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2024.1.1-beta-3/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/elevatorprofiledpid/Robot.java
.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2024.1.1-beta-4/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/elevatorprofiledpid/Robot.java
:language: java
:lines: 5-
:linenos:
:lineno-start: 5

.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2024.1.1-beta-3/wpilibcExamples/src/main/cpp/examples/ElevatorProfiledPID/cpp/Robot.cpp
.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2024.1.1-beta-4/wpilibcExamples/src/main/cpp/examples/ElevatorProfiledPID/cpp/Robot.cpp
:language: c++
:lines: 5-
:linenos:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,19 @@ Once we've created a ``TrapezoidProfile``, using it is very simple: to get the p

.. code-block:: java
// Profile will end stationary at 5 meters
// Profile will start stationary at zero position
// Profile will end stationary at 5 meters
// Returns the motion profile state after 5 seconds of motion
profile.calculate(5, new TrapezoidProfile.State(5, 0), new TrapezoidProfile.State(0, 0));
profile.calculate(5, new TrapezoidProfile.State(0, 0), new TrapezoidProfile.State(5, 0));
.. code-block:: c++

// Profile will end stationary at 5 meters
// Profile will start stationary at zero position
// Profile will end stationary at 5 meters
// Returns the motion profile state after 5 seconds of motion
profile.Calculate(5_s,
frc::TrapezoidProfile<units::meters>::State{5_m, 0_mps},
frc::TrapezoidProfile<units::meters>::State{0_m, 0_mps});
frc::TrapezoidProfile<units::meters>::State{0_m, 0_mps},
frc::TrapezoidProfile<units::meters>::State{5_m, 0_mps});

Using the State
^^^^^^^^^^^^^^^
Expand All @@ -119,12 +119,12 @@ The ``calculate`` method returns a ``TrapezoidProfile.State`` class (the same on

.. code-block:: java
var setpoint = profile.calculate(elapsedTime, goalState, initialState);
var setpoint = profile.calculate(elapsedTime, initialState, goalState);
controller.calculate(encoder.getDistance(), setpoint.position);
.. code-block:: c++

auto setpoint = profile.Calculate(elapsedTime, goalState, initialState);
auto setpoint = profile.Calculate(elapsedTime, initialState, goalState);
controller.Calculate(encoder.GetDistance(), setpoint.position.value());

Complete Usage Example
Expand All @@ -136,13 +136,13 @@ A more complete example of ``TrapezoidProfile`` usage is provided in the Elevato

.. tab-set-code::

.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2024.1.1-beta-3/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/elevatortrapezoidprofile/Robot.java
.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2024.1.1-beta-4/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/elevatortrapezoidprofile/Robot.java
:language: java
:lines: 5-
:linenos:
:lineno-start: 5

.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2024.1.1-beta-3/wpilibcExamples/src/main/cpp/examples/ElevatorTrapezoidProfile/cpp/Robot.cpp
.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2024.1.1-beta-4/wpilibcExamples/src/main/cpp/examples/ElevatorTrapezoidProfile/cpp/Robot.cpp
:language: c++
:lines: 5-
:linenos:
Expand Down
Loading

0 comments on commit 710dc31

Please sign in to comment.