diff --git a/source/docs/software/commandbased/commands.rst b/source/docs/software/commandbased/commands.rst index 995fc5d4bd..8c38de7549 100644 --- a/source/docs/software/commandbased/commands.rst +++ b/source/docs/software/commandbased/commands.rst @@ -242,7 +242,9 @@ The ``startEnd`` factory, backed by the ``StartEndCommand`` ([Java](https://gith // Requires the drive subsystem {&m_drive} ) - .. code-block:: python + ``` + + ```python commands2.cmd.functional_command( # Reset encoders on command start lambda: robot_drive.reset_encoders(), diff --git a/source/docs/software/telemetry/persistent-alerts.rst b/source/docs/software/telemetry/persistent-alerts.rst index 96c755c3fc..37fc20128f 100644 --- a/source/docs/software/telemetry/persistent-alerts.rst +++ b/source/docs/software/telemetry/persistent-alerts.rst @@ -16,7 +16,7 @@ Alerts are created and managed using the ``Alert`` class. Typically, an alert sh Alert states are often expressed most easily as a conditional, such as whether the latest signal from a CAN device is up-to-date. In this case, we recommend calling the ``set`` method in a periodic loop and relying on the built-in change detection to activate the alert. .. tab-set-code:: - .. code-block:: java + ```java class Robot { Alert alert = new Alert("Something went wrong", AlertType.kWarning); @@ -25,8 +25,9 @@ Alert states are often expressed most easily as a conditional, such as whether t alert.set(...); } } + ``` - .. code-block:: c++ + ```c++ class Robot { frc::Alert alert{"Something went wrong", frc::Alert::AlertType::kWarning}; @@ -35,14 +36,16 @@ Alert states are often expressed most easily as a conditional, such as whether t Robot::periodic() { alert.Set(...); } + ``` - .. code-block:: python + ```python self.alert = Alert("Something went wrong", AlertType.kWarning) def periodic() { self.alert.set(...) } + ``` .. note:: Suggested usage of each alert type (error, warning, or info) is provided in the enum API documentation. diff --git a/source/docs/software/wpilib-tools/wpical/index.rst b/source/docs/software/wpilib-tools/wpical/index.rst index 15fa38383d..b7312381b2 100644 --- a/source/docs/software/wpilib-tools/wpical/index.rst +++ b/source/docs/software/wpilib-tools/wpical/index.rst @@ -104,7 +104,7 @@ There are a three things each calibration JSON needs: Example: -.. code-block:: json +```json { "avg_reprojection_error": 0.3989609373420966, @@ -136,6 +136,7 @@ Example: 0.0 // ty ] } +``` ## Field Calibration After calibrating the camera, you can use the camera model to find the relative positions of the Apriltags. The calibration process will generate a WPILib field layout .json file and a .fmap for use on coprocessors and in robot code. WPIcal will prompt the user to specify a location to save the generated .json and .fmap field layouts to when the :guilabel:`Calibrate!!!` button is pressed. @@ -167,8 +168,7 @@ WPIcal uses an "ideal" field map JSON as an initial guess point for the optimiza Example: -.. code-block:: json - +```json { "ID": 1, "pose": { @@ -187,6 +187,7 @@ Example: }, }, } +``` ### Select Field Calibration Directory WPIcal can calibrate a field based on one or more videos. All the calibration videos must be stored in their own directory, separate from any other files.