PPL API Reference |
|
---|
Public Member Functions | |
Construction | |
Robot (MPProblem *const _p, XMLNode &_node) | |
Robot (MPProblem *const _p, std::unique_ptr< MultiBody > &&_mb, const std::string &_label) | |
Robot (MPProblem *const _p, const Robot &_r) | |
~Robot () noexcept | |
Disabled Functions | |
Regular copy/move is not allowed because we require a permanent MPProblem for the robot to belong to. Assignment is disabled because we should never need to re-assign entire robots. Destruct the old one and create a new one instead. | |
Robot (const Robot &)=delete | |
Robot (Robot &&)=delete | |
Robot & | operator= (const Robot &)=delete |
Robot & | operator= (Robot &&)=delete |
Planning Interface | |
void | InitializePlanningSpaces () |
Compute the configuration and velocity spaces for this robot. | |
const CSpaceBoundingBox * | GetCSpace () const noexcept |
Get the configuration space boundary for this robot. | |
const CSpaceBoundingBox * | GetVSpace () const noexcept |
Get the velocity space boundary for this robot. | |
MPProblem * | GetMPProblem () const noexcept |
Get the owning MPProblem. | |
Simulation Interface | |
void | Step (const double _dt) |
void | SynchronizeModels () noexcept |
Align the multibody model to the robot's current simulated state. | |
BulletModel * | GetSimulationModel () noexcept |
void | SetSimulationModel (BulletModel *const _m) |
Geometry Accessors | |
Access the robot's geometric representation. The robot will take ownership of its MultiBody and delete it when necessary. | |
MultiBody * | GetMultiBody () noexcept |
const MultiBody * | GetMultiBody () const noexcept |
const EndEffector & | GetEndEffector () const noexcept |
Access the robot manipulator's end effector, if it exists. | |
Agent Accessors | |
Access the robot's agent. The robot will take ownership of its agent and delete it when necessary. | |
Agent * | GetAgent () noexcept |
void | SetAgent (std::unique_ptr< Agent > &&_a) noexcept |
Control Accessors | |
Access the robot's control structures. The robot will take ownership of these and delete them when necessary. | |
ControllerMethod * | GetController () noexcept |
void | SetController (std::unique_ptr< ControllerMethod > &&_c) noexcept |
Actuator Accessors | |
Access the robot's actuators. These are set during input file parsing and cannot be changed otherwise. | |
Actuator * | GetActuator (const std::string &_label) noexcept |
const std::unordered_map< std::string, std::unique_ptr< Actuator > > & | GetActuators () const noexcept |
Get set of all actuators mapped by label. | |
Dynamics Accessors | |
MicroSimulator * | GetMicroSimulator () noexcept |
Get the robot's micro-simulator to test out controls. | |
Hardware Interface | |
Access the interface to the hardware robot (if any). | |
RobotCommandQueue * | GetHardwareQueue () const noexcept |
Get hardware command queue. | |
Battery * | GetBattery () const noexcept |
Get the emualted battery. | |
StateEstimator * | GetStateEstimator () const noexcept |
Get the state estimator. | |
void | SetStateEstimator (std::unique_ptr< StateEstimator > &&_stateEstimator) noexcept |
Set the state estimator. | |
Other Properties | |
bool | IsVirtual () const noexcept |
void | SetVirtual (const bool _v) noexcept |
bool | IsNonholonomic () const noexcept |
Check if the robot is nonholonomic. | |
bool | IsCarlike () const noexcept |
Check if the robot is car-like. | |
double | GetMaxLinearVelocity () const noexcept |
Get the maximum translational velocity for this robot. | |
double | GetMaxAngularVelocity () const noexcept |
Get the maximum angular velocity for this robot. | |
const std::string & | GetLabel () const noexcept |
Get the unique label for this robot. | |
const std::string & | GetDefaultStrategyLabel () const noexcept |
Get the default strategy label for this robot. | |
const std::string & | GetCapability () const noexcept |
Get the capability for this robot. | |
void | SetCapability (const std::string &_capability) |
Set the capability for this robot. | |
bool | IsManipulator () const noexcept |
Check if the robot is a manipulator. | |
bool | IsFixed () const noexcept |
Check if the robot has a fixed base. | |
Cfg | GetInitialCfg () |
Get initial configuration for the robot (not implemented) | |
void | SetInitialCfg (Cfg _cfg) |
Set initial configuration for the robot (not implemented) | |
Protected Member Functions | |
I/O | |
void | ReadXMLFile (const std::string &_filename) |
void | ReadXMLNode (XMLNode &_node) |
void | ReadMultiBodyXML (XMLNode &_node) |
void | ReadMultibodyFile (const std::string &_filename) |
Complete representation of a robot.
A robot has many components, including:
Construct a robot from an XML node.
_p | The owning MPProblem. |
_node | The XML node to parse. |
Robot::Robot | ( | MPProblem *const | _p, |
std::unique_ptr< MultiBody > && | _mb, | ||
const std::string & | _label | ||
) |
Construct a robot from a multibody.
_p | The owning MPProblem. |
_label | The unique label for this robot. |
|
protected |
Parse an XML robot file.
_filename | The file name. |
|
protected |
Parse an XML robot node.
_node | The SML node. |
|
protected |
Parse multibody information from robot's XML file.
_node | The XML node to parse |
|
protected |
Parse a multibody file describing this robot.
_filename | The file name. |
void Robot::Step | ( | const double | _dt | ) |
Execute a simulation step: update the percept model, have the agent make a decision, and send the resulting controls to the actuators.
_dt | The timestep length. |
|
noexcept |
Access the robot's simulation model. This is owned by the simulation engine.
void Robot::SetSimulationModel | ( | BulletModel *const | _m | ) |
Set the robot's simulation model (should only happen in the main bullet engine).
|
noexcept |
Get actuator using label
_label | Label of actuator to retrieve |
|
noexcept |
Check if this is a 'virtual' robot. These do not represent physical robots, and will be ignored by other robots in collision detection. Virtual robots will not appear in simulations.
|
noexcept |
Set the robot's virtual flag.
_v | The new value for the virtual flag. |