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> desiredJointValues, const std::vector<IRobotControl::ControlMode>& controlModes, std::optional<Eigen::Ref<const Eigen::VectorXd>> currentJointValues = {}) -> bool pure virtual
Set the desired reference.
auto setReferences(Eigen::Ref<const Eigen::VectorXd> desiredJointValues, const IRobotControl::ControlMode& controlMode, std::optional<Eigen::Ref<const Eigen::VectorXd>> currentJointValues = {}) -> 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 setControlModeAsync(const std::vector<IRobotControl::ControlMode>& controlModes) -> std::future<bool> pure virtual
Set the control mode in an asynchronous thread.
auto setControlModeAsync(const IRobotControl::ControlMode& mode) -> std::future<bool> pure virtual
Set the desired control mode in an asynchronous thread.
auto getJointList() const -> std::vector<std::string> pure virtual
Get the list of the controlled joints.
auto getJointLimits(Eigen::Ref<Eigen::VectorXd> lowerLimits, Eigen::Ref<Eigen::VectorXd> upperLimits) const -> bool pure virtual
Get the actuated joints limits.
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> desiredJointValues, const std::vector<IRobotControl::ControlMode>& controlModes, std::optional<Eigen::Ref<const Eigen::VectorXd>> currentJointValues = {}) pure virtual

Set the desired reference.

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

bool BipedalLocomotion::RobotInterface::IRobotControl::setReferences(Eigen::Ref<const Eigen::VectorXd> desiredJointValues, const IRobotControl::ControlMode& controlMode, std::optional<Eigen::Ref<const Eigen::VectorXd>> currentJointValues = {}) pure virtual

Set the desired reference.

Parameters
desiredJointValues desired joint values.
controlMode a control mode for all the joints.
currentJointValues current joint values.
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::future<bool> BipedalLocomotion::RobotInterface::IRobotControl::setControlModeAsync(const std::vector<IRobotControl::ControlMode>& controlModes) pure virtual

Set the control mode in an asynchronous thread.

Parameters
controlModes vector containing the control mode for each joint.
Returns An std::future object to a boolean True/False in case of success/failure.

std::future<bool> BipedalLocomotion::RobotInterface::IRobotControl::setControlModeAsync(const IRobotControl::ControlMode& mode) pure virtual

Set the desired control mode in an asynchronous thread.

Returns An std::future object to a boolean 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::getJointLimits(Eigen::Ref<Eigen::VectorXd> lowerLimits, Eigen::Ref<Eigen::VectorXd> upperLimits) const pure virtual

Get the actuated joints limits.

Parameters
lowerLimits vector to be filled with the lower limits of the actuated joints.
upperLimits vector to be filled with the upper limits of the actuated joints.
Returns True/False in case of success/failure.

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

Check if the class is valid.

Returns True if it is valid, false otherwise.