|
Fang-Robotics-MCB
Fang Robotics Team Codebase
|
#include <move_unjam_comprised_command.hpp>


Public Member Functions | |
| MoveUnjamComprisedCommand (tap::Drivers *drivers, SetpointSubsystem *setpointSubsystem, float moveDisplacement, uint32_t moveTime, uint32_t pauseAfterMoveTime, bool setToTargetOnEnd, float setpointTolerance, float unjamDisplacement, float unjamThreshold, uint32_t maxUnjamWaitTime, uint_fast16_t unjamCycleCount) | |
| void | initialize () override |
| void | execute () override |
| void | end (bool interrupted) override |
| bool | isFinished () const override |
| const char * | getName () const override |
Public Member Functions inherited from tap::control::ComprisedCommand | |
| ComprisedCommand (Drivers *drivers) | |
Public Member Functions inherited from tap::control::Command | |
| Command () | |
| virtual | ~Command () |
| mockable subsystem_scheduler_bitmap_t | getRequirementsBitwise () const |
| int | getGlobalIdentifier () const |
| mockable void | addSubsystemRequirement (Subsystem *requirement) |
| virtual bool | isReady () |
Protected Attributes | |
| SetpointSubsystem * | setpointSubsystem |
| MoveCommand | agitatorRotateCommand |
| UnjamCommand | agitatorUnjamCommand |
| bool | unjamSequenceCommencing |
| bool | agitatorDisconnectFault |
Protected Attributes inherited from tap::control::ComprisedCommand | |
| CommandScheduler | comprisedCommandScheduler |
Protected Attributes inherited from tap::control::Command | |
| command_scheduler_bitmap_t | commandRequirementsBitwise = 0 |
A comprised command that combines the unjam and move commands.
Assuming no jams occur, this command behaves like a MoveCommand. It will schedule once and end once the target displacement is reached. If it gets jammed while trying to move then the command will then schedule a UnjamCommand. At this point the command will end when the UnjamCommand ends.
See UnjamCommand and MoveCommand for more details on their respective logic.
| tap::control::setpoint::MoveUnjamComprisedCommand::MoveUnjamComprisedCommand | ( | tap::Drivers * | drivers, |
| SetpointSubsystem * | setpointSubsystem, | ||
| float | moveDisplacement, | ||
| uint32_t | moveTime, | ||
| uint32_t | pauseAfterMoveTime, | ||
| bool | setToTargetOnEnd, | ||
| float | setpointTolerance, | ||
| float | unjamDisplacement, | ||
| float | unjamThreshold, | ||
| uint32_t | maxUnjamWaitTime, | ||
| uint_fast16_t | unjamCycleCount | ||
| ) |
| [in] | drivers | A pointer to the Drivers struct. |
| [in] | setpointSubsystem | The subsystem to interact with. |
| [in] | moveDisplacement | The displacement the command will apply to the subsystem |
| [in] | moveTime | See MoveCommand for more details, passed on directly to its constructor. |
| [in] | pauseAfterMoveTime | See MoveCommand for more details, passed on directly to its constructor. |
| [in] | setToTargetOnEnd | See MoveCommand for more details, passed on directly to its constructor. |
| [in] | setpointTolerance | See MoveCommand for more details, passed on directly to its constructor. |
| [in] | unjamDisplacement | See UnjamCommand's constructor for more details, passed on directly to this command's constructor. |
| [in] | unjamThreshold | See UnjamCommand's constructor for more details, passed on directly to this command's constructor. |
| [in] | unjamCycleCount | See UnjamCommand's constructor for more details, passed on directly to this command's constructor. |
| [in] | maxUnjamWaitTime | See UnjamCommand's constructor for more details, passed on directly to this command's constructor. |
|
overridevirtual |
The action to take when the command ends. Called when either the command finishes normally, or when it interrupted/canceled.
| [in] | interrupted | whether the command was interrupted/canceled. |
Implements tap::control::Command.
|
overridevirtual |
The main body of a command. Called repeatedly while the command is scheduled by a CommandScheduler.
Implements tap::control::Command.
|
inlineoverridevirtual |
Implements tap::control::Command.
|
overridevirtual |
The initial subroutine of a command. Called once when the command is initially scheduled by a CommandScheduler.
Note that command instances are re-used: a single command could be initialized, run, finished, then later initialized again. Ensure that initialize() resets any state stored in the command!
Implements tap::control::Command.
|
overridevirtual |
Whether the command has finished. Once a Command finishes, the scheduler will call the end() function and un-schedule it. If a Command is naturally finished (i.e. isFinished() == true), then the CommandScheduler will pass in false to end(). If, for example, another Command is added that in turn stops the Command from executing, then the CommandScheduler will pass in true to end().
Implements tap::control::Command.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |