Skip to content

Commit

Permalink
fix some more rlis
Browse files Browse the repository at this point in the history
  • Loading branch information
Starlight220 committed Feb 13, 2023
1 parent 0f36495 commit 8c1919a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ If your feedforwards are bad then the P controllers for each side of the robot w

.. group-tab:: C++

.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2023.2.1/wpilibcExamples/src/main/cpp/examples/RamseteCommand/cpp/RobotContainer.cpp
.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2023.3.2/wpilibcExamples/src/main/cpp/examples/RamseteCommand/cpp/RobotContainer.cpp
:language: c++
:lines: 81-82
:lines: 79-80
:linenos:
:lineno-start: 81

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,19 @@ This binding schedules a command when a trigger changes from ``false`` to ``true

.. group-tab:: Java

.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2023.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbottraditional/RobotContainer.java
.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2023.3.2/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbottraditional/RobotContainer.java
:language: java
:lines: 87-89
:lines: 114-116
:linenos:
:lineno-start: 87
:lineno-start: 114

.. group-tab:: C++

.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2023.2.1/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/RobotContainer.cpp
.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2023.3.2/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/RobotContainer.cpp
:language: c++
:lines: 46-49
:lines: 75-78
:linenos:
:lineno-start: 46
:lineno-start: 75

The ``whileFalse`` binding is identical, only that it schedules on ``false`` and cancels on ``true``.

Expand Down
36 changes: 18 additions & 18 deletions source/docs/software/commandbased/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ The ``runOnce`` factory, backed by the ``InstantCommand`` (`Java <https://github

.. group-tab:: Java

.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2023.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbotinlined/subsystems/HatchSubsystem.java
.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2023.3.2/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbotinlined/subsystems/HatchSubsystem.java
:language: java
:lines: 24-34
:lines: 25-35
:linenos:
:lineno-start: 24
:lineno-start: 25

.. group-tab:: C++ (Header)

Expand All @@ -126,11 +126,11 @@ The ``runOnce`` factory, backed by the ``InstantCommand`` (`Java <https://github

.. group-tab:: C++ (Source)

.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2023.2.1/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/subsystems/HatchSubsystem.cpp
.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2023.3.2/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/subsystems/HatchSubsystem.cpp
:language: c++
:lines: 13-23
:lines: 15-25
:linenos:
:lineno-start: 13
:lineno-start: 15

The ``run`` factory, backed by the ``RunCommand`` (`Java <https://github.wpilib.org/allwpilib/docs/release/java/edu/wpi/first/wpilibj2/command/RunCommand.html>`__, `C++ <https://github.wpilib.org/allwpilib/docs/release/cpp/classfrc2_1_1_run_command.html>`__) class, creates a command that calls a lambda repeatedly, until interrupted.

Expand Down Expand Up @@ -367,36 +367,36 @@ And then usage:

.. group-tab:: Java

.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2023.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbottraditional/RobotContainer.java
.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2023.3.2/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbottraditional/RobotContainer.java
:language: java
:lines: 57-65
:lines: 59-67
:linenos:
:lineno-start: 57
:lineno-start: 59

.. group-tab:: C++

.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2023.2.1/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/RobotContainer.cpp
.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2023.3.2/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/RobotContainer.cpp
:language: c++
:lines: 28-31
:lines: 57-60
:linenos:
:lineno-start: 28
:lineno-start: 57

Notice that this command does not override ``isFinished()``, and thus will never end; this is the norm for commands that are intended to be used as default commands. Once more, this command is rather simple and calls the subsystem method only from one place, and as such, could be more concisely written using factories:

.. tabs::

.. group-tab:: Java

.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2023.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbotinlined/RobotContainer.java
.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2023.3.2/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbotinlined/RobotContainer.java
:language: java
:lines: 49-58
:lines: 51-60
:linenos:
:lineno-start: 49
:lineno-start: 51

.. group-tab:: C++

.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2023.2.1/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/RobotContainer.cpp
.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2023.3.2/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/RobotContainer.cpp
:language: c++
:lines: 23-29
:lines: 52-58
:linenos:
:lineno-start: 23
:lineno-start: 52

0 comments on commit 8c1919a

Please sign in to comment.