Parasol Planning Library (PPL)
|
#include <Actuator.h>
Public Types | |
Local Types | |
enum class | DynamicsType { Force , Velocity } |
Public Member Functions | |
Construction | |
Actuator (Robot *const _r, const std::string &_label, const DynamicsType _t=DynamicsType::Force) | |
Actuator (Robot *const _r, XMLNode &_node) | |
Actuator (Robot *const _r, const Actuator &_a) | |
Properties | |
Robot * | GetRobot () const |
Get the robot that the actuator is on. More... | |
std::string | GetLabel () const |
Get the label for this actuator. More... | |
DynamicsType | GetDynamicsType () const |
Get the type of output this actuator produces. More... | |
void | SetLimits (const std::vector< double > &_min, const std::vector< double > &_max) |
void | SetMaxForce (const double _total) |
Planning Interface | |
std::vector< bool > | ControlMask () const |
std::vector< double > | ComputeOutput (const Control::Signal &_s) const |
Control::Signal | ComputeNearestSignal (const std::vector< double > &_force) const |
Control | GetRandomControl () const noexcept |
Get a random control in this actuator's control space. More... | |
Friends | |
Debug | |
std::ostream & | operator<< (std::ostream &, const Actuator &) |
Print an actuator's state to an ostream. More... | |
Models an actuator on a robot, such as an engine or motor.
Actuators model a means of locomotion for a robot. They accept a control signal and produce a generalized force on one or more of the robot's DOFs. There are limits on the maximum forward/backward force that can be applied to each DOF, and an additional limit on the maximum total force.
The range of all possible controls that an actuator can accept is represented with a ControlSpace.
The actuator is also able to apply a control to the simulated robot with the Execute method.
|
strong |
Actuator::Actuator | ( | Robot *const | _r, |
const std::string & | _label, | ||
const DynamicsType | _t = DynamicsType::Force |
||
) |
Construct an empty actuator for a given robot.
_r | The owning robot. |
_label | The actuator label. |
_t | The dynamics type. |
Construct an actuator for a given robot from an XML input.
_r | The owning robot. |
_node | The XML input node. |
Copy an actuator to another robot.
_r | The robot which will own the new copy. |
_a | The actuator to copy. |
Control::Signal Actuator::ComputeNearestSignal | ( | const std::vector< double > & | _force | ) | const |
Compute the best-match signal to get this actuator to produce a given force.
_force | The desired force in the robot's local frame. |
std::vector< double > Actuator::ComputeOutput | ( | const Control::Signal & | _s | ) | const |
Compute the output (force or velocity) generated by driving the actuator at some fraction of its total power.
_s | The control signal to apply. |
std::vector< bool > Actuator::ControlMask | ( | ) | const |
Get the control mask for this actuator, which indicates the DOFs that it can affect.
Actuator::DynamicsType Actuator::GetDynamicsType | ( | ) | const |
Get the type of output this actuator produces.
std::string Actuator::GetLabel | ( | ) | const |
Get the label for this actuator.
|
noexcept |
Get a random control in this actuator's control space.
Robot * Actuator::GetRobot | ( | ) | const |
Get the robot that the actuator is on.
void Actuator::SetLimits | ( | const std::vector< double > & | _min, |
const std::vector< double > & | _max | ||
) |
Set the minimum and maximum generalized forces that this actuator can apply to any DOF.
_min | The minimum generalized forces. |
_max | The maximum generalized forces. |
void Actuator::SetMaxForce | ( | const double | _total | ) |
Set the maximum total generalized force that this actuator can apply.
_total | The greatest total generalized force that can be applied. |
|
friend |
Print an actuator's state to an ostream.