PPL API Reference
Overview Core Algorithm Abstractions Utilities Parallel Methods
Modules Class Hierarchy Classes Functions
Todo List Bug List Dead Code
List of all members
RobotCommandQueue Class Referencefinal

Public Member Functions

Construction
 RobotCommandQueue (XMLNode &_node)
 
 ~RobotCommandQueue ()
 
Hardware Properties
double GetCommunicationTime () const
 Get the longest communication time for any piece of hardware.
 
ActuatorInterfaceGetActuator () const noexcept
 Get the robot's base/actuator.
 
SensorInterfaceGetSensor () const noexcept
 Get the robot's sensor.
 
Command Queue Manipulation
std::shared_ptr< CommandGetCurrentCommand () 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)
 

Detailed Description

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.

Note
For now we are assuming the entire queue will use the longest communication time for each component. We may wish to refine this to check/use the specific times for individual components.

Constructor & Destructor Documentation

◆ RobotCommandQueue()

RobotCommandQueue::RobotCommandQueue ( XMLNode _node)

Create a robot command queue from an XML specification of the hardware settings.

Parameters
_nodeThe XML node.

Member Function Documentation

◆ EnqueueCommand()

void RobotCommandQueue::EnqueueCommand ( Command &&  _command)

Add a command to the end of the robot's command queue.

Parameters
_commandThe command to execute.

◆ IsIdle()

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.

◆ FullStop()

bool RobotCommandQueue::FullStop ( )

Halt the hardware robot immediately. This should NOT touch the command queue in order to avoid deadlock conditions (do that separately).

Returns
True if the hardware acknowledged the command. THIS DOES NOT GUARANTEE THAT IT WORKED!

◆ StopQueue()

void RobotCommandQueue::StopQueue ( )
protected

Stop the command queue and release its resources. Commands already in the queue will be cleared.

◆ SendToRobot()

void RobotCommandQueue::SendToRobot ( const Command _command)
protected

Send a command to the robot. Must check for and recognize empty controls as 'wait' commands.

Parameters
_commandCommand to send to robot

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