From c995ef4e9ff39dfdbc93eb093c90f563ab5b5067 Mon Sep 17 00:00:00 2001 From: sciencewhiz Date: Fri, 16 Aug 2024 19:01:04 -0700 Subject: [PATCH] Enable linkcheck of anchors (#2700) Exclude sites that dynamicaly generate anchors (new in Sphinx 7.1) Exclude javadocs until #2695 is fixed Fix broken anchors --- source/conf.py | 8 +++++++- .../hardware-basics/wiring-pneumatics-ph.rst | 2 +- .../software/advanced-controls/controls-glossary.rst | 2 +- .../software/advanced-gradlerio/compiler-args.rst | 4 ++-- .../software/commandbased/command-compositions.rst | 12 ++++++------ .../docs/software/commandbased/command-scheduler.rst | 4 ++-- 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/source/conf.py b/source/conf.py index 2caa8a4e76..930c1edfea 100644 --- a/source/conf.py +++ b/source/conf.py @@ -139,7 +139,7 @@ todo_include_todos = False # Disable following anchors in URLS for linkcheck -linkcheck_anchors = False +linkcheck_anchors = True # Linkcheck Exclusions linkcheck_ignore = [ @@ -159,6 +159,12 @@ r".*knowledge.ni.com.*", ] +linkcheck_anchors_ignore_for_url = [ + r".*github.com.*", + r".*github.wpilib.org/allwpilib/docs/development/java/.*", # until #2695 is fixed + r".*ni.com/en/support/downloads/drivers/download.frc-game-tools.html.*", +] + # Sets linkcheck timeout in seconds linkcheck_timeout = 30 linkcheck_retries = 3 diff --git a/source/docs/hardware/hardware-basics/wiring-pneumatics-ph.rst b/source/docs/hardware/hardware-basics/wiring-pneumatics-ph.rst index 7d5793ff52..9d277a5a36 100644 --- a/source/docs/hardware/hardware-basics/wiring-pneumatics-ph.rst +++ b/source/docs/hardware/hardware-basics/wiring-pneumatics-ph.rst @@ -50,7 +50,7 @@ Analog An analog pressure switch ([REV-11-1107](https://www.revrobotics.com/rev-11-1107/) can be connected directly to the analog pressure sensor port 0 input terminals. Using an analog pressure sensor allows reading the pressure in the pneumatic system through code and setting custom trigger thresholds for turning on and off the compressor. -.. warning:: The Analog Pressure Sensor port is a very tight fit and requires special attention. See [REV Wiring an Analog Pressure Sensor](https://docs.revrobotics.com/rev-11-1852/pneumatic-hub-getting-started/wiring-the-pneumatic-hub#wiring-an-analog-pressure-sensor) for more tips +.. warning:: The Analog Pressure Sensor port is a very tight fit and requires special attention. See [REV Wiring an Analog Pressure Sensor](https://docs.revrobotics.com/ion-control-system/ph/gs/wiring#wiring-an-analog-pressure-sensor) for more tips Solenoids --------- diff --git a/source/docs/software/advanced-controls/controls-glossary.rst b/source/docs/software/advanced-controls/controls-glossary.rst index 388d8de4bf..c9504e8565 100644 --- a/source/docs/software/advanced-controls/controls-glossary.rst +++ b/source/docs/software/advanced-controls/controls-glossary.rst @@ -161,7 +161,7 @@ Controls Glossary The measurement of how much an electric field is "pushing" electrons through a circuit. It is sometimes called "Electromotive Force", or "EMF". It is measured in units of "Volts". It always is defined between *two* points in a circuit. If one electron travels between two points that have one volt of EMF between them, it will have been accelerated to the point of having :math:`\frac{1}{6241509074000000000}` joules of energy. viscous drag - The force generated from an object moving *relatively* slowly through non-turbulent fluid. In this region, the force is roughly proportional to the *velocity* of the object. It describes the most common type of "air resistance" an FRC robot would encounter, as well as losses in a gearbox from displacing grease. See [Drag (physics)](https://en.wikipedia.org/wiki/Drag_%28physics%29#Very_low_Reynolds_numbers:_Stokes'_drag) on Wikipedia for more info. + The force generated from an object moving *relatively* slowly through non-turbulent fluid. In this region, the force is roughly proportional to the *velocity* of the object. It describes the most common type of "air resistance" an FRC robot would encounter, as well as losses in a gearbox from displacing grease. See [Drag (physics)](https://en.wikipedia.org/wiki/Drag_%28physics%29#Low_Reynolds_numbers:_Stokes'_drag) on Wikipedia for more info. x-dot :math:`\dot{\mathbf{x}}`, or x-dot: the derivative of the :term:`state` vector :math:`\mathbf{x}`. If the :term:`system` had just a velocity :term:`state`, then :math:`\dot{\mathbf{x}}` would represent the :term:`system`\'s acceleration. diff --git a/source/docs/software/advanced-gradlerio/compiler-args.rst b/source/docs/software/advanced-gradlerio/compiler-args.rst index 9284d00c4f..1224609397 100644 --- a/source/docs/software/advanced-gradlerio/compiler-args.rst +++ b/source/docs/software/advanced-gradlerio/compiler-args.rst @@ -1,7 +1,7 @@ Using Compiler Arguments ======================== -Compiler arguments allow us to change the behavior of our compiler. This includes making warnings into errors, ignoring certain warnings and choosing optimization level. When compiling code a variety of flags are already included by default which can be found [here](https://github.com/wpilibsuite/native-utils/blob/main/src/main/java/edu/wpi/first/nativeutils/WPINativeUtilsExtension.java#L37). Normally it could be proposed that the solution is to pass them in as flags when compiling our code but this doesn't work in GradleRIO. Instead modify the build.gradle. +Compiler arguments allow us to change the behavior of our compiler. This includes making warnings into errors, ignoring certain warnings and choosing optimization level. When compiling code a variety of flags are already included by default which can be found [here](https://github.com/wpilibsuite/native-utils/blob/v2024.7.2/src/main/java/edu/wpi/first/nativeutils/WPINativeUtilsExtension.java#L38). Normally it could be proposed that the solution is to pass them in as flags when compiling our code but this doesn't work in GradleRIO. Instead modify the build.gradle. .. warning:: Modifying arguments is dangerous and can cause unexpected behavior. @@ -11,7 +11,7 @@ C++ Platforms ^^^^^^^^^ -Different compilers and different platforms use a variety of different flags. Therefore to avoid breaking different platforms with compiler flags configure all flags per platform. The platforms that are supported are listed [here](https://github.com/wpilibsuite/native-utils/blob/main/src/main/java/edu/wpi/first/nativeutils/WPINativeUtilsExtension.java#L96) +Different compilers and different platforms use a variety of different flags. Therefore to avoid breaking different platforms with compiler flags configure all flags per platform. The platforms that are supported are listed [here](https://github.com/wpilibsuite/native-utils/blob/v2024.7.2/src/main/java/edu/wpi/first/nativeutils/WPINativeUtilsExtension.java#L96) Configuring for a Platform ^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/source/docs/software/commandbased/command-compositions.rst b/source/docs/software/commandbased/command-compositions.rst index 843b5d8441..8d8106f725 100644 --- a/source/docs/software/commandbased/command-compositions.rst +++ b/source/docs/software/commandbased/command-compositions.rst @@ -60,7 +60,7 @@ The ``repeatedly()`` decorator ([Java](https://github.wpilib.org/allwpilib/docs/ Sequence ^^^^^^^^ -The ``Sequence`` factory ([Java](https://github.wpilib.org/allwpilib/docs/development/java/edu/wpi/first/wpilibj2/command/Commands.html#sequence(edu.wpi.first.wpilibj2.command.Command...)), [C++](https://github.wpilib.org/allwpilib/docs/development/cpp/namespacefrc2_1_1cmd.html#a2818c000b0b989bc66032847ecb3fed2), :external:py:func:[Python](commands2.cmd.sequence>`), backed by the ``SequentialCommandGroup`` class (`Java `), runs a list of commands in sequence: the first command will be executed, then the second, then the third, and so on until the list finishes. The sequential group finishes after the last command in the sequence finishes. It is therefore usually important to ensure that each command in the sequence does actually finish (if a given command does not finish, the next command will never start!). +The ``Sequence`` factory ([Java](https://github.wpilib.org/allwpilib/docs/development/java/edu/wpi/first/wpilibj2/command/Commands.html#sequence(edu.wpi.first.wpilibj2.command.Command...)), [C++](https://github.wpilib.org/allwpilib/docs/development/cpp/namespacefrc2_1_1cmd.html#ac588bdc52a86a4683b89c28dcadea458), :external:py:func:[Python](commands2.cmd.sequence>`), backed by the ``SequentialCommandGroup`` class (`Java `), runs a list of commands in sequence: the first command will be executed, then the second, then the third, and so on until the list finishes. The sequential group finishes after the last command in the sequence finishes. It is therefore usually important to ensure that each command in the sequence does actually finish (if a given command does not finish, the next command will never start!). The ``andThen()`` ([Java](https://github.wpilib.org/allwpilib/docs/development/java/edu/wpi/first/wpilibj2/command/Command.html#andThen(edu.wpi.first.wpilibj2.command.Command...)), [C++](https://github.wpilib.org/allwpilib/docs/development/cpp/classfrc2_1_1_command_ptr.html#a4ea952f52baf9fb157bb42801be602c0), :external:py:meth:[Python](commands2.Command.andThen>`) and ``beforeStarting()`` (`Java `) decorators can be used to construct a sequence composition with infix syntax. @@ -82,16 +82,16 @@ The ``andThen()`` ([Java](https://github.wpilib.org/allwpilib/docs/development/j Repeating Sequence ^^^^^^^^^^^^^^^^^^ -As it's a fairly common combination, the ``RepeatingSequence`` factory ([Java](https://github.wpilib.org/allwpilib/docs/development/java/edu/wpi/first/wpilibj2/command/Commands.html#repeatingSequence(edu.wpi.first.wpilibj2.command.Command...)), [C++](https://github.wpilib.org/allwpilib/docs/development/cpp/namespacefrc2_1_1cmd.html#ae363301748047f753dcbe3eca0a10ced), :external:py:func:`Python `) creates a `Repeating`_ `Sequence`_ that runs until interrupted, restarting from the first command each time the last command finishes. +As it's a fairly common combination, the ``RepeatingSequence`` factory ([Java](https://github.wpilib.org/allwpilib/docs/development/java/edu/wpi/first/wpilibj2/command/Commands.html#repeatingSequence(edu.wpi.first.wpilibj2.command.Command...)), [C++](https://github.wpilib.org/allwpilib/docs/development/cpp/namespacefrc2_1_1cmd.html#ac6b82e1b867c16264aa4e4bd79724d8c), :external:py:func:`Python `) creates a `Repeating`_ `Sequence`_ that runs until interrupted, restarting from the first command each time the last command finishes. Parallel ^^^^^^^^ There are three types of parallel compositions, differing based on when the composition finishes: -- The ``Parallel`` factory ([Java](https://github.wpilib.org/allwpilib/docs/development/java/edu/wpi/first/wpilibj2/command/Commands.html#parallel(edu.wpi.first.wpilibj2.command.Command...)), [C++](https://github.wpilib.org/allwpilib/docs/development/cpp/namespacefrc2_1_1cmd.html#a0ea0faa5d66fbe942917844936687172), :external:py:func:[Python](commands2.cmd.parallel>`), backed by the ``ParallelCommandGroup`` class (`Java `), constructs a parallel composition that finishes when all members finish. The ``alongWith`` decorator (`Java `) does the same in infix notation. -- The ``Race`` factory ([Java](https://github.wpilib.org/allwpilib/docs/development/java/edu/wpi/first/wpilibj2/command/Commands.html#race(edu.wpi.first.wpilibj2.command.Command...)), [C++](https://github.wpilib.org/allwpilib/docs/development/cpp/namespacefrc2_1_1cmd.html#a3455ac77f921f355edae8baeb911ef40), :external:py:func:[Python](commands2.cmd.race>`), backed by the ``ParallelRaceGroup`` class (`Java `), constructs a parallel composition that finishes as soon as any member finishes; all other members are interrupted at that point. The ``raceWith`` decorator (`Java `) does the same in infix notation. -- The ``Deadline`` factory ([Java](https://github.wpilib.org/allwpilib/docs/development/java/edu/wpi/first/wpilibj2/command/Commands.html#deadline(edu.wpi.first.wpilibj2.command.Command,edu.wpi.first.wpilibj2.command.Command...)), [C++](https://github.wpilib.org/allwpilib/docs/development/cpp/namespacefrc2_1_1cmd.html#aad22f6f92f4dbbe7b5736e0e39e00184), :external:py:func:[Python](commands2.cmd.deadline>`), ``ParallelDeadlineGroup`` (`Java `) finishes when a specific command (the "deadline") ends; all other members still running at that point are interrupted. The ``deadlineWith`` decorator (`Java `) does the same in infix notation; the comand the decorator was called on is the deadline. +- The ``Parallel`` factory ([Java](https://github.wpilib.org/allwpilib/docs/development/java/edu/wpi/first/wpilibj2/command/Commands.html#parallel(edu.wpi.first.wpilibj2.command.Command...)), [C++](https://github.wpilib.org/allwpilib/docs/development/cpp/namespacefrc2_1_1cmd.html#ac98ed0faaf370bde01be52bd631dc4e8), :external:py:func:[Python](commands2.cmd.parallel>`), backed by the ``ParallelCommandGroup`` class (`Java `), constructs a parallel composition that finishes when all members finish. The ``alongWith`` decorator (`Java `) does the same in infix notation. +- The ``Race`` factory ([Java](https://github.wpilib.org/allwpilib/docs/development/java/edu/wpi/first/wpilibj2/command/Commands.html#race(edu.wpi.first.wpilibj2.command.Command...)), [C++](https://github.wpilib.org/allwpilib/docs/development/cpp/namespacefrc2_1_1cmd.html#a5253e241cf1e19eddfb79e2311068ac5), :external:py:func:[Python](commands2.cmd.race>`), backed by the ``ParallelRaceGroup`` class (`Java `), constructs a parallel composition that finishes as soon as any member finishes; all other members are interrupted at that point. The ``raceWith`` decorator (`Java `) does the same in infix notation. +- The ``Deadline`` factory ([Java](https://github.wpilib.org/allwpilib/docs/development/java/edu/wpi/first/wpilibj2/command/Commands.html#deadline(edu.wpi.first.wpilibj2.command.Command,edu.wpi.first.wpilibj2.command.Command...)), [C++](https://github.wpilib.org/allwpilib/docs/development/cpp/namespacefrc2_1_1cmd.html#a91073d40910a70f1e2d02c7ce320196a), :external:py:func:[Python](commands2.cmd.deadline>`), ``ParallelDeadlineGroup`` (`Java `) finishes when a specific command (the "deadline") ends; all other members still running at that point are interrupted. The ``deadlineWith`` decorator (`Java `) does the same in infix notation; the comand the decorator was called on is the deadline. .. tab-set-code:: @@ -181,7 +181,7 @@ Selecting Compositions Sometimes it's desired to run a command out of a few options based on sensor feedback or other data known only at runtime. This can be useful for determining an auto routine, or running a different command based on whether a game piece is present or not, and so on. -The ``Select`` factory ([Java](https://github.wpilib.org/allwpilib/docs/development/java/edu/wpi/first/wpilibj2/command/Commands.html#select(java.util.Map,java.util.function.Supplier)), [C++](https://github.wpilib.org/allwpilib/docs/development/cpp/namespacefrc2_1_1cmd.html#a56f9a9c571bd9da0a0b4612706d8db1c), :external:py:func:[Python](commands2.cmd.select>`), backed by the ``SelectCommand`` class (`Java `), executes one command from a map, based on a selector function called when scheduled. +The ``Select`` factory ([Java](https://github.wpilib.org/allwpilib/docs/development/java/edu/wpi/first/wpilibj2/command/Commands.html#select(java.util.Map,java.util.function.Supplier)), [C++](https://github.wpilib.org/allwpilib/docs/development/cpp/namespacefrc2_1_1cmd.html#ae9a028777063223108f78c7a0c4e8746), :external:py:func:[Python](commands2.cmd.select>`), backed by the ``SelectCommand`` class (`Java `), executes one command from a map, based on a selector function called when scheduled. .. tab-set:: diff --git a/source/docs/software/commandbased/command-scheduler.rst b/source/docs/software/commandbased/command-scheduler.rst index 1777a08357..2b1047e251 100644 --- a/source/docs/software/commandbased/command-scheduler.rst +++ b/source/docs/software/commandbased/command-scheduler.rst @@ -17,7 +17,7 @@ However, there is one exception: users *must* call ``CommandScheduler.getInstanc The ``schedule()`` Method ------------------------- -To schedule a command, users call the ``schedule()`` method ([Java](https://github.wpilib.org/allwpilib/docs/development/java/edu/wpi/first/wpilibj2/command/CommandScheduler.html#schedule(boolean,edu.wpi.first.wpilibj2.command.Command...)), [C++](https://github.wpilib.org/allwpilib/docs/development/cpp/classfrc2_1_1_command_scheduler.html#a26c120054ec626806d740f2c42d9dc4f)). This method takes a command, and attempts to add it to list of currently-running commands, pending whether it is already running or whether its requirements are available. If it is added, its ``initialize()`` method is called. +To schedule a command, users call the ``schedule()`` method ([Java](https://github.wpilib.org/allwpilib/docs/development/java/edu/wpi/first/wpilibj2/command/CommandScheduler.html#schedule(boolean,edu.wpi.first.wpilibj2.command.Command...)), [C++](https://github.wpilib.org/allwpilib/docs/development/cpp/classfrc2_1_1_command_scheduler.html#a9f3f7bb5c1a3cf57592fe5cfadb6a57d)). This method takes a command, and attempts to add it to list of currently-running commands, pending whether it is already running or whether its requirements are available. If it is added, its ``initialize()`` method is called. This method walks through the following steps: @@ -59,7 +59,7 @@ The Scheduler Run Sequence .. note:: The ``initialize()`` method of each ``Command`` is called when the command is scheduled, which is not necessarily when the scheduler runs (unless that command is bound to a button). -What does a single iteration of the scheduler's ``run()`` method ([Java](https://github.wpilib.org/allwpilib/docs/development/java/edu/wpi/first/wpilibj2/command/CommandScheduler.html#run()), [C++](https://github.wpilib.org/allwpilib/docs/development/cpp/classfrc2_1_1_command_scheduler.html#aa5000fa52e320da7ba72c196f34aa0f5)) actually do? The following section walks through the logic of a scheduler iteration. For the full implementation, see the source code ([Java](https://github.com/wpilibsuite/allwpilib/blob/main/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/CommandScheduler.java#L275-L356), [C++](https://github.com/wpilibsuite/allwpilib/blob/main/wpilibNewCommands/src/main/native/cpp/frc2/command/CommandScheduler.cpp#L177-L253)). +What does a single iteration of the scheduler's ``run()`` method ([Java](https://github.wpilib.org/allwpilib/docs/development/java/edu/wpi/first/wpilibj2/command/CommandScheduler.html#run()), [C++](https://github.wpilib.org/allwpilib/docs/development/cpp/classfrc2_1_1_command_scheduler.html#aa5000fa52e320da7ba72c196f34aa0f5)) actually do? The following section walks through the logic of a scheduler iteration. For the full implementation, see the source code ([Java](https://github.com/wpilibsuite/allwpilib/blob/v2024.3.2/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/CommandScheduler.java#L252-L331), [C++](https://github.com/wpilibsuite/allwpilib/blob/v2024.3.2/wpilibNewCommands/src/main/native/cpp/frc2/command/CommandScheduler.cpp#L173-L253)). Step 1: Run Subsystem Periodic Methods ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^