BipedalLocomotion::RobotInterface::IRobotControl class

Robot control interface.

Derived classes

class YarpRobotControl
YarpRobotControl Yarp implementation of the IRobotControl interface.

Public types

enum class ControlMode { Position, PositionDirect, Velocity, Torque, PWM, Current, Idle, Unknown }
ControlMode contains the supported control mode.
using unique_ptr = std::unique_ptr<IRobotControl>
using shared_ptr = std::shared_ptr<IRobotControl>
using weak_ptr = std::weak_ptr<IRobotControl>

Constructors, destructors, conversion operators

~IRobotControl() defaulted virtual
Destructor.

Public functions

auto initialize(std::weak_ptr<ParametersHandler::IParametersHandler> handler) -> bool virtual
Initialize the Interface.
auto checkMotionDone(bool& motionDone, bool& isTimerExpired, std::vector<std::pair<std::string, double>>& info) -> bool pure virtual
Check if the motion set through the position control mode ended.
auto setReferences(Eigen::Ref<const Eigen::VectorXd> jointValues, const std::vector<IRobotControl::ControlMode>& controlModes) -> bool pure virtual
Set the desired reference.
auto setReferences(Eigen::Ref<const Eigen::VectorXd> desiredJointValues, const IRobotControl::ControlMode& controlMode) -> bool pure virtual
Set the desired reference.
auto setControlMode(const std::vector<IRobotControl::ControlMode>& controlModes) -> bool pure virtual
Set the control mode.
auto setControlMode(const IRobotControl::ControlMode& mode) -> bool pure virtual
Set the desired control mode.
auto getJointList() const -> std::vector<std::string> pure virtual
Get the list of the controlled joints.
auto isValid() const -> bool pure virtual
Check if the class is valid.

Function documentation

bool BipedalLocomotion::RobotInterface::IRobotControl::initialize(std::weak_ptr<ParametersHandler::IParametersHandler> handler) virtual

Initialize the Interface.

Parameters
handler pointer to a parameter handler interface
Returns True/False in case of success/failure.

bool BipedalLocomotion::RobotInterface::IRobotControl::checkMotionDone(bool& motionDone, bool& isTimerExpired, std::vector<std::pair<std::string, double>>& info) pure virtual

Check if the motion set through the position control mode ended.

Parameters
motionDone out true if the motion ended.
isTimerExpired out true if the internal timer is expired or not.
info out vector containing the list of the joint whose motion did not finish yet.
Returns True/False in case of success/failure.

bool BipedalLocomotion::RobotInterface::IRobotControl::setReferences(Eigen::Ref<const Eigen::VectorXd> jointValues, const std::vector<IRobotControl::ControlMode>& controlModes) pure virtual

Set the desired reference.

Parameters
jointValues desired joint values.
controlModes vector containing the control mode for each joint.
Returns True/False in case of success/failure.

bool BipedalLocomotion::RobotInterface::IRobotControl::setReferences(Eigen::Ref<const Eigen::VectorXd> desiredJointValues, const IRobotControl::ControlMode& controlMode) pure virtual

Set the desired reference.

Parameters
desiredJointValues
controlMode a control mode for all the joints.
Returns True/False in case of success/failure.

bool BipedalLocomotion::RobotInterface::IRobotControl::setControlMode(const std::vector<IRobotControl::ControlMode>& controlModes) pure virtual

Set the control mode.

Parameters
controlModes vector containing the control mode for each joint.
Returns True/False in case of success/failure.

bool BipedalLocomotion::RobotInterface::IRobotControl::setControlMode(const IRobotControl::ControlMode& mode) pure virtual

Set the desired control mode.

Returns True/False in case of success/failure.

std::vector<std::string> BipedalLocomotion::RobotInterface::IRobotControl::getJointList() const pure virtual

Get the list of the controlled joints.

Returns A vector containing the name of the controlled joints.

bool BipedalLocomotion::RobotInterface::IRobotControl::isValid() const pure virtual

Check if the class is valid.

Returns True if it is valid, false otherwise.