PPL API Reference |
|
---|
Public Member Functions | |
Construction | |
RobotCommandQueue (XMLNode &_node) | |
~RobotCommandQueue () | |
Hardware Properties | |
double | GetCommunicationTime () const |
Get the longest communication time for any piece of hardware. | |
ActuatorInterface * | GetActuator () const noexcept |
Get the robot's base/actuator. | |
SensorInterface * | GetSensor () const noexcept |
Get the robot's sensor. | |
Command Queue Manipulation | |
std::shared_ptr< Command > | GetCurrentCommand () const |
Get the current command that the robot is executing. | |
void | EnqueueCommand (Command &&_command) |
void | ClearCommandQueue () |
Clear out the command queue. | |
bool | IsIdle () const |
bool | IsLocalizing () const |
Check if the robot has a localizing command currently on the queue. | |
Robot Control | |
bool | FullStop () |
Protected Member Functions | |
Helpers | |
void | StartQueue () |
Initialize the command queue and start it in a separate thread. | |
void | StopQueue () |
void | QueueFunction () |
The queue function to run in a separate thread. | |
void | SendToRobot (const Command &_command) |
A command queue for controlling a hardware robot through one or more hardware interfaces.
We expect all hardware robots to be able to set their actuators according to each possible control in the software robot's dynamics model. If this is not the case, then the actuator settings need to be adjusted to reflect the physical robot's capabilities.
This object supports a queue of 'commands', where a command is (currently) a set of controls executed for some length of time. The primary means of controlling the hardware robot is thus manipulation of the command queue, which allows us to set and execute commands asynchronously.
Currently this object supports up to one robot base and one sensor.
RobotCommandQueue::RobotCommandQueue | ( | XMLNode & | _node | ) |
Create a robot command queue from an XML specification of the hardware settings.
_node | The XML node. |
void RobotCommandQueue::EnqueueCommand | ( | Command && | _command | ) |
Add a command to the end of the robot's command queue.
_command | The command to execute. |
bool RobotCommandQueue::IsIdle | ( | ) | const |
Check if the robot is currently idle and has no queued commands. This will return false if you have ordered the robot to wait.
bool RobotCommandQueue::FullStop | ( | ) |
Halt the hardware robot immediately. This should NOT touch the command queue in order to avoid deadlock conditions (do that separately).
|
protected |
Stop the command queue and release its resources. Commands already in the queue will be cleared.
|
protected |
Send a command to the robot. Must check for and recognize empty controls as 'wait' commands.
_command | Command to send to robot |