Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
tap::control::Command Class Referenceabstract

#include <command.hpp>

Inheritance diagram for tap::control::Command:

Public Member Functions

 Command ()
 
virtual ~Command ()
 
mockable subsystem_scheduler_bitmap_t getRequirementsBitwise () const
 
int getGlobalIdentifier () const
 
mockable void addSubsystemRequirement (Subsystem *requirement)
 
virtual const char * getName () const =0
 
virtual bool isReady ()
 
virtual void initialize ()=0
 
virtual void execute ()=0
 
virtual void end (bool interrupted)=0
 
virtual bool isFinished () const =0
 

Protected Attributes

command_scheduler_bitmap_t commandRequirementsBitwise = 0
 

Detailed Description

A generic extendable class for implementing a command. Each command is attached to a subsystem. To create a new command, extend the Command class and instantiate the virtual functions in this class. See example_command.hpp for example of this.

Constructor & Destructor Documentation

◆ Command()

tap::control::Command::Command ( )

◆ ~Command()

tap::control::Command::~Command ( )
virtual

Member Function Documentation

◆ addSubsystemRequirement()

void tap::control::Command::addSubsystemRequirement ( Subsystem requirement)

Adds the required subsystem to a list of required subsystems.

Parameters
[in]requirementthe requirement to add to the list of requirements. If the requirement is nullptr or if the requirement is already in the set, nothing is added.

◆ end()

◆ execute()

◆ getGlobalIdentifier()

int tap::control::Command::getGlobalIdentifier ( ) const
inline

◆ getName()

◆ getRequirementsBitwise()

mockable subsystem_scheduler_bitmap_t tap::control::Command::getRequirementsBitwise ( ) const
inline

Specifies the encoded set of subsystems used by this command. Two commands cannot use the same subsystem at the same time. If another command is scheduled that shares a requirement, the command will be interrupted. If no subsystems are required, return an empty set.

The generic Command class contains a list of the requrements. The user should add requirements to this list accordingly (typically in the constructor of a class extending the Command class). If a Command does not specify any requirements, the Command cannot be added to the CommandScheduler.

See also
CommandScheduler
Returns
the set of subsystems that are required.

◆ initialize()

◆ isFinished()

◆ isReady()

Member Data Documentation

◆ commandRequirementsBitwise

command_scheduler_bitmap_t tap::control::Command::commandRequirementsBitwise = 0
protected

The documentation for this class was generated from the following files: