XBotInterface  2.4.1
XBotInterface provides a generic API to model and control a robot.
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
XBot::RobotInterface Class Referenceabstract

#include <RobotInterface.h>

+ Inheritance diagram for XBot::RobotInterface:
+ Collaboration diagram for XBot::RobotInterface:

Public Types

typedef std::shared_ptr< RobotInterfacePtr
 
typedef std::shared_ptr< const RobotInterfaceConstPtr
 
- Public Types inherited from XBot::XBotInterface
typedef std::shared_ptr< XBotInterfacePtr
 
typedef std::shared_ptr< const XBotInterfaceConstPtr
 

Public Member Functions

 RobotInterface ()
 Default constructor. More...
 
virtual ~RobotInterface ()=default
 
ModelInterfacemodel ()
 Getter for the internal model instance. More...
 
RobotInterfaceoperator= (const RobotInterface &other)=delete
 
 RobotInterface (const RobotInterface &other)=delete
 
virtual double getTime () const =0
 Getter for the time in the robot framework. More...
 
virtual bool isRunning () const =0
 ... More...
 
bool sense (bool sync_model=true, bool sync_references=false)
 Reads the current state of the robot calling sense_internal() and read_sensors() implemented by the derived class. More...
 
bool move ()
 Moves the robot calling the move_internal() implemented by the derived class. More...
 
RobotChainoperator() (const std::string &chain_name)
 Getter for the robot chain with a certain chain_name. More...
 
const RobotChainoperator() (const std::string &chain_name) const
 
RobotChainchain (const std::string &chain_name)
 Getter for the robot chain with a certain chain_name. More...
 
const RobotChainchain (const std::string &chain_name) const
 
RobotChainarm (int arm_id)
 Getter for the standard kinematic group arm: you can quickly access the i-th arm in the order specified in the SRDF. More...
 
const RobotChainarm (int arm_id) const
 
RobotChainleg (int leg_id)
 Getter for the standard kinematic group leg: you can quickly access the i-th leg in the order specified in the SRDF. More...
 
const RobotChainleg (int leg_id) const
 
template<typename... SyncFlags>
bool setReferenceFrom (const ModelInterface &model, SyncFlags... flags)
 Sets the robot references according to a ModelInterface. More...
 
bool setControlMode (const ControlMode &control_mode)
 
virtual bool setControlMode (const std::string &chain_name, const ControlMode &control_mode)
 
bool setControlMode (const std::map< std::string, ControlMode > &control_mode)
 
bool setControlMode (const std::map< int, ControlMode > &control_mode)
 
void getControlMode (std::map< std::string, ControlMode > &control_mode) const
 
void getControlMode (std::map< int, ControlMode > &control_mode) const
 
double getTimestampRx () const
 Get the RX timestamp: it corresponds to the last call to sense() More...
 
double getTimestampTx () const
 Get the TX timestamp: it corresponds to the last call to move() More...
 
bool getJointPosition (Eigen::VectorXd &q) const
 Gets the robot joint positions as an Eigen vector. More...
 
bool getJointPosition (JointIdMap &q) const
 Gets the robot joint positions as a JointIdMap, i.e. More...
 
bool getJointPosition (JointNameMap &q) const
 Gets the robot joint postions as a JointNameMap, i.e. More...
 
bool getMotorPosition (Eigen::VectorXd &q) const
 Gets the robot motor positions as an Eigen vector. More...
 
bool getMotorPosition (JointIdMap &q) const
 Gets the robot motor positions as a JointIdMap, i.e. More...
 
bool getMotorPosition (JointNameMap &q) const
 Gets the robot motor postions as a JointNameMap, i.e. More...
 
bool getJointVelocity (Eigen::VectorXd &qdot) const
 Gets the robot joint velocities as an Eigen vector. More...
 
bool getJointVelocity (JointIdMap &qdot) const
 Gets the robot joint velocities as a JointIdMap, i.e. More...
 
bool getJointVelocity (JointNameMap &qdot) const
 Gets the robot joint velocities as a JointNameMap, i.e. More...
 
bool getMotorVelocity (Eigen::VectorXd &qdot) const
 Gets the robot motor velocities as an Eigen vector. More...
 
bool getMotorVelocity (JointIdMap &qdot) const
 Gets the robot motor velocities as a JointIdMap, i.e. More...
 
bool getMotorVelocity (JointNameMap &qdot) const
 Gets the robot motor velocities as a JointNameMap, i.e. More...
 
bool getJointEffort (Eigen::VectorXd &tau) const
 Gets the robot joint efforts as an Eigen vector. More...
 
bool getJointEffort (JointIdMap &tau) const
 Gets the robot joint efforts as a JointIdMap, i.e. More...
 
bool getJointEffort (JointNameMap &tau) const
 Gets the robot joint efforts as a JointNameMap, i.e. More...
 
bool getTemperature (Eigen::VectorXd &temp) const
 Gets the robot joint temperatures as an Eigen vector. More...
 
bool getTemperature (JointIdMap &temp) const
 Gets the robot joint temperatures as a JointIdMap, i.e. More...
 
bool getTemperature (JointNameMap &temp) const
 Gets the robot joint temperatures as a JointNameMap, i.e. More...
 
bool getPositionReference (Eigen::VectorXd &q) const
 Gets the robot position references as an Eigen vector. More...
 
bool getPositionReference (JointIdMap &q) const
 Gets the robot position references as a JointIdMap, i.e. More...
 
bool getPositionReference (JointNameMap &q) const
 Gets the robot postion references as a JointNameMap, i.e. More...
 
bool getVelocityReference (Eigen::VectorXd &qdot) const
 Gets the robot velocity references as an Eigen vector. More...
 
bool getVelocityReference (JointIdMap &qdot) const
 Gets the robot velocity references as a JointIdMap, i.e. More...
 
bool getVelocityReference (JointNameMap &qdot) const
 Gets the robot velocity references as a JointNameMap, i.e. More...
 
bool getEffortReference (Eigen::VectorXd &tau) const
 Gets the robot effort references as an Eigen vector. More...
 
bool getEffortReference (JointIdMap &tau) const
 Gets the robot effort references as a JointIdMap, i.e. More...
 
bool getEffortReference (JointNameMap &tau) const
 Gets the robot effort references as a JointNameMap, i.e. More...
 
bool getStiffness (Eigen::VectorXd &K) const
 Gets the robot stiffness as an Eigen vector. More...
 
bool getStiffness (JointIdMap &K) const
 Gets the robot stiffness as a JointIdMap, i.e. More...
 
bool getStiffness (JointNameMap &K) const
 Gets the robot stiffness as a JointNameMap, i.e. More...
 
bool getDamping (Eigen::VectorXd &D) const
 Gets the robot damping as an Eigen vector. More...
 
bool getDamping (JointIdMap &D) const
 Gets the robot damping as a JointIdMap, i.e. More...
 
bool getDamping (JointNameMap &D) const
 Gets the robot damping as a JointNameMap, i.e. More...
 
bool setPositionReference (const Eigen::VectorXd &q)
 Sets the XBotInterface internal joint position references according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setPositionReference (const JointIdMap &q)
 Sets the XBotInterface internal joint position references according to the input JointIdMap (i.e. More...
 
bool setPositionReference (const JointNameMap &q)
 Sets the XBotInterface internal joint position references according to the input JointNameMap (i.e. More...
 
bool setVelocityReference (const Eigen::VectorXd &qdot)
 Sets the XBotInterface internal joint velocity references according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setVelocityReference (const JointIdMap &qdot)
 Sets the XBotInterface internal joint velocity references according to the input JointIdMap (i.e. More...
 
bool setVelocityReference (const JointNameMap &qdot)
 Sets the XBotInterface internal joint velocity references according to the input JointNameMap (i.e. More...
 
bool setEffortReference (const Eigen::VectorXd &tau)
 Sets the XBotInterface internal joint effort references according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setEffortReference (const JointIdMap &tau)
 Sets the XBotInterface internal joint effort references according to the input JointIdMap (i.e. More...
 
bool setEffortReference (const JointNameMap &tau)
 Sets the XBotInterface internal joint effort references according to the input JointNameMap (i.e. More...
 
bool setStiffness (const Eigen::VectorXd &K)
 Sets the XBotInterface internal joint stiffness according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setStiffness (const JointIdMap &K)
 Sets the XBotInterface internal joint stiffness according to the input JointIdMap (i.e. More...
 
bool setStiffness (const JointNameMap &K)
 Sets the XBotInterface internal joint stiffness according to the input JointNameMap (i.e. More...
 
bool setDamping (const Eigen::VectorXd &D)
 Sets the XBotInterface internal joint damping according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setDamping (const JointIdMap &D)
 Sets the XBotInterface internal joint damping according to the input JointIdMap (i.e. More...
 
bool setDamping (const JointNameMap &D)
 Sets the XBotInterface internal joint damping according to the input JointNameMap (i.e. More...
 
- Public Member Functions inherited from XBot::XBotInterface
 XBotInterface ()
 
 XBotInterface (const XBotInterface &other)
 
XBotInterfaceoperator= (const XBotInterface &rhs)
 
virtual ~XBotInterface ()
 
bool init (const std::string &path_to_cfg)
 
bool init (const ConfigOptions &options)
 
const ConfigOptionsgetConfigOptions () const
 Gets the configuration struct that has been used to build the XBotInterface. More...
 
const std::string & getPathToConfig () const
 Gets the path to the YAML config file used to build the XBotInterface. More...
 
const urdf::ModelInterface & getUrdf () const
 Getter for the robot URDF model corresponding to the URDF xml file specified in the YAML config file. More...
 
const std::string & getUrdfPath () const
 getUrdfPath Getter for the path to the URDF model More...
 
const srdf_advr::Model & getSrdf () const
 Getter fot the robot SRDF model corresponding to the SRDF xml file specified in the YAML config file. More...
 
const std::string & getSrdfPath () const
 getSrdfPath Getter for the path to the SRDF model More...
 
const std::string & getUrdfString () const
 Returns the robot URDF xml as a string. More...
 
const std::string & getSrdfString () const
 Returns the robot SRDF xml as a string. More...
 
bool getRobotState (const std::string &state_name, Eigen::VectorXd &q) const
 Gets the robot joints group state configuration as specified in the robot SRDF. More...
 
bool getRobotState (const std::string &state_name, JointIdMap &q) const
 Gets the robot joints group state configuration as specified in the robot SRDF. More...
 
bool getRobotState (const std::string &state_name, JointNameMap &q) const
 Gets the robot joints group state configuration as specified in the robot SRDF. More...
 
std::vector< std::string > getChainNames () const
 Return a vector of available chain names as strings. More...
 
bool hasChain (const std::string &chain_name) const
 A method for determining if a chain with name "chain_name" is defined inside the interface. More...
 
int legs () const
 Returns the number of legs defined inside the interface. More...
 
int arms () const
 Returns the number of arms defined inside the interface. More...
 
const std::vector< std::string > & getEnabledJointNames () const
 Returns a vector of enabled joint names. More...
 
const std::vector< int > & getEnabledJointId () const
 Returns a vector of enabled joint IDs. More...
 
bool hasJoint (const std::string &joint_name) const
 Checks that a joint with name "joint_name" is defined as an enabled joint inside the interface. More...
 
bool hasJoint (int joint_id) const
 Checks that a joint with ID "joint_id" is defined as an enabled joint inside the interface. More...
 
int getJointNum () const
 Getter for the number of enabled joints. More...
 
XBot::Joint::ConstPtr getJointByName (const std::string &joint_name) const
 Gets the joint with name "joint_name" if it is defined as enabled. More...
 
XBot::Joint::ConstPtr getJointByID (int joint_id) const
 Gets the joint with ID "joint_id" if it is defined as enabled. More...
 
XBot::Joint::ConstPtr getJointByDofIndex (int idx) const
 Gets the joint with the required dof index. More...
 
int getDofIndex (const std::string &joint_name) const
 Gets the Eigen ID of the joint with name "joint_name". More...
 
int getDofIndex (int joint_id) const
 Gets the Eigen ID of the joint with ID "joint_id". More...
 
bool getDofIndex (const std::string &chain_name, std::vector< int > &ids) const
 Gets dof indices of all joints inside chain "chain_name". More...
 
void initLog (MatLogger2::Ptr logger, int buffer_size=-1, int interleave=1, std::string prefix="")
 Pre-allocates memory for logging the robot state to a mat file. More...
 
void log (MatLogger2::Ptr logger, double timestamp, const std::string &prefix="") const
 Logs the current robot state. More...
 
std::map< std::string, ForceTorqueSensor::ConstPtrgetForceTorque () const
 Getter for the force-torque sensor map pertaining to the whole robot. More...
 
ForceTorqueSensor::ConstPtr getForceTorque (const std::string &parent_link_name) const
 Returns a force-torque sensor given its parent-link name. More...
 
ForceTorqueSensor::ConstPtr getForceTorque (int ft_id) const
 Returns a force-torque sensor given its sensor ID. More...
 
std::map< std::string, ImuSensor::ConstPtrgetImu ()
 Getter for the IMU sensor map pertaining to the chain. More...
 
ImuSensor::ConstPtr getImu (const std::string &parent_link_name) const
 Returns an IMU sensor given its parent-link name. More...
 
ImuSensor::ConstPtr getImu (int imu_id) const
 Returns an IMU sensor given its sensor ID. More...
 
std::map< std::string, Hand::PtrgetHand ()
 Getter for the hands map pertaining to the whole robot. More...
 
Hand::Ptr getHand (int hand_id) const
 Returns a hand given its hand ID. More...
 
bool eigenToMap (const Eigen::VectorXd &vector, JointNameMap &name_map) const
 Converts a state vector for the whole robot to its JointNameMap representation. More...
 
bool eigenToMap (const Eigen::VectorXd &vector, JointIdMap &id_map) const
 Converts a state vector for the whole robot to its JointIdMap representation. More...
 
bool mapToEigen (const JointNameMap &map, Eigen::VectorXd &vector) const
 Converts a state vector for an arbitrary subset of the robot state (specified as a JointNameMap) to its Eigen representation. More...
 
bool mapToEigen (const JointIdMap &map, Eigen::VectorXd &vector) const
 Converts a state vector for an arbitrary subset of the robot state (specified as a JointIdMap) to its Eigen representation. More...
 
bool getJointPosition (Eigen::VectorXd &q) const
 Gets the robot joint positions as an Eigen vector. More...
 
bool getMotorPosition (Eigen::VectorXd &q) const
 Gets the robot motor positions as an Eigen vector. More...
 
bool getJointVelocity (Eigen::VectorXd &qdot) const
 Gets the robot joint velocities as an Eigen vector. More...
 
bool getMotorVelocity (Eigen::VectorXd &qdot) const
 Gets the robot motor velocities as an Eigen vector. More...
 
bool getJointAcceleration (Eigen::VectorXd &qddot) const
 Gets the robot joint accelerations as an Eigen vector. More...
 
bool getJointEffort (Eigen::VectorXd &tau) const
 Gets the robot joint efforts as an Eigen vector. More...
 
bool getTemperature (Eigen::VectorXd &temp) const
 Gets the robot joint temperatures as an Eigen vector. More...
 
bool getJointPosition (JointIdMap &q) const
 Gets the robot joint positions as a JointIdMap, i.e. More...
 
bool getMotorPosition (JointIdMap &q) const
 Gets the robot motor positions as a JointIdMap, i.e. More...
 
bool getJointVelocity (JointIdMap &qdot) const
 Gets the robot joint velocities as a JointIdMap, i.e. More...
 
bool getMotorVelocity (JointIdMap &qdot) const
 Gets the robot motor velocities as a JointIdMap, i.e. More...
 
bool getJointAcceleration (JointIdMap &qddot) const
 Gets the robot joint accelerations as a JointIdMap, i.e. More...
 
bool getJointEffort (JointIdMap &tau) const
 Gets the robot joint efforts as a JointIdMap, i.e. More...
 
bool getTemperature (JointIdMap &temp) const
 Gets the robot joint temperatures as a JointIdMap, i.e. More...
 
bool getJointPosition (JointNameMap &q) const
 Gets the robot joint postions as a JointNameMap, i.e. More...
 
bool getMotorPosition (JointNameMap &q) const
 Gets the robot motor postions as a JointNameMap, i.e. More...
 
bool getJointVelocity (JointNameMap &qdot) const
 Gets the robot joint velocities as a JointNameMap, i.e. More...
 
bool getMotorVelocity (JointNameMap &qdot) const
 Gets the robot motor velocities as a JointNameMap, i.e. More...
 
bool getJointAcceleration (JointNameMap &qddot) const
 Gets the robot joint accelerations as a JointNameMap, i.e. More...
 
bool getJointEffort (JointNameMap &tau) const
 Gets the robot joint efforts as a JointNameMap, i.e. More...
 
bool getTemperature (JointNameMap &temp) const
 Gets the robot joint temperatures as a JointNameMap, i.e. More...
 
bool setJointPosition (const Eigen::VectorXd &q)
 Sets the XBotInterface internal joint positions according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setMotorPosition (const Eigen::VectorXd &q)
 Sets the XBotInterface internal motor positions according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setJointVelocity (const Eigen::VectorXd &qdot)
 Sets the XBotInterface internal joint velocities according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setMotorVelocity (const Eigen::VectorXd &qdot)
 Sets the XBotInterface internal motor velocities according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setJointAcceleration (const Eigen::VectorXd &qddot)
 Sets the XBotInterface internal joint accelerations according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setJointEffort (const Eigen::VectorXd &tau)
 Sets the XBotInterface internal joint efforts according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setTemperature (const Eigen::VectorXd &temp)
 Sets the XBotInterface internal joint temperatures according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setJointPosition (const JointIdMap &q)
 Sets the XBotInterface internal joint positions according to the input JointIdMap (i.e. More...
 
bool setMotorPosition (const JointIdMap &q)
 Sets the XBotInterface internal motor positions according to the input JointIdMap (i.e. More...
 
bool setJointVelocity (const JointIdMap &qdot)
 Sets the XBotInterface internal joint velocities according to the input JointIdMap (i.e. More...
 
bool setMotorVelocity (const JointIdMap &qdot)
 Sets the XBotInterface internal motor velocities according to the input JointIdMap (i.e. More...
 
bool setJointAcceleration (const JointIdMap &qddot)
 Sets the XBotInterface internal joint accelerations according to the input JointIdMap (i.e. More...
 
bool setJointEffort (const JointIdMap &tau)
 Sets the XBotInterface internal joint efforts according to the input JointIdMap (i.e. More...
 
bool setTemperature (const JointIdMap &temp)
 Sets the XBotInterface internal motor temperatures according to the input JointIdMap (i.e. More...
 
bool setJointPosition (const JointNameMap &q)
 Sets the XBotInterface internal joint positions according to the input JointNameMap (i.e. More...
 
bool setMotorPosition (const JointNameMap &q)
 Sets the XBotInterface internal motor positions according to the input JointNameMap (i.e. More...
 
bool setJointVelocity (const JointNameMap &qdot)
 Sets the XBotInterface internal joint velocities according to the input JointNameMap (i.e. More...
 
bool setMotorVelocity (const JointNameMap &qdot)
 Sets the XBotInterface internal motor velocities according to the input JointNameMap (i.e. More...
 
bool setJointAcceleration (const JointNameMap &qddot)
 Sets the XBotInterface internal joint accelerations according to the input JointNameMap (i.e. More...
 
bool setJointEffort (const JointNameMap &tau)
 Sets the XBotInterface internal joint efforts according to the input JointNameMap (i.e. More...
 
bool setTemperature (const JointNameMap &temp)
 Sets the XBotInterface internal joint temperatures according to the input JointNameMap (i.e. More...
 
bool getPositionReference (Eigen::VectorXd &q) const
 Gets the robot position references as an Eigen vector. More...
 
bool getVelocityReference (Eigen::VectorXd &qdot) const
 Gets the robot velocity references as an Eigen vector. More...
 
bool getEffortReference (Eigen::VectorXd &tau) const
 Gets the robot effort references as an Eigen vector. More...
 
bool getStiffness (Eigen::VectorXd &K) const
 Gets the robot stiffness as an Eigen vector. More...
 
bool getDamping (Eigen::VectorXd &D) const
 Gets the robot damping as an Eigen vector. More...
 
bool getPositionReference (JointIdMap &q) const
 Gets the robot position references as a JointIdMap, i.e. More...
 
bool getVelocityReference (JointIdMap &qdot) const
 Gets the robot velocity references as a JointIdMap, i.e. More...
 
bool getEffortReference (JointIdMap &tau) const
 Gets the robot effort references as a JointIdMap, i.e. More...
 
bool getStiffness (JointIdMap &K) const
 Gets the robot stiffness as a JointIdMap, i.e. More...
 
bool getDamping (JointIdMap &D) const
 Gets the robot damping as a JointIdMap, i.e. More...
 
bool getPositionReference (JointNameMap &q) const
 Gets the robot postion references as a JointNameMap, i.e. More...
 
bool getVelocityReference (JointNameMap &qdot) const
 Gets the robot velocity references as a JointNameMap, i.e. More...
 
bool getEffortReference (JointNameMap &tau) const
 Gets the robot effort references as a JointNameMap, i.e. More...
 
bool getStiffness (JointNameMap &K) const
 Gets the robot stiffness as a JointNameMap, i.e. More...
 
bool getDamping (JointNameMap &D) const
 Gets the robot damping as a JointNameMap, i.e. More...
 
bool setPositionReference (const Eigen::VectorXd &q)
 Sets the XBotInterface internal joint position references according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setVelocityReference (const Eigen::VectorXd &qdot)
 Sets the XBotInterface internal joint velocity references according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setEffortReference (const Eigen::VectorXd &tau)
 Sets the XBotInterface internal joint effort references according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setStiffness (const Eigen::VectorXd &K)
 Sets the XBotInterface internal joint stiffness according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setDamping (const Eigen::VectorXd &D)
 Sets the XBotInterface internal joint damping according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setPositionReference (const JointIdMap &q)
 Sets the XBotInterface internal joint position references according to the input JointIdMap (i.e. More...
 
bool setVelocityReference (const JointIdMap &qdot)
 Sets the XBotInterface internal joint velocity references according to the input JointIdMap (i.e. More...
 
bool setEffortReference (const JointIdMap &tau)
 Sets the XBotInterface internal joint effort references according to the input JointIdMap (i.e. More...
 
bool setStiffness (const JointIdMap &K)
 Sets the XBotInterface internal joint stiffness according to the input JointIdMap (i.e. More...
 
bool setDamping (const JointIdMap &D)
 Sets the XBotInterface internal joint damping according to the input JointIdMap (i.e. More...
 
bool setPositionReference (const JointNameMap &q)
 Sets the XBotInterface internal joint position references according to the input JointNameMap (i.e. More...
 
bool setVelocityReference (const JointNameMap &qdot)
 Sets the XBotInterface internal joint velocity references according to the input JointNameMap (i.e. More...
 
bool setEffortReference (const JointNameMap &tau)
 Sets the XBotInterface internal joint effort references according to the input JointNameMap (i.e. More...
 
bool setStiffness (const JointNameMap &K)
 Sets the XBotInterface internal joint stiffness according to the input JointNameMap (i.e. More...
 
bool setDamping (const JointNameMap &D)
 Sets the XBotInterface internal joint damping according to the input JointNameMap (i.e. More...
 
void getJointLimits (Eigen::VectorXd &q_min, Eigen::VectorXd &q_max) const
 Gets a vector of the robot joint limits, as specified in the URDF file. More...
 
void getVelocityLimits (Eigen::VectorXd &qdot_max) const
 Gets a vector of the robot joint velocity limits, as specified in the URDF file. More...
 
void getEffortLimits (Eigen::VectorXd &tau_max) const
 Gets a vector of the robot joint effort limits, as specified in the URDF file. More...
 
bool checkJointLimits (const Eigen::VectorXd &q, std::vector< std::string > &violating_joints) const
 Check the input joint position vector against joint limits. More...
 
bool checkVelocityLimits (const Eigen::VectorXd &qdot, std::vector< std::string > &violating_joints) const
 Check the input joint velocity vector against joint limits. More...
 
bool checkEffortLimits (const Eigen::VectorXd &tau, std::vector< std::string > &violating_joints) const
 Check the input joint effort vector against joint limits. More...
 
bool checkJointLimits (const Eigen::VectorXd &q) const
 Check the input joint position vector against joint limits. More...
 
bool checkVelocityLimits (const Eigen::VectorXd &qdot) const
 Check the input joint velocity vector against joint limits. More...
 
bool checkEffortLimits (const Eigen::VectorXd &tau) const
 Check the input joint effort vector against joint limits. More...
 
bool enforceJointLimits (JointIdMap &q) const
 Modifies the input joint position map by enforcing joint limits. More...
 
bool enforceJointLimits (JointNameMap &q) const
 Modifies the input joint position map by enforcing joint limits. More...
 
bool enforceJointLimits (Eigen::VectorXd &q) const
 Modifies the input joint position vector by enforcing joint limits. More...
 
bool enforceEffortLimit (Eigen::VectorXd &tau) const
 Modifies the input joint effort vector by enforcing effort limits. More...
 
bool enforceVelocityLimit (Eigen::VectorXd &qdot) const
 Modifies the input joint velcoity vector by enforcing joint limits. More...
 
template<typename... SyncFlags>
bool sync (const XBotInterface &other, SyncFlags... flags)
 Synchronize the current XBotInterface with another XBotInterface object: only the common chains will be taken into account. More...
 
const std::map< std::string, XBot::KinematicChain::Ptr > & getChainMap () const
 Getter for the chain map inside the XBotInterface. More...
 
void print () const
 Print a pretty table about the robot state. More...
 
void printTracking () const
 Print a pretty table about the robot tracking. More...
 

Static Public Member Functions

static void clearRobotMap (void)
 
static RobotInterface::Ptr getRobot (const ConfigOptions &config, const std::string &robot_name="")
 ... More...
 
static RobotInterface::Ptr getRobot (const std::string &path_to_cfg, const std::string &robot_name="", AnyMapConstPtr any_map=AnyMapConstPtr(), const std::string &framework="")
 Getter for the robot singleton. More...
 

Protected Member Functions

virtual bool post_init ()
 
virtual bool sense_internal (bool sync_references)=0
 
virtual bool read_sensors ()=0
 
virtual bool sense_hands ()=0
 
virtual bool move_internal ()=0
 
virtual bool move_hands ()=0
 
virtual bool init_robot (const ConfigOptions &config)=0
 
virtual bool set_control_mode_internal (int joint_id, const ControlMode &control_mode)
 
bool setJointPosition (const Eigen::VectorXd &q)
 Sets the XBotInterface internal joint positions according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setJointPosition (const JointIdMap &q)
 Sets the XBotInterface internal joint positions according to the input JointIdMap (i.e. More...
 
bool setJointPosition (const JointNameMap &q)
 Sets the XBotInterface internal joint positions according to the input JointNameMap (i.e. More...
 
bool setMotorPosition (const Eigen::VectorXd &q)
 Sets the XBotInterface internal motor positions according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setMotorPosition (const JointIdMap &q)
 Sets the XBotInterface internal motor positions according to the input JointIdMap (i.e. More...
 
bool setMotorPosition (const JointNameMap &q)
 Sets the XBotInterface internal motor positions according to the input JointNameMap (i.e. More...
 
bool setJointVelocity (const Eigen::VectorXd &qdot)
 Sets the XBotInterface internal joint velocities according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setJointVelocity (const JointIdMap &qdot)
 Sets the XBotInterface internal joint velocities according to the input JointIdMap (i.e. More...
 
bool setJointVelocity (const JointNameMap &qdot)
 Sets the XBotInterface internal joint velocities according to the input JointNameMap (i.e. More...
 
bool setMotorVelocity (const Eigen::VectorXd &qdot)
 Sets the XBotInterface internal motor velocities according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setMotorVelocity (const JointIdMap &qdot)
 Sets the XBotInterface internal motor velocities according to the input JointIdMap (i.e. More...
 
bool setMotorVelocity (const JointNameMap &qdot)
 Sets the XBotInterface internal motor velocities according to the input JointNameMap (i.e. More...
 
bool setJointEffort (const Eigen::VectorXd &tau)
 Sets the XBotInterface internal joint efforts according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setJointEffort (const JointIdMap &tau)
 Sets the XBotInterface internal joint efforts according to the input JointIdMap (i.e. More...
 
bool setJointEffort (const JointNameMap &tau)
 Sets the XBotInterface internal joint efforts according to the input JointNameMap (i.e. More...
 
bool setTemperature (const Eigen::VectorXd &temp)
 Sets the XBotInterface internal joint temperatures according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setTemperature (const JointIdMap &temp)
 Sets the XBotInterface internal motor temperatures according to the input JointIdMap (i.e. More...
 
bool setTemperature (const JointNameMap &temp)
 Sets the XBotInterface internal joint temperatures according to the input JointNameMap (i.e. More...
 
bool setJointAcceleration (const Eigen::VectorXd &qddot)
 Sets the XBotInterface internal joint accelerations according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods. More...
 
bool setJointAcceleration (const JointIdMap &qddot)
 Sets the XBotInterface internal joint accelerations according to the input JointIdMap (i.e. More...
 
bool setJointAcceleration (const JointNameMap &qddot)
 Sets the XBotInterface internal joint accelerations according to the input JointNameMap (i.e. More...
 
bool getJointAcceleration (Eigen::VectorXd &qddot) const
 Gets the robot joint accelerations as an Eigen vector. More...
 
bool getJointAcceleration (JointIdMap &qddot) const
 Gets the robot joint accelerations as a JointIdMap, i.e. More...
 
bool getJointAcceleration (JointNameMap &qddot) const
 Gets the robot joint accelerations as a JointNameMap, i.e. More...
 
template<typename... SyncFlags>
bool sync (const XBotInterface &other, SyncFlags... flags)
 Synchronize the current XBotInterface with another XBotInterface object: only the common chains will be taken into account. More...
 
const std::map< std::string, XBot::KinematicChain::Ptr > & getChainMap () const
 Getter for the chain map inside the XBotInterface. More...
 
- Protected Member Functions inherited from XBot::XBotInterface
Joint::Ptr getJointByNameInternal (const std::string &joint_name) const
 
Joint::Ptr getJointByIdInternal (int joint_id) const
 
Joint::Ptr getJointByDofIndexInternal (int dof_index) const
 
const std::map< std::string, ForceTorqueSensor::Ptr > & getForceTorqueInternal () const
 
const std::map< std::string, ImuSensor::Ptr > & getImuInternal () const
 
const std::vector< std::string > & getModelOrderedChainName () const
 

Additional Inherited Members

- Protected Attributes inherited from XBot::XBotInterface
XBotCoreModel _XBotModel
 
std::map< std::string, XBot::KinematicChain::Ptr_chain_map
 
std::vector< Joint::Ptr_ordered_joint_vector
 
std::vector< Joint::Ptr_joint_vector
 
std::map< std::string, ForceTorqueSensor::Ptr_ft_map
 
std::map< int, ForceTorqueSensor::Ptr_ft_id_map
 
std::map< std::string, ImuSensor::Ptr_imu_map
 
std::map< int, ImuSensor::Ptr_imu_id_map
 
std::map< std::string, Hand::Ptr_hand_map
 
std::map< int, Hand::Ptr_hand_id_map
 
std::vector< std::string > _ordered_chain_names
 
std::map< int, int > _joint_id_to_eigen_id
 
std::map< std::string, int > _joint_name_to_eigen_id
 

Member Typedef Documentation

◆ ConstPtr

typedef std::shared_ptr<const RobotInterface> XBot::RobotInterface::ConstPtr

◆ Ptr

typedef std::shared_ptr<RobotInterface> XBot::RobotInterface::Ptr

Constructor & Destructor Documentation

◆ RobotInterface() [1/2]

XBot::RobotInterface::RobotInterface ( )

Default constructor.

◆ ~RobotInterface()

virtual XBot::RobotInterface::~RobotInterface ( )
virtualdefault

◆ RobotInterface() [2/2]

XBot::RobotInterface::RobotInterface ( const RobotInterface other)
delete

Member Function Documentation

◆ arm() [1/2]

XBot::RobotChain & XBot::RobotInterface::arm ( int  arm_id)

Getter for the standard kinematic group arm: you can quickly access the i-th arm in the order specified in the SRDF.

Parameters
arm_idthe id of the requested arm (i.e. the index as specifed in the SRDF group
Returns
the arm chain with the requested arm_id

◆ arm() [2/2]

const XBot::RobotChain & XBot::RobotInterface::arm ( int  arm_id) const

◆ chain() [1/2]

XBot::RobotChain & XBot::RobotInterface::chain ( const std::string &  chain_name)

Getter for the robot chain with a certain chain_name.

Parameters
chain_namethe requested chain name
Returns
the robot chain with the requested chain_name

◆ chain() [2/2]

const XBot::RobotChain & XBot::RobotInterface::chain ( const std::string &  chain_name) const

◆ clearRobotMap()

void XBot::RobotInterface::clearRobotMap ( void  )
static

◆ getChainMap()

const std::map< std::string, XBot::KinematicChain::Ptr > & XBot::XBotInterface::getChainMap
protected

Getter for the chain map inside the XBotInterface.

Returns
the chain map inside the XBotInterface

◆ getControlMode() [1/2]

void XBot::RobotInterface::getControlMode ( std::map< int, ControlMode > &  control_mode) const

◆ getControlMode() [2/2]

void XBot::RobotInterface::getControlMode ( std::map< std::string, ControlMode > &  control_mode) const

◆ getDamping() [1/3]

bool XBot::XBotInterface::getDamping

Gets the robot damping as an Eigen vector.

The joint order inside the vector can be queried by calling the getEnabledJointNames/getEnabledJointId methods.

Parameters
DA reference to an Eigen vector to be filled with the requested joint state. If the provided vector has wrong size it is resized automatically.
Returns
bool

◆ getDamping() [2/3]

bool XBot::XBotInterface::getDamping

Gets the robot damping as a JointIdMap, i.e.

a map whose key represents the joint ID and whose value represents the required joint state.

Parameters
DA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getDamping() [3/3]

bool XBot::XBotInterface::getDamping

Gets the robot damping as a JointNameMap, i.e.

a map whose key represents the joint human-readable name and whose value represents the required joint state.

Parameters
DA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getEffortReference() [1/3]

bool XBot::XBotInterface::getEffortReference

Gets the robot effort references as an Eigen vector.

The joint order inside the vector can be queried by calling the getEnabledJointNames/getEnabledJointId methods.

Parameters
tauA reference to an Eigen vector to be filled with the requested joint state. If the provided vector has wrong size it is resized automatically.
Returns
bool

◆ getEffortReference() [2/3]

bool XBot::XBotInterface::getEffortReference

Gets the robot effort references as a JointIdMap, i.e.

a map whose key represents the joint ID and whose value represents the required joint state.

Parameters
tauA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getEffortReference() [3/3]

bool XBot::XBotInterface::getEffortReference

Gets the robot effort references as a JointNameMap, i.e.

a map whose key represents the joint human-readable name and whose value represents the required joint state.

Parameters
tauA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getJointAcceleration() [1/3]

bool XBot::XBotInterface::getJointAcceleration
protected

Gets the robot joint accelerations as an Eigen vector.

The joint order inside the vector can be queried by calling the getEnabledJointNames/getEnabledJointId methods.

Parameters
qddotA reference to an Eigen vector to be filled with the requested joint state. If the provided vector has wrong size it is resized automatically.
Returns
bool

◆ getJointAcceleration() [2/3]

bool XBot::XBotInterface::getJointAcceleration
protected

Gets the robot joint accelerations as a JointIdMap, i.e.

a map whose key represents the joint ID and whose value represents the required joint state.

Parameters
qddotA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getJointAcceleration() [3/3]

bool XBot::XBotInterface::getJointAcceleration
protected

Gets the robot joint accelerations as a JointNameMap, i.e.

a map whose key represents the joint human-readable name and whose value represents the required joint state.

Parameters
qddotA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getJointEffort() [1/3]

bool XBot::XBotInterface::getJointEffort

Gets the robot joint efforts as an Eigen vector.

The joint order inside the vector can be queried by calling the getEnabledJointNames/getEnabledJointId methods.

Parameters
tauA reference to an Eigen vector to be filled with the requested joint state. If the provided vector has wrong size it is resized automatically.
Returns
bool

◆ getJointEffort() [2/3]

bool XBot::XBotInterface::getJointEffort

Gets the robot joint efforts as a JointIdMap, i.e.

a map whose key represents the joint ID and whose value represents the required joint state.

Parameters
tauA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getJointEffort() [3/3]

bool XBot::XBotInterface::getJointEffort

Gets the robot joint efforts as a JointNameMap, i.e.

a map whose key represents the joint human-readable name and whose value represents the required joint state.

Parameters
tauA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getJointPosition() [1/3]

bool XBot::XBotInterface::getJointPosition

Gets the robot joint positions as an Eigen vector.

The joint order inside the vector can be queried by calling the getEnabledJointNames/getEnabledJointId methods.

Parameters
qA reference to an Eigen vector to be filled with the requested joint state. If the provided vector has wrong size it is resized automatically.
Returns
bool

◆ getJointPosition() [2/3]

bool XBot::XBotInterface::getJointPosition

Gets the robot joint positions as a JointIdMap, i.e.

a map whose key represents the joint ID and whose value represents the required joint state.

Parameters
qA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getJointPosition() [3/3]

bool XBot::XBotInterface::getJointPosition

Gets the robot joint postions as a JointNameMap, i.e.

a map whose key represents the joint human-readable name and whose value represents the required joint state.

Parameters
qA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getJointVelocity() [1/3]

bool XBot::XBotInterface::getJointVelocity

Gets the robot joint velocities as an Eigen vector.

The joint order inside the vector can be queried by calling the getEnabledJointNames/getEnabledJointId methods.

Parameters
qdotA reference to an Eigen vector to be filled with the requested joint state. If the provided vector has wrong size it is resized automatically.
Returns
bool

◆ getJointVelocity() [2/3]

bool XBot::XBotInterface::getJointVelocity

Gets the robot joint velocities as a JointIdMap, i.e.

a map whose key represents the joint ID and whose value represents the required joint state.

Parameters
qdotA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getJointVelocity() [3/3]

bool XBot::XBotInterface::getJointVelocity

Gets the robot joint velocities as a JointNameMap, i.e.

a map whose key represents the joint human-readable name and whose value represents the required joint state.

Parameters
qdotA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getMotorPosition() [1/3]

bool XBot::XBotInterface::getMotorPosition

Gets the robot motor positions as an Eigen vector.

The joint order inside the vector can be queried by calling the getEnabledJointNames/getEnabledJointId methods.

Parameters
qA reference to an Eigen vector to be filled with the requested joint state. If the provided vector has wrong size it is resized automatically.
Returns
bool

◆ getMotorPosition() [2/3]

bool XBot::XBotInterface::getMotorPosition

Gets the robot motor positions as a JointIdMap, i.e.

a map whose key represents the joint ID and whose value represents the required joint state.

Parameters
qA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getMotorPosition() [3/3]

bool XBot::XBotInterface::getMotorPosition

Gets the robot motor postions as a JointNameMap, i.e.

a map whose key represents the joint human-readable name and whose value represents the required joint state.

Parameters
qA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getMotorVelocity() [1/3]

bool XBot::XBotInterface::getMotorVelocity

Gets the robot motor velocities as an Eigen vector.

The joint order inside the vector can be queried by calling the getEnabledJointNames/getEnabledJointId methods.

Parameters
qdotA reference to an Eigen vector to be filled with the requested joint state. If the provided vector has wrong size it is resized automatically.
Returns
bool

◆ getMotorVelocity() [2/3]

bool XBot::XBotInterface::getMotorVelocity

Gets the robot motor velocities as a JointIdMap, i.e.

a map whose key represents the joint ID and whose value represents the required joint state.

Parameters
qdotA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getMotorVelocity() [3/3]

bool XBot::XBotInterface::getMotorVelocity

Gets the robot motor velocities as a JointNameMap, i.e.

a map whose key represents the joint human-readable name and whose value represents the required joint state.

Parameters
qdotA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getPositionReference() [1/3]

bool XBot::XBotInterface::getPositionReference

Gets the robot position references as an Eigen vector.

The joint order inside the vector can be queried by calling the getEnabledJointNames/getEnabledJointId methods.

Parameters
qA reference to an Eigen vector to be filled with the requested joint state. If the provided vector has wrong size it is resized automatically.
Returns
bool

◆ getPositionReference() [2/3]

bool XBot::XBotInterface::getPositionReference

Gets the robot position references as a JointIdMap, i.e.

a map whose key represents the joint ID and whose value represents the required joint state.

Parameters
qA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getPositionReference() [3/3]

bool XBot::XBotInterface::getPositionReference

Gets the robot postion references as a JointNameMap, i.e.

a map whose key represents the joint human-readable name and whose value represents the required joint state.

Parameters
qA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getRobot() [1/2]

XBot::RobotInterface::Ptr XBot::RobotInterface::getRobot ( const ConfigOptions config,
const std::string &  robot_name = "" 
)
static

...

Parameters
config...
robot_name...
Returns
XBot::RobotInterface::Ptr

◆ getRobot() [2/2]

XBot::RobotInterface::Ptr XBot::RobotInterface::getRobot ( const std::string &  path_to_cfg,
const std::string &  robot_name = "",
AnyMapConstPtr  any_map = AnyMapConstPtr(),
const std::string &  framework = "" 
)
static

Getter for the robot singleton.

Parameters
path_to_cfgpath to the config file where the robot parameters(e.g. control framework, internal model ...) are specified
any_mapa map with objects needed by RobotInterface actual implementations
Returns
a shared pointer to the RobotInterface instance

◆ getStiffness() [1/3]

bool XBot::XBotInterface::getStiffness

Gets the robot stiffness as an Eigen vector.

The joint order inside the vector can be queried by calling the getEnabledJointNames/getEnabledJointId methods.

Parameters
KA reference to an Eigen vector to be filled with the requested joint state. If the provided vector has wrong size it is resized automatically.
Returns
bool

◆ getStiffness() [2/3]

bool XBot::XBotInterface::getStiffness

Gets the robot stiffness as a JointIdMap, i.e.

a map whose key represents the joint ID and whose value represents the required joint state.

Parameters
KA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getStiffness() [3/3]

bool XBot::XBotInterface::getStiffness

Gets the robot stiffness as a JointNameMap, i.e.

a map whose key represents the joint human-readable name and whose value represents the required joint state.

Parameters
KA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getTemperature() [1/3]

bool XBot::XBotInterface::getTemperature

Gets the robot joint temperatures as an Eigen vector.

The joint order inside the vector can be queried by calling the getEnabledJointNames/getEnabledJointId methods.

Parameters
tempA reference to an Eigen vector to be filled with the requested joint state. If the provided vector has wrong size it is resized automatically.
Returns
bool

◆ getTemperature() [2/3]

bool XBot::XBotInterface::getTemperature

Gets the robot joint temperatures as a JointIdMap, i.e.

a map whose key represents the joint ID and whose value represents the required joint state.

Parameters
tempA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getTemperature() [3/3]

bool XBot::XBotInterface::getTemperature

Gets the robot joint temperatures as a JointNameMap, i.e.

a map whose key represents the joint human-readable name and whose value represents the required joint state.

Parameters
tempA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getTime()

virtual double XBot::RobotInterface::getTime ( ) const
pure virtual

Getter for the time in the robot framework.

Returns
the time in the robot framework

◆ getTimestampRx()

double XBot::RobotInterface::getTimestampRx ( ) const

Get the RX timestamp: it corresponds to the last call to sense()

Returns
the RX timestamp in seconds

◆ getTimestampTx()

double XBot::RobotInterface::getTimestampTx ( ) const

Get the TX timestamp: it corresponds to the last call to move()

Returns
the TX timestamp in seconds

◆ getVelocityReference() [1/3]

bool XBot::XBotInterface::getVelocityReference

Gets the robot velocity references as an Eigen vector.

The joint order inside the vector can be queried by calling the getEnabledJointNames/getEnabledJointId methods.

Parameters
qdotA reference to an Eigen vector to be filled with the requested joint state. If the provided vector has wrong size it is resized automatically.
Returns
bool

◆ getVelocityReference() [2/3]

bool XBot::XBotInterface::getVelocityReference

Gets the robot velocity references as a JointIdMap, i.e.

a map whose key represents the joint ID and whose value represents the required joint state.

Parameters
qdotA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ getVelocityReference() [3/3]

bool XBot::XBotInterface::getVelocityReference

Gets the robot velocity references as a JointNameMap, i.e.

a map whose key represents the joint human-readable name and whose value represents the required joint state.

Parameters
qdotA reference to a JointIdMap to be filled with the requested joint state. It is the user responsibility to clear the map before it is filled (if required).
Returns
bool

◆ init_robot()

virtual bool XBot::RobotInterface::init_robot ( const ConfigOptions config)
protectedpure virtual

◆ isRunning()

virtual bool XBot::RobotInterface::isRunning ( ) const
pure virtual

...

Returns
bool

◆ leg() [1/2]

XBot::RobotChain & XBot::RobotInterface::leg ( int  leg_id)

Getter for the standard kinematic group leg: you can quickly access the i-th leg in the order specified in the SRDF.

Parameters
arm_idthe id of the requested leg (i.e. the index as specifed in the SRDF group
Returns
the leg chain with the requested leg_id

◆ leg() [2/2]

const XBot::RobotChain & XBot::RobotInterface::leg ( int  leg_id) const

◆ model()

XBot::ModelInterface & XBot::RobotInterface::model ( )

Getter for the internal model instance.

Returns
the internal model instance

◆ move()

bool XBot::RobotInterface::move ( )

Moves the robot calling the move_internal() implemented by the derived class.

Returns
true if the move is successful, false otherwis

◆ move_hands()

virtual bool XBot::RobotInterface::move_hands ( )
protectedpure virtual

◆ move_internal()

virtual bool XBot::RobotInterface::move_internal ( )
protectedpure virtual

◆ operator()() [1/2]

XBot::RobotChain & XBot::RobotInterface::operator() ( const std::string &  chain_name)

Getter for the robot chain with a certain chain_name.

Parameters
chain_namethe requested chain name
Returns
the robot chain with the requested chain_name

◆ operator()() [2/2]

const XBot::RobotChain & XBot::RobotInterface::operator() ( const std::string &  chain_name) const

◆ operator=()

RobotInterface& XBot::RobotInterface::operator= ( const RobotInterface other)
delete

◆ post_init()

bool XBot::RobotInterface::post_init ( )
protectedvirtual

Reimplemented from XBot::XBotInterface.

◆ read_sensors()

virtual bool XBot::RobotInterface::read_sensors ( )
protectedpure virtual

◆ sense()

bool XBot::RobotInterface::sense ( bool  sync_model = true,
bool  sync_references = false 
)

Reads the current state of the robot calling sense_internal() and read_sensors() implemented by the derived class.

It synchronizes the internal model if the sync_model param is true.

Parameters
sync_modelsync flag: true if the internal model needs to be synchronized with the robot
sync_referencessync flag: if true, reference fields (pos ref, vel ref, tor ref, stiffness, damping) are synchronized with the robot controller
Returns
true if the sense is successful, false otherwise

◆ sense_hands()

virtual bool XBot::RobotInterface::sense_hands ( )
protectedpure virtual

◆ sense_internal()

virtual bool XBot::RobotInterface::sense_internal ( bool  sync_references)
protectedpure virtual

◆ set_control_mode_internal()

bool XBot::RobotInterface::set_control_mode_internal ( int  joint_id,
const ControlMode control_mode 
)
protectedvirtual

◆ setControlMode() [1/4]

bool XBot::RobotInterface::setControlMode ( const ControlMode control_mode)

◆ setControlMode() [2/4]

bool XBot::RobotInterface::setControlMode ( const std::map< int, ControlMode > &  control_mode)

◆ setControlMode() [3/4]

bool XBot::RobotInterface::setControlMode ( const std::map< std::string, ControlMode > &  control_mode)

◆ setControlMode() [4/4]

bool XBot::RobotInterface::setControlMode ( const std::string &  chain_name,
const ControlMode control_mode 
)
virtual

◆ setDamping() [1/3]

bool XBot::XBotInterface::setDamping

Sets the XBotInterface internal joint damping according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods.

Parameters
DThe vector of input joint states.
Returns
True if the size of the provided vector matches getJointNum().

◆ setDamping() [2/3]

bool XBot::XBotInterface::setDamping

Sets the XBotInterface internal joint damping according to the input JointIdMap (i.e.

a map whose key represents the joint ID and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
KThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setDamping() [3/3]

bool XBot::XBotInterface::setDamping

Sets the XBotInterface internal joint damping according to the input JointNameMap (i.e.

a map whose key represents the joint name and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
DThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setEffortReference() [1/3]

bool XBot::XBotInterface::setEffortReference

Sets the XBotInterface internal joint effort references according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods.

Parameters
tauThe vector of input joint states.
Returns
True if the size of the provided vector matches getJointNum().

◆ setEffortReference() [2/3]

bool XBot::XBotInterface::setEffortReference

Sets the XBotInterface internal joint effort references according to the input JointIdMap (i.e.

a map whose key represents the joint ID and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
tauThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setEffortReference() [3/3]

bool XBot::XBotInterface::setEffortReference

Sets the XBotInterface internal joint effort references according to the input JointNameMap (i.e.

a map whose key represents the joint name and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
tauThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setJointAcceleration() [1/3]

bool XBot::XBotInterface::setJointAcceleration
protected

Sets the XBotInterface internal joint accelerations according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods.

Parameters
qddotThe vector of input joint states.
Returns
True if the size of the provided vector matches getJointNum().

◆ setJointAcceleration() [2/3]

bool XBot::XBotInterface::setJointAcceleration
protected

Sets the XBotInterface internal joint accelerations according to the input JointIdMap (i.e.

a map whose key represents the joint ID and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
qddotThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setJointAcceleration() [3/3]

bool XBot::XBotInterface::setJointAcceleration
protected

Sets the XBotInterface internal joint accelerations according to the input JointNameMap (i.e.

a map whose key represents the joint name and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
qddotThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setJointEffort() [1/3]

bool XBot::XBotInterface::setJointEffort
protected

Sets the XBotInterface internal joint efforts according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods.

Parameters
tauThe vector of input joint states.
Returns
True if the size of the provided vector matches getJointNum().

◆ setJointEffort() [2/3]

bool XBot::XBotInterface::setJointEffort
protected

Sets the XBotInterface internal joint efforts according to the input JointIdMap (i.e.

a map whose key represents the joint ID and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
tauThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setJointEffort() [3/3]

bool XBot::XBotInterface::setJointEffort
protected

Sets the XBotInterface internal joint efforts according to the input JointNameMap (i.e.

a map whose key represents the joint name and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
tauThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setJointPosition() [1/3]

bool XBot::XBotInterface::setJointPosition
protected

Sets the XBotInterface internal joint positions according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods.

Parameters
qThe vector of input joint states.
Returns
True if the size of the provided vector matches getJointNum().

◆ setJointPosition() [2/3]

bool XBot::XBotInterface::setJointPosition
protected

Sets the XBotInterface internal joint positions according to the input JointIdMap (i.e.

a map whose key represents the joint ID and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
qThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setJointPosition() [3/3]

bool XBot::XBotInterface::setJointPosition
protected

Sets the XBotInterface internal joint positions according to the input JointNameMap (i.e.

a map whose key represents the joint name and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
qThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setJointVelocity() [1/3]

bool XBot::XBotInterface::setJointVelocity
protected

Sets the XBotInterface internal joint velocities according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods.

Parameters
qdotThe vector of input joint states.
Returns
True if the size of the provided vector matches getJointNum().

◆ setJointVelocity() [2/3]

bool XBot::XBotInterface::setJointVelocity
protected

Sets the XBotInterface internal joint velocities according to the input JointIdMap (i.e.

a map whose key represents the joint ID and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
qdotThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setJointVelocity() [3/3]

bool XBot::XBotInterface::setJointVelocity
protected

Sets the XBotInterface internal joint velocities according to the input JointNameMap (i.e.

a map whose key represents the joint name and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
qdotThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setMotorPosition() [1/3]

bool XBot::XBotInterface::setMotorPosition
protected

Sets the XBotInterface internal motor positions according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods.

Parameters
qThe vector of input joint states.
Returns
True if the size of the provided vector matches getJointNum().

◆ setMotorPosition() [2/3]

bool XBot::XBotInterface::setMotorPosition
protected

Sets the XBotInterface internal motor positions according to the input JointIdMap (i.e.

a map whose key represents the joint ID and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
qThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setMotorPosition() [3/3]

bool XBot::XBotInterface::setMotorPosition
protected

Sets the XBotInterface internal motor positions according to the input JointNameMap (i.e.

a map whose key represents the joint name and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
qThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setMotorVelocity() [1/3]

bool XBot::XBotInterface::setMotorVelocity
protected

Sets the XBotInterface internal motor velocities according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods.

Parameters
qdotThe vector of input joint states.
Returns
True if the size of the provided vector matches getJointNum().

◆ setMotorVelocity() [2/3]

bool XBot::XBotInterface::setMotorVelocity
protected

Sets the XBotInterface internal motor velocities according to the input JointIdMap (i.e.

a map whose key represents the joint ID and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
qdotThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setMotorVelocity() [3/3]

bool XBot::XBotInterface::setMotorVelocity
protected

Sets the XBotInterface internal motor velocities according to the input JointNameMap (i.e.

a map whose key represents the joint name and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
qdotThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setPositionReference() [1/3]

bool XBot::XBotInterface::setPositionReference

Sets the XBotInterface internal joint position references according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods.

Parameters
qThe vector of input joint states.
Returns
True if the size of the provided vector matches getJointNum().

◆ setPositionReference() [2/3]

bool XBot::XBotInterface::setPositionReference

Sets the XBotInterface internal joint position references according to the input JointIdMap (i.e.

a map whose key represents the joint ID and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
qThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setPositionReference() [3/3]

bool XBot::XBotInterface::setPositionReference

Sets the XBotInterface internal joint position references according to the input JointNameMap (i.e.

a map whose key represents the joint name and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
qThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setReferenceFrom()

template<typename... SyncFlags>
bool XBot::RobotInterface::setReferenceFrom ( const ModelInterface model,
SyncFlags...  flags 
)

Sets the robot references according to a ModelInterface.

Flags can be specified to select a part of the state to be synchronized.

@usage robot.setReferenceFrom(model, XBot::Sync::Position, XBot::Sync::Effort) @usage robot.setReferenceFrom(other_model, XBot::Sync::Position)

Parameters
modelThe ModelInterface whose state is used as a reference for the robot. model.
flagsFlags to specify what part of the model state must be used a reference. By default (i.e. if this argument is omitted) the whole state is used. Otherwise, an arbitrary number of flags can be specified in order to select a subset of the state. The flags must be of the enum type XBot::Sync, which can take the following values:
Returns
True if the synchronization is allowed, false otherwise.

◆ setStiffness() [1/3]

bool XBot::XBotInterface::setStiffness

Sets the XBotInterface internal joint stiffness according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods.

Parameters
KThe vector of input joint states.
Returns
True if the size of the provided vector matches getJointNum().

◆ setStiffness() [2/3]

bool XBot::XBotInterface::setStiffness

Sets the XBotInterface internal joint stiffness according to the input JointIdMap (i.e.

a map whose key represents the joint ID and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
KThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setStiffness() [3/3]

bool XBot::XBotInterface::setStiffness

Sets the XBotInterface internal joint stiffness according to the input JointNameMap (i.e.

a map whose key represents the joint name and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
KThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setTemperature() [1/3]

bool XBot::XBotInterface::setTemperature
protected

Sets the XBotInterface internal joint temperatures according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods.

Parameters
tempThe vector of input joint states.
Returns
True if the size of the provided vector matches getJointNum().

◆ setTemperature() [2/3]

bool XBot::XBotInterface::setTemperature
protected

Sets the XBotInterface internal motor temperatures according to the input JointIdMap (i.e.

a map whose key represents the joint ID and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
tempThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setTemperature() [3/3]

bool XBot::XBotInterface::setTemperature
protected

Sets the XBotInterface internal joint temperatures according to the input JointNameMap (i.e.

a map whose key represents the joint name and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
tempThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setVelocityReference() [1/3]

bool XBot::XBotInterface::setVelocityReference

Sets the XBotInterface internal joint velocity references according to the provided vector, which must be ordered as specified by the getEnabledJointNames/getEnabledJointId methods.

Parameters
qdotThe vector of input joint states.
Returns
True if the size of the provided vector matches getJointNum().

◆ setVelocityReference() [2/3]

bool XBot::XBotInterface::setVelocityReference

Sets the XBotInterface internal joint velocity references according to the input JointIdMap (i.e.

a map whose key represents the joint ID and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
qdotThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ setVelocityReference() [3/3]

bool XBot::XBotInterface::setVelocityReference

Sets the XBotInterface internal joint velocity references according to the input JointNameMap (i.e.

a map whose key represents the joint name and whose value represents the joint state), which can include joint states for an arbitrary subset of the whole robot.

Parameters
qdotThe input JointIdMap
Returns
True if all joint IDs inside the provided map are valid.

◆ sync()

template<typename... SyncFlags>
bool XBot::XBotInterface::sync ( typename...  SyncFlags)
protected

Synchronize the current XBotInterface with another XBotInterface object: only the common chains will be taken into account.

Parameters
flags...
otherThe XBotInterface object from which we synchronize the current object
Returns
Always true because we support synchronization btw XBotInterfaces with different chains.

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