XBotInterface
2.4.1
XBotInterface provides a generic API to model and control a robot.
|
Kinematic chain abstraction as a set of joints and sensors. More...
#include <KinematicChain.h>
Public Types | |
typedef std::shared_ptr< KinematicChain > | Ptr |
typedef std::shared_ptr< const KinematicChain > | ConstPtr |
Public Member Functions | |
KinematicChain () | |
Default constructor. More... | |
KinematicChain (const std::string &chain_name, const XBot::XBotCoreModel &XBotModel) | |
Construct a Kinematic Chain using the chain name and the XBotCoreModel. More... | |
KinematicChain (const std::string &chain_name) | |
Construct a Kinematic Chain using the chain name. More... | |
KinematicChain (const KinematicChain &other) | |
Custom copy constructor, which guarantees independence between copies by performing a deep copy. More... | |
KinematicChain & | operator= (const KinematicChain &rhs) |
Custom copy assignment, which guarantees independence between copies by performing a deep copy. More... | |
bool | getChainState (const std::string &state_name, JointIdMap &q) const |
Gets the chain joints group state configuration as specified in the robot SRDF. More... | |
bool | getChainState (const std::string &state_name, JointNameMap &q) const |
Gets the chain joints group state configuration as specified in the robot SRDF. More... | |
bool | getChainState (const std::string &state_name, Eigen::VectorXd &q) const |
Gets the chain joints group state configuration as specified in the robot SRDF. More... | |
std::map< std::string, ForceTorqueSensor::ConstPtr > | getForceTorque () const |
Getter for the force-torque sensor map pertaining to the chain. More... | |
std::map< std::string, ImuSensor::ConstPtr > | getImu () const |
Getter for the IMU sensor map pertaining to the chain. More... | |
ForceTorqueSensor::ConstPtr | getForceTorque (const std::string &parent_link_name) const |
Returns a force-torque sensor given its parent-link name. More... | |
ImuSensor::ConstPtr | getImu (const std::string &parent_link_name) const |
Returns an IMU sensor given its parent-link name. More... | |
void | getJointLimits (Eigen::VectorXd &q_min, Eigen::VectorXd &q_max) const |
Gets a vector of the chain joint limits, as specified in the URDF file. More... | |
void | getVelocityLimits (Eigen::VectorXd &qdot_max) const |
Gets a vector of the chain joint velocity limits, as specified in the URDF file. More... | |
void | getEffortLimits (Eigen::VectorXd &tau_max) const |
Gets a vector of the chain joint effort limits, as specified in the URDF file. More... | |
void | getJointLimits (int i, double &q_min, double &q_max) const |
Gets the lower and upper joint limits of the i-th joint in the chain (from base link to tip link) More... | |
void | getVelocityLimits (int i, double &qdot_max) const |
Gets the velocity limit of the i-th joint in the chain (from base link to tip link) More... | |
void | getEffortLimits (int i, double &tau_max) const |
Gets the effort limit of the i-th joint in the chain (from base link to tip link) 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 (Eigen::VectorXd &q) const |
Modifies the input joint position vector by enforcing joint limits. More... | |
bool | enforceVelocityLimit (Eigen::VectorXd &qdot) const |
Modifies the input joint velcoity vector by enforcing joint limits. More... | |
bool | enforceEffortLimit (Eigen::VectorXd &tau) const |
Modifies the input joint effort vector by enforcing effort limits. More... | |
bool | mapToEigen (const JointIdMap &id_map, Eigen::VectorXd &eigen_vector) const |
Converts a state vector for an arbitrary subset of the chain state (specified as a JointIdMap) to its Eigen representation. More... | |
bool | mapToEigen (const JointNameMap &name_map, Eigen::VectorXd &eigen_vector) const |
Converts a state vector for an arbitrary subset of the chain state (specified as a JointNameMap) to its Eigen representation. More... | |
bool | eigenToMap (const Eigen::VectorXd &eigen_vector, JointIdMap &id_map) const |
Converts a state vector for the whole chain to its JointIdMap representation. More... | |
bool | eigenToMap (const Eigen::VectorXd &eigen_vector, JointNameMap &name_map) const |
Converts a state vector for the whole chain to its JointNameMap representation. More... | |
void | pushBackJoint (Joint::Ptr joint) |
add a joint in the kinematic chain pushing it in the end of the chain More... | |
void | removeJoint (int i) |
remove the i-th joint in the kinematic chain More... | |
bool | isVirtual () const |
Method for determining whether a chain is virtual, i.e. More... | |
const std::string & | getChainName () const |
Method returning the name of the chain. More... | |
const std::string & | getBaseLinkName () const |
Method returning the name of the chain base link. More... | |
const std::string & | getTipLinkName () const |
Method returning the name of the chain tip link. More... | |
const std::string & | getChildLinkName (int i) const |
Method returning the name of the child link corresponding to the i-th joint of the chain. More... | |
const std::string & | getParentLinkName (int i) const |
Method returning the name of the parent link corresponding to the i-th joint of the chain. More... | |
const std::string & | getJointName (int i) const |
Method returning the name of the i-th joint of the chain. More... | |
const std::vector< std::string > & | getJointNames () const |
Returns a vector containing the namess of all joints in the chain, from base link to tip link. More... | |
int | getJointId (int i) const |
Method returning the ID of the i-th joint of the chain. More... | |
int | getChainDofIndex (int joint_id) const |
Getter for the chain dof index (local index of a joint inside a chain, this means that the base link of the chain has dof index = 0, tip link of the chain has dof index = getJointNum()-1 ) of a joint with the requested joint id. More... | |
int | getChainDofIndex (const std::string &joint_name) const |
Getter for the chain dof index (local index of a joint inside a chain, this means that the base link of the chain has dof index = 0, tip link of the chain has dof index = getJointNum()-1 ) of a joint with the requested joint name. More... | |
bool | hasJoint (int joint_id) const |
check if the chain has a joint with a certain id More... | |
bool | hasJoint (const std::string &joint_name) const |
check if the chain has a joint with a certain name More... | |
const std::vector< int > & | getJointIds () const |
Returns a vector containing the IDs of all joints in the chain, from base link to tip link. More... | |
int | getJointNum () const |
Method returning the number of enabled joints belonging to the chain. More... | |
const std::vector< urdf::JointConstSharedPtr > & | getUrdfJoints () const |
Method returning the vector of urdf::Joints corresponding to the chain. More... | |
const std::vector< urdf::LinkConstSharedPtr > & | getUrdfLinks () const |
Method returning the vector of urdf::Links corresponding to the chain. More... | |
void | shallowCopy (const KinematicChain &chain) |
Updates the current object (this) by performing a shallow copy with the chain passed as argument. More... | |
Joint::ConstPtr | getJoint (int i) const |
Getter for the i-th Joint Ptr. More... | |
bool | getJointPosition (Eigen::VectorXd &q) const |
bool | getMotorPosition (Eigen::VectorXd &q) const |
bool | getJointVelocity (Eigen::VectorXd &qdot) const |
bool | getMotorVelocity (Eigen::VectorXd &qdot) const |
bool | getJointAcceleration (Eigen::VectorXd &qddot) const |
bool | getJointEffort (Eigen::VectorXd &tau) const |
bool | getTemperature (Eigen::VectorXd &temp) const |
bool | getJointPosition (JointIdMap &q) const |
bool | getMotorPosition (JointIdMap &q) const |
bool | getJointVelocity (JointIdMap &qdot) const |
bool | getMotorVelocity (JointIdMap &qdot) const |
bool | getJointAcceleration (JointIdMap &qddot) const |
bool | getJointEffort (JointIdMap &tau) const |
bool | getTemperature (JointIdMap &temp) const |
bool | getJointPosition (JointNameMap &q) const |
bool | getMotorPosition (JointNameMap &q) const |
bool | getJointVelocity (JointNameMap &qdot) const |
bool | getMotorVelocity (JointNameMap &qdot) const |
bool | getJointAcceleration (JointNameMap &qddot) const |
bool | getJointEffort (JointNameMap &tau) const |
bool | getTemperature (JointNameMap &temp) const |
double | getJointPosition (int index) const |
double | getMotorPosition (int index) const |
double | getJointVelocity (int index) const |
double | getMotorVelocity (int index) const |
double | getJointAcceleration (int index) const |
double | getJointEffort (int index) const |
double | getTemperature (int index) const |
bool | setJointPosition (const Eigen::VectorXd &q) |
bool | setMotorPosition (const Eigen::VectorXd &q) |
bool | setJointVelocity (const Eigen::VectorXd &qdot) |
bool | setMotorVelocity (const Eigen::VectorXd &qdot) |
bool | setJointAcceleration (const Eigen::VectorXd &qddot) |
bool | setJointEffort (const Eigen::VectorXd &tau) |
bool | setTemperature (const Eigen::VectorXd &temp) |
bool | setJointPosition (const JointIdMap &q) |
bool | setMotorPosition (const JointIdMap &q) |
bool | setJointVelocity (const JointIdMap &qdot) |
bool | setMotorVelocity (const JointIdMap &qdot) |
bool | setJointAcceleration (const JointIdMap &qddot) |
bool | setJointEffort (const JointIdMap &tau) |
bool | setTemperature (const JointIdMap &temp) |
bool | setJointPosition (const JointNameMap &q) |
bool | setMotorPosition (const JointNameMap &q) |
bool | setJointVelocity (const JointNameMap &qdot) |
bool | setMotorVelocity (const JointNameMap &qdot) |
bool | setJointAcceleration (const JointNameMap &qddot) |
bool | setJointEffort (const JointNameMap &tau) |
bool | setTemperature (const JointNameMap &temp) |
bool | setJointPosition (int i, double q) |
bool | setMotorPosition (int i, double q) |
bool | setJointVelocity (int i, double qdot) |
bool | setMotorVelocity (int i, double qdot) |
bool | setJointAcceleration (int i, double qddot) |
bool | setJointEffort (int i, double tau) |
bool | setTemperature (int i, double temp) |
bool | getPositionReference (Eigen::VectorXd &q) const |
bool | getVelocityReference (Eigen::VectorXd &qdot) const |
bool | getEffortReference (Eigen::VectorXd &tau) const |
bool | getStiffness (Eigen::VectorXd &K) const |
bool | getDamping (Eigen::VectorXd &D) const |
bool | getPositionReference (JointIdMap &q) const |
bool | getVelocityReference (JointIdMap &qdot) const |
bool | getEffortReference (JointIdMap &tau) const |
bool | getStiffness (JointIdMap &K) const |
bool | getDamping (JointIdMap &D) const |
bool | getPositionReference (JointNameMap &q) const |
bool | getVelocityReference (JointNameMap &qdot) const |
bool | getEffortReference (JointNameMap &tau) const |
bool | getStiffness (JointNameMap &K) const |
bool | getDamping (JointNameMap &D) const |
double | getPositionReference (int index) const |
double | getVelocityReference (int index) const |
double | getEffortReference (int index) const |
double | getStiffness (int index) const |
double | getDamping (int index) const |
bool | setPositionReference (const Eigen::VectorXd &q) |
bool | setVelocityReference (const Eigen::VectorXd &qdot) |
bool | setEffortReference (const Eigen::VectorXd &tau) |
bool | setStiffness (const Eigen::VectorXd &K) |
bool | setDamping (const Eigen::VectorXd &D) |
bool | setPositionReference (const JointIdMap &q) |
bool | setVelocityReference (const JointIdMap &qdot) |
bool | setEffortReference (const JointIdMap &tau) |
bool | setStiffness (const JointIdMap &K) |
bool | setDamping (const JointIdMap &D) |
bool | setPositionReference (const JointNameMap &q) |
bool | setVelocityReference (const JointNameMap &qdot) |
bool | setEffortReference (const JointNameMap &tau) |
bool | setStiffness (const JointNameMap &K) |
bool | setDamping (const JointNameMap &D) |
bool | setPositionReference (int i, double q) |
bool | setVelocityReference (int i, double qdot) |
bool | setEffortReference (int i, double tau) |
bool | setStiffness (int i, double K) |
bool | setDamping (int i, double D) |
template<typename... SyncFlags> | |
bool | syncFrom (const KinematicChain &other, SyncFlags... flags) |
Synchronize the current KinematicChain with another KinematicChain object. More... | |
void | print () const |
Prints a pretty table about chain state. More... | |
void | printTracking () const |
Prints a pretty table about chain tracking. More... | |
Protected Member Functions | |
Joint::Ptr | getJointInternal (int i) const |
Getter for the i-th Joint Ptr. More... | |
std::map< std::string, ForceTorqueSensor::Ptr > | getForceTorqueInternal () const |
std::map< std::string, ImuSensor::Ptr > | getImuInternal () const |
Protected Attributes | |
std::map< std::string, XBot::Joint::Ptr > | _joint_name_map |
std::map< int, XBot::Joint::Ptr > | _joint_id_map |
std::vector< XBot::Joint::Ptr > | _joint_vector |
std::vector< ForceTorqueSensor::Ptr > | _ft_vector |
std::map< std::string, ForceTorqueSensor::Ptr > | _ft_map |
std::vector< ImuSensor::Ptr > | _imu_vector |
std::map< std::string, ImuSensor::Ptr > | _imu_map |
Friends | |
std::ostream & | operator<< (std::ostream &os, const XBot::KinematicChain &c) |
Kinematic chain abstraction as a set of joints and sensors.
typedef std::shared_ptr<const KinematicChain> XBot::KinematicChain::ConstPtr |
typedef std::shared_ptr<KinematicChain> XBot::KinematicChain::Ptr |
XBot::KinematicChain::KinematicChain | ( | ) |
Default constructor.
XBot::KinematicChain::KinematicChain | ( | const std::string & | chain_name, |
const XBot::XBotCoreModel & | XBotModel | ||
) |
Construct a Kinematic Chain using the chain name and the XBotCoreModel.
chain_name | the name of the chain |
XBotModel | the model built using XBotModel |
|
explicit |
Construct a Kinematic Chain using the chain name.
chain_name | the name of the chain |
XBot::KinematicChain::KinematicChain | ( | const KinematicChain & | other | ) |
Custom copy constructor, which guarantees independence between copies by performing a deep copy.
bool XBot::KinematicChain::checkEffortLimits | ( | const Eigen::VectorXd & | tau | ) | const |
Check the input joint effort vector against joint limits.
tau | A joint effort vector to be checked against joint limits, ordered from base link to tip link. |
bool XBot::KinematicChain::checkEffortLimits | ( | const Eigen::VectorXd & | tau, |
std::vector< std::string > & | violating_joints | ||
) | const |
Check the input joint effort vector against joint limits.
The names of joints violating the limits are pushed into the violating_joints vector (which is not cleared before being filled)
tau | A joint effort vector to be checked against joint limits, ordered from base link to tip link. |
violating_joints | The vector of the names of joints violating the limits. Note that this is not cleared before use. |
bool XBot::KinematicChain::checkJointLimits | ( | const Eigen::VectorXd & | q | ) | const |
Check the input joint position vector against joint limits.
q | A joint position vector to be checked against joint limits, ordered from base link to tip link. |
bool XBot::KinematicChain::checkJointLimits | ( | const Eigen::VectorXd & | q, |
std::vector< std::string > & | violating_joints | ||
) | const |
Check the input joint position vector against joint limits.
The names of joints violating the limits are pushed into the violating_joints vector (which is not cleared before being filled)
q | A joint position vector to be checked against joint limits, ordered from base link to tip link. |
violating_joints | The vector of the names of joints violating the limits. Note that this is not cleared before use. |
bool XBot::KinematicChain::checkVelocityLimits | ( | const Eigen::VectorXd & | qdot | ) | const |
Check the input joint velocity vector against joint limits.
qdot | A joint velocity vector to be checked against joint limits, ordered from base link to tip link. |
bool XBot::KinematicChain::checkVelocityLimits | ( | const Eigen::VectorXd & | qdot, |
std::vector< std::string > & | violating_joints | ||
) | const |
Check the input joint velocity vector against joint limits.
The names of joints violating the limits are pushed into the violating_joints vector (which is not cleared before being filled)
qdot | A joint velocity vector to be checked against joint limits, ordered from base link to tip link. |
violating_joints | The vector of the names of joints violating the limits. Note that this is not cleared before use. |
bool XBot::KinematicChain::eigenToMap | ( | const Eigen::VectorXd & | eigen_vector, |
JointIdMap & | id_map | ||
) | const |
Converts a state vector for the whole chain to its JointIdMap representation.
Note that the output map is not cleared before it is filled. It is the responsibility of the user to do so if required.
eigen_vector | A state vector for the whole robot (its size must match getJointNum()) |
id_map | The output map to be filled |
bool XBot::KinematicChain::eigenToMap | ( | const Eigen::VectorXd & | eigen_vector, |
JointNameMap & | name_map | ||
) | const |
Converts a state vector for the whole chain to its JointNameMap representation.
Note that the output map is not cleared before it is filled. It is the responsibility of the user to do so if required.
eigen_vector | A state vector for the whole robot (its size must match getJointNum()) |
name_map | The output map to be filled |
bool XBot::KinematicChain::enforceEffortLimit | ( | Eigen::VectorXd & | tau | ) | const |
Modifies the input joint effort vector by enforcing effort limits.
tau | The input joint effort vector. Out-of-range components are set to the closest joint limit. |
bool XBot::KinematicChain::enforceJointLimits | ( | Eigen::VectorXd & | q | ) | const |
Modifies the input joint position vector by enforcing joint limits.
q | The input joint position vector. Out-of-range components are set to the closest joint limit. |
bool XBot::KinematicChain::enforceVelocityLimit | ( | Eigen::VectorXd & | qdot | ) | const |
Modifies the input joint velcoity vector by enforcing joint limits.
qdot | The input joint velocity vector. Out-of-range components are set to the closest joint limit. |
const std::string & XBot::KinematicChain::getBaseLinkName | ( | ) | const |
Method returning the name of the chain base link.
int XBot::KinematicChain::getChainDofIndex | ( | const std::string & | joint_name | ) | const |
Getter for the chain dof index (local index of a joint inside a chain, this means that the base link of the chain has dof index = 0, tip link of the chain has dof index = getJointNum()-1 ) of a joint with the requested joint name.
joint_name | the requested joint name |
int XBot::KinematicChain::getChainDofIndex | ( | int | joint_id | ) | const |
Getter for the chain dof index (local index of a joint inside a chain, this means that the base link of the chain has dof index = 0, tip link of the chain has dof index = getJointNum()-1 ) of a joint with the requested joint id.
joint_id | the requested joint id |
const std::string & XBot::KinematicChain::getChainName | ( | ) | const |
Method returning the name of the chain.
bool XBot::KinematicChain::getChainState | ( | const std::string & | state_name, |
Eigen::VectorXd & | q | ||
) | const |
Gets the chain joints group state configuration as specified in the robot SRDF.
state_name | The name of the requested group state. |
q | The chain joint configuration as Eigen vector of joint positions, This is an output parameter; any contents present in the vector will be overwritten in this function. |
bool XBot::KinematicChain::getChainState | ( | const std::string & | state_name, |
JointIdMap & | q | ||
) | const |
Gets the chain joints group state configuration as specified in the robot SRDF.
state_name | The name of the requested group state. |
q | The chain joint configuration as a map with key representing the joint ID (i.e. numerical name of the joint) and values representing joint positions. This is an output parameter; it will not be cleared before being filled. |
bool XBot::KinematicChain::getChainState | ( | const std::string & | state_name, |
JointNameMap & | q | ||
) | const |
Gets the chain joints group state configuration as specified in the robot SRDF.
state_name | The name of the requested group state. |
q | The chain joint configuration as a map with key representing joint names and values representing joint positions. This is an output parameter; it will not be cleared before being filled. |
const std::string & XBot::KinematicChain::getChildLinkName | ( | int | i | ) | const |
Method returning the name of the child link corresponding to the i-th joint of the chain.
i | The position of the joint along the chain (i = 0 refers to the joint attached to the base link) |
bool XBot::KinematicChain::getDamping | ( | Eigen::VectorXd & | D | ) | const |
double XBot::KinematicChain::getDamping | ( | int | index | ) | const |
bool XBot::KinematicChain::getDamping | ( | JointIdMap & | D | ) | const |
bool XBot::KinematicChain::getDamping | ( | JointNameMap & | D | ) | const |
void XBot::KinematicChain::getEffortLimits | ( | Eigen::VectorXd & | tau_max | ) | const |
Gets a vector of the chain joint effort limits, as specified in the URDF file.
The vector is ordered from the chain base link to its tip link.
qdot_max | The output vector of the chain joints effort limits |
void XBot::KinematicChain::getEffortLimits | ( | int | i, |
double & | tau_max | ||
) | const |
Gets the effort limit of the i-th joint in the chain (from base link to tip link)
i | The index of the joint along the chain for which the joint limit is requested. |
tau_max | The requested joint effort limit. |
bool XBot::KinematicChain::getEffortReference | ( | Eigen::VectorXd & | tau | ) | const |
double XBot::KinematicChain::getEffortReference | ( | int | index | ) | const |
bool XBot::KinematicChain::getEffortReference | ( | JointIdMap & | tau | ) | const |
bool XBot::KinematicChain::getEffortReference | ( | JointNameMap & | tau | ) | const |
std::map< std::string, ForceTorqueSensor::ConstPtr > XBot::KinematicChain::getForceTorque | ( | ) | const |
Getter for the force-torque sensor map pertaining to the chain.
ForceTorqueSensor::ConstPtr XBot::KinematicChain::getForceTorque | ( | const std::string & | parent_link_name | ) | const |
Returns a force-torque sensor given its parent-link name.
parent_link_name | Name of the link to which the sensor is attached |
|
protected |
std::map< std::string, ImuSensor::ConstPtr > XBot::KinematicChain::getImu | ( | ) | const |
Getter for the IMU sensor map pertaining to the chain.
ImuSensor::ConstPtr XBot::KinematicChain::getImu | ( | const std::string & | parent_link_name | ) | const |
Returns an IMU sensor given its parent-link name.
parent_link_name | Name of the link to which the sensor is attached |
|
protected |
Joint::ConstPtr XBot::KinematicChain::getJoint | ( | int | i | ) | const |
Getter for the i-th Joint Ptr.
i | index inside the chain (i=0 is the child joint of base link) |
bool XBot::KinematicChain::getJointAcceleration | ( | Eigen::VectorXd & | qddot | ) | const |
double XBot::KinematicChain::getJointAcceleration | ( | int | index | ) | const |
bool XBot::KinematicChain::getJointAcceleration | ( | JointIdMap & | qddot | ) | const |
bool XBot::KinematicChain::getJointAcceleration | ( | JointNameMap & | qddot | ) | const |
bool XBot::KinematicChain::getJointEffort | ( | Eigen::VectorXd & | tau | ) | const |
double XBot::KinematicChain::getJointEffort | ( | int | index | ) | const |
bool XBot::KinematicChain::getJointEffort | ( | JointIdMap & | tau | ) | const |
bool XBot::KinematicChain::getJointEffort | ( | JointNameMap & | tau | ) | const |
int XBot::KinematicChain::getJointId | ( | int | i | ) | const |
Method returning the ID of the i-th joint of the chain.
i | The position of the joint whose ID is queried (i = 0 refers to the joint attached to the base link) |
const std::vector< int > & XBot::KinematicChain::getJointIds | ( | ) | const |
Returns a vector containing the IDs of all joints in the chain, from base link to tip link.
|
protected |
Getter for the i-th Joint Ptr.
i | index inside the chain (i=0 is the child joint of base link) |
void XBot::KinematicChain::getJointLimits | ( | Eigen::VectorXd & | q_min, |
Eigen::VectorXd & | q_max | ||
) | const |
Gets a vector of the chain joint limits, as specified in the URDF file.
The vector is ordered from the chain base link to its tip link.
q_min | The output vector of the chain joints lower limits. |
q_max | The output vector of the chain joints upper limits. |
void XBot::KinematicChain::getJointLimits | ( | int | i, |
double & | q_min, | ||
double & | q_max | ||
) | const |
Gets the lower and upper joint limits of the i-th joint in the chain (from base link to tip link)
i | The index of the joint along the chain for which the joint limits are requested. |
q_min | The required joint lower limit. |
q_max | The required joint upper limit. |
const std::string & XBot::KinematicChain::getJointName | ( | int | i | ) | const |
Method returning the name of the i-th joint of the chain.
i | The position of the joint whose name is queried (i = 0 refers to the joint attached to the base link) |
const std::vector< std::string > & XBot::KinematicChain::getJointNames | ( | ) | const |
Returns a vector containing the namess of all joints in the chain, from base link to tip link.
int XBot::KinematicChain::getJointNum | ( | ) | const |
Method returning the number of enabled joints belonging to the chain.
bool XBot::KinematicChain::getJointPosition | ( | Eigen::VectorXd & | q | ) | const |
double XBot::KinematicChain::getJointPosition | ( | int | index | ) | const |
bool XBot::KinematicChain::getJointPosition | ( | JointIdMap & | q | ) | const |
bool XBot::KinematicChain::getJointPosition | ( | JointNameMap & | q | ) | const |
bool XBot::KinematicChain::getJointVelocity | ( | Eigen::VectorXd & | qdot | ) | const |
double XBot::KinematicChain::getJointVelocity | ( | int | index | ) | const |
bool XBot::KinematicChain::getJointVelocity | ( | JointIdMap & | qdot | ) | const |
bool XBot::KinematicChain::getJointVelocity | ( | JointNameMap & | qdot | ) | const |
bool XBot::KinematicChain::getMotorPosition | ( | Eigen::VectorXd & | q | ) | const |
double XBot::KinematicChain::getMotorPosition | ( | int | index | ) | const |
bool XBot::KinematicChain::getMotorPosition | ( | JointIdMap & | q | ) | const |
bool XBot::KinematicChain::getMotorPosition | ( | JointNameMap & | q | ) | const |
bool XBot::KinematicChain::getMotorVelocity | ( | Eigen::VectorXd & | qdot | ) | const |
double XBot::KinematicChain::getMotorVelocity | ( | int | index | ) | const |
bool XBot::KinematicChain::getMotorVelocity | ( | JointIdMap & | qdot | ) | const |
bool XBot::KinematicChain::getMotorVelocity | ( | JointNameMap & | qdot | ) | const |
const std::string & XBot::KinematicChain::getParentLinkName | ( | int | i | ) | const |
Method returning the name of the parent link corresponding to the i-th joint of the chain.
i | The position of the joint along the chain (i = 0 refers to the joint attached to the base link) |
bool XBot::KinematicChain::getPositionReference | ( | Eigen::VectorXd & | q | ) | const |
double XBot::KinematicChain::getPositionReference | ( | int | index | ) | const |
bool XBot::KinematicChain::getPositionReference | ( | JointIdMap & | q | ) | const |
bool XBot::KinematicChain::getPositionReference | ( | JointNameMap & | q | ) | const |
bool XBot::KinematicChain::getStiffness | ( | Eigen::VectorXd & | K | ) | const |
double XBot::KinematicChain::getStiffness | ( | int | index | ) | const |
bool XBot::KinematicChain::getStiffness | ( | JointIdMap & | K | ) | const |
bool XBot::KinematicChain::getStiffness | ( | JointNameMap & | K | ) | const |
bool XBot::KinematicChain::getTemperature | ( | Eigen::VectorXd & | temp | ) | const |
double XBot::KinematicChain::getTemperature | ( | int | index | ) | const |
bool XBot::KinematicChain::getTemperature | ( | JointIdMap & | temp | ) | const |
bool XBot::KinematicChain::getTemperature | ( | JointNameMap & | temp | ) | const |
const std::string & XBot::KinematicChain::getTipLinkName | ( | ) | const |
Method returning the name of the chain tip link.
const std::vector< urdf::JointConstSharedPtr > & XBot::KinematicChain::getUrdfJoints | ( | ) | const |
Method returning the vector of urdf::Joints corresponding to the chain.
const std::vector< urdf::LinkConstSharedPtr > & XBot::KinematicChain::getUrdfLinks | ( | ) | const |
Method returning the vector of urdf::Links corresponding to the chain.
void XBot::KinematicChain::getVelocityLimits | ( | Eigen::VectorXd & | qdot_max | ) | const |
Gets a vector of the chain joint velocity limits, as specified in the URDF file.
The vector is ordered from the chain base link to its tip link.
qdot_max | The output vector of the chain joints velocity limits |
void XBot::KinematicChain::getVelocityLimits | ( | int | i, |
double & | qdot_max | ||
) | const |
Gets the velocity limit of the i-th joint in the chain (from base link to tip link)
i | The index of the joint along the chain for which the joint limit is requested. |
qdot_max | The requested joint velocity limit. |
bool XBot::KinematicChain::getVelocityReference | ( | Eigen::VectorXd & | qdot | ) | const |
double XBot::KinematicChain::getVelocityReference | ( | int | index | ) | const |
bool XBot::KinematicChain::getVelocityReference | ( | JointIdMap & | qdot | ) | const |
bool XBot::KinematicChain::getVelocityReference | ( | JointNameMap & | qdot | ) | const |
bool XBot::KinematicChain::hasJoint | ( | const std::string & | joint_name | ) | const |
check if the chain has a joint with a certain name
joint_name | the requested joint name |
bool XBot::KinematicChain::hasJoint | ( | int | joint_id | ) | const |
check if the chain has a joint with a certain id
joint_id | the requested joint id |
bool XBot::KinematicChain::isVirtual | ( | ) | const |
Method for determining whether a chain is virtual, i.e.
contains all virtual joints
bool XBot::KinematicChain::mapToEigen | ( | const JointIdMap & | id_map, |
Eigen::VectorXd & | eigen_vector | ||
) | const |
Converts a state vector for an arbitrary subset of the chain state (specified as a JointIdMap) to its Eigen representation.
Note that the output vector is resized and set to zero if its size does not match the number of joints. Otherwise, unspecified components are left untouched.
id_map | A JointIdMap contaning the state of the robot (or a part of it) |
eigen_vector | The output vector to be filled. |
bool XBot::KinematicChain::mapToEigen | ( | const JointNameMap & | name_map, |
Eigen::VectorXd & | eigen_vector | ||
) | const |
Converts a state vector for an arbitrary subset of the chain state (specified as a JointNameMap) to its Eigen representation.
Note that the output vector is resized and set to zero if its size does not match the number of joints. Otherwise, unspecified components are left untouched.
name_map | A JointNameMap contaning the state of the robot (or a part of it) |
eigen_vector | The output vector to be filled. |
KinematicChain & XBot::KinematicChain::operator= | ( | const KinematicChain & | rhs | ) |
Custom copy assignment, which guarantees independence between copies by performing a deep copy.
void XBot::KinematicChain::print | ( | ) | const |
Prints a pretty table about chain state.
void XBot::KinematicChain::printTracking | ( | ) | const |
Prints a pretty table about chain tracking.
void XBot::KinematicChain::pushBackJoint | ( | Joint::Ptr | joint | ) |
add a joint in the kinematic chain pushing it in the end of the chain
joint | the joint to add |
void XBot::KinematicChain::removeJoint | ( | int | i | ) |
remove the i-th joint in the kinematic chain
i | the joint i-th position |
bool XBot::KinematicChain::setDamping | ( | const Eigen::VectorXd & | D | ) |
bool XBot::KinematicChain::setDamping | ( | const JointIdMap & | D | ) |
bool XBot::KinematicChain::setDamping | ( | const JointNameMap & | D | ) |
bool XBot::KinematicChain::setDamping | ( | int | i, |
double | D | ||
) |
bool XBot::KinematicChain::setEffortReference | ( | const Eigen::VectorXd & | tau | ) |
bool XBot::KinematicChain::setEffortReference | ( | const JointIdMap & | tau | ) |
bool XBot::KinematicChain::setEffortReference | ( | const JointNameMap & | tau | ) |
bool XBot::KinematicChain::setEffortReference | ( | int | i, |
double | tau | ||
) |
bool XBot::KinematicChain::setJointAcceleration | ( | const Eigen::VectorXd & | qddot | ) |
bool XBot::KinematicChain::setJointAcceleration | ( | const JointIdMap & | qddot | ) |
bool XBot::KinematicChain::setJointAcceleration | ( | const JointNameMap & | qddot | ) |
bool XBot::KinematicChain::setJointAcceleration | ( | int | i, |
double | qddot | ||
) |
bool XBot::KinematicChain::setJointEffort | ( | const Eigen::VectorXd & | tau | ) |
bool XBot::KinematicChain::setJointEffort | ( | const JointIdMap & | tau | ) |
bool XBot::KinematicChain::setJointEffort | ( | const JointNameMap & | tau | ) |
bool XBot::KinematicChain::setJointEffort | ( | int | i, |
double | tau | ||
) |
bool XBot::KinematicChain::setJointPosition | ( | const Eigen::VectorXd & | q | ) |
bool XBot::KinematicChain::setJointPosition | ( | const JointIdMap & | q | ) |
bool XBot::KinematicChain::setJointPosition | ( | const JointNameMap & | q | ) |
bool XBot::KinematicChain::setJointPosition | ( | int | i, |
double | q | ||
) |
bool XBot::KinematicChain::setJointVelocity | ( | const Eigen::VectorXd & | qdot | ) |
bool XBot::KinematicChain::setJointVelocity | ( | const JointIdMap & | qdot | ) |
bool XBot::KinematicChain::setJointVelocity | ( | const JointNameMap & | qdot | ) |
bool XBot::KinematicChain::setJointVelocity | ( | int | i, |
double | qdot | ||
) |
bool XBot::KinematicChain::setMotorPosition | ( | const Eigen::VectorXd & | q | ) |
bool XBot::KinematicChain::setMotorPosition | ( | const JointIdMap & | q | ) |
bool XBot::KinematicChain::setMotorPosition | ( | const JointNameMap & | q | ) |
bool XBot::KinematicChain::setMotorPosition | ( | int | i, |
double | q | ||
) |
bool XBot::KinematicChain::setMotorVelocity | ( | const Eigen::VectorXd & | qdot | ) |
bool XBot::KinematicChain::setMotorVelocity | ( | const JointIdMap & | qdot | ) |
bool XBot::KinematicChain::setMotorVelocity | ( | const JointNameMap & | qdot | ) |
bool XBot::KinematicChain::setMotorVelocity | ( | int | i, |
double | qdot | ||
) |
bool XBot::KinematicChain::setPositionReference | ( | const Eigen::VectorXd & | q | ) |
bool XBot::KinematicChain::setPositionReference | ( | const JointIdMap & | q | ) |
bool XBot::KinematicChain::setPositionReference | ( | const JointNameMap & | q | ) |
bool XBot::KinematicChain::setPositionReference | ( | int | i, |
double | q | ||
) |
bool XBot::KinematicChain::setStiffness | ( | const Eigen::VectorXd & | K | ) |
bool XBot::KinematicChain::setStiffness | ( | const JointIdMap & | K | ) |
bool XBot::KinematicChain::setStiffness | ( | const JointNameMap & | K | ) |
bool XBot::KinematicChain::setStiffness | ( | int | i, |
double | K | ||
) |
bool XBot::KinematicChain::setTemperature | ( | const Eigen::VectorXd & | temp | ) |
bool XBot::KinematicChain::setTemperature | ( | const JointIdMap & | temp | ) |
bool XBot::KinematicChain::setTemperature | ( | const JointNameMap & | temp | ) |
bool XBot::KinematicChain::setTemperature | ( | int | i, |
double | temp | ||
) |
bool XBot::KinematicChain::setVelocityReference | ( | const Eigen::VectorXd & | qdot | ) |
bool XBot::KinematicChain::setVelocityReference | ( | const JointIdMap & | qdot | ) |
bool XBot::KinematicChain::setVelocityReference | ( | const JointNameMap & | qdot | ) |
bool XBot::KinematicChain::setVelocityReference | ( | int | i, |
double | qdot | ||
) |
void XBot::KinematicChain::shallowCopy | ( | const KinematicChain & | chain | ) |
Updates the current object (this) by performing a shallow copy with the chain passed as argument.
chain | the chain to shallow copy |
bool XBot::KinematicChain::syncFrom | ( | const KinematicChain & | other, |
SyncFlags... | flags | ||
) |
Synchronize the current KinematicChain with another KinematicChain object.
other | The KinematicChain object from which we synchronize the current object |
flags | Flags to specify what part of the state must be synchronized. By default (i.e. if this argument is omitted) the whole state is synchronized. 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: |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |