diff --git a/source/docs/software/commandbased/profile-subsystems-commands.rst b/source/docs/software/commandbased/profile-subsystems-commands.rst index cfa21cb119..5bf4c000e5 100644 --- a/source/docs/software/commandbased/profile-subsystems-commands.rst +++ b/source/docs/software/commandbased/profile-subsystems-commands.rst @@ -42,4 +42,4 @@ The following examples are taken from the DriveDistanceOffboard example project There are two commands in this example. They function very similarly, with the main difference being that one resets encoders, and the other doesn't, which allows encoder data to be preserved. -The subsystem contains a ``TrapezoidProfile`` with a ``Timer``. The timer is used along with a ``kDt`` constant of 0.02 seconds to calculate the current and next states from the ``TrapezoidProfile``. The current state is fed to the "smart" motor controller for PID control, while the current and next state are used to calculate feedforward outputs. Both commands end when ``isFinished(0)`` returns true, which means that the profile has reached the goal state. +The ``DriveSubsystem`` contains a ``TrapezoidProfile`` and a ``Timer``. The ``startRun`` command factory is used, with the first lambda being run when the command is scheduled. It restarts the timer, and for ``profiledDriveDistance``, it resets the encoders; for ``dynamicProfiledDriveDistance``, it sets the initial distances for the left and right encoders. The second lambda passed into ``startRun`` will repeatedly run while the command is scheduled. Inside the lambda, the timer is used along with a ``kDt`` constant of 0.02 seconds to calculate the current and next states from the ``TrapezoidProfile``. The current state is fed to the "smart" motor controller for PID control, while the current and next state are used to calculate feedforward outputs. The ``until`` decorator is used after the ``startRun`` command factory to end the command when ``isFinished(0)`` returns true, which means that the profile has reached the goal state.