XBotInterface
2.4.1
XBotInterface provides a generic API to model and control a robot.
|
Go to the documentation of this file.
26 #include <srdfdom_advr/model.h>
53 typedef std::shared_ptr<Joint>
Ptr;
75 Joint(
const std::string &joint_name,
77 urdf::JointConstSharedPtr urdf_joint,
78 const std::string &chain_name);
430 template <
typename... SyncFlags>
451 template <
typename... SyncFlags>
481 std::string _joint_name;
493 std::string _chain_name;
496 std::string _joint_control_type;
499 urdf::JointConstSharedPtr _urdf_joint;
607 template <
typename... SyncFlags>
612 if(_joint_name != other._joint_name){
613 std::cerr <<
"ERROR in " << __func__ <<
"! Attempt to synchronize joints with different names!" << std::endl;
617 bool sync_position =
false,
618 sync_velocity =
false,
619 sync_acceleration =
false,
621 sync_stiffness =
false,
622 sync_damping =
false,
645 _link_pos = other._motor_pos;
648 _link_pos = other._link_pos;
651 _motor_pos = other._motor_pos;
654 _pos_ref = other._pos_ref;
661 _link_vel = other._motor_vel;
664 _link_vel = other._link_vel;
667 _motor_vel = other._motor_vel;
670 _vel_ref = other._vel_ref;
673 if(sync_acceleration){
675 _link_acc = other._link_acc;
681 _effort = other._effort;
684 _effort_ref = other._effort_ref;
688 _stiffness = other._stiffness;
692 _damping = other._damping;
700 _temperature = other._temperature;
706 template <
typename... SyncFlags>
709 if(_joint_name != other._joint_name){
710 std::cerr <<
"ERROR in " << __func__ <<
"! Attempt to set reference from joint with different name! " << std::endl;
714 bool sync_position =
false,
715 sync_velocity =
false,
716 sync_acceleration =
false,
718 sync_stiffness =
false,
719 sync_damping =
false,
722 sync_motor_side =
false;
740 _pos_ref = other._link_pos;
743 _vel_ref = other._link_vel;
746 _effort_ref = other._effort;
749 _stiffness = other._stiffness;
752 _damping = other._damping;
762 #endif // __JOINT_H__
void setVelocityReference(double vel_ref)
setter for the velocity reference
Definition: Joint.cpp:208
Kinematic chain abstraction as a set of joints and sensors.
Definition: KinematicChain.h:49
void setJointName(const std::string &joint_name)
Setter for the joint name.
Definition: Joint.cpp:96
std::ostream & operator<<(std::ostream &os, const XBot::Joint &j)
ostream operator << for a Joint object
Definition: Joint.cpp:322
void setJointAcceleration(double link_acc)
setter for the link side acceleration
Definition: Joint.cpp:162
Kinematic chain useful for a robot abstraction.
Definition: RobotChain.h:33
bool setReferenceFrom(const Joint &other, SyncFlags... flags)
Set the joint references (TX) from other joint state (RX)
Definition: Joint.h:707
bool checkEffortLimit(double tau) const
check that the param tau is below the joint effort limit
Definition: Joint.cpp:229
void setControlMode(const ControlMode &control_mode)
Definition: Joint.cpp:389
void print() const
Prints a pretty table about joint state.
Definition: Joint.cpp:269
void setMotorVelocity(double motor_vel)
setter for the motor side velocity
Definition: Joint.cpp:157
Definition: ControlMode.h:28
bool isVirtualJoint() const
return true if the joint is virtual
Definition: Joint.cpp:74
double getMotorVelocity() const
getter for the motor side velocity
Definition: Joint.cpp:121
double getJointAcceleration() const
getter for the link side acceleration
Definition: Joint.cpp:126
Joint()
Default constructor.
Definition: Joint.cpp:22
void setMotorPosition(double motor_pos)
setter for the motor side encoder reading
Definition: Joint.cpp:147
void enforceEffortLimit(double &tau) const
Definition: Joint.cpp:345
const std::string & getJointName() const
Getter for the joint name.
Definition: Joint.cpp:80
urdf::JointConstSharedPtr getUrdfJoint() const
Getter for the urdf Joint object.
Definition: Joint.cpp:406
void getControlMode(ControlMode &control_mode) const
Definition: Joint.cpp:384
double getVelocityReference() const
getter for the commanded velocity reference
Definition: Joint.cpp:183
double getDamping() const
get the commanded joint damping
Definition: Joint.cpp:198
bool checkVelocityLimit(double qdot) const
check that the param qdot is below the joint velocity limit
Definition: Joint.cpp:239
void setJointId(int joint_id)
Setter for the joint id.
Definition: Joint.cpp:101
std::shared_ptr< Joint > Ptr
Definition: Joint.h:53
void enforceJointLimits(double &q) const
Definition: Joint.cpp:358
void setDamping(double damping)
set the joint damping
Definition: Joint.cpp:223
void setTemperature(double temperature)
setter for the joint temperature
Definition: Joint.cpp:173
std::shared_ptr< const Joint > ConstPtr
Definition: Joint.h:54
void setJointVelocity(double link_vel)
setter for the link side velocity
Definition: Joint.cpp:152
void enforceVelocityLimit(double &qdot) const
Definition: Joint.cpp:371
bool checkJointLimits(double q) const
check that the param q is inside the position limits
Definition: Joint.cpp:234
void setPositionReference(double pos_ref)
setter for the motor position reference
Definition: Joint.cpp:203
friend std::ostream & operator<<(std::ostream &os, const XBot::Joint &j)
ostream operator << for a Joint object
void getEffortLimit(double &tau_max) const
Getter for the joint effort limit in the urdf.
Definition: Joint.cpp:245
double getStiffness() const
get the commanded joint stiffness
Definition: Joint.cpp:193
double getTemperature() const
getter for the joint temperature
Definition: Joint.cpp:136
double getJointEffort() const
getter for the joint effort (generalized force)
Definition: Joint.cpp:131
void getVelocityLimit(double &qdot_max) const
Getter for the joint velocity limit in the urdf.
Definition: Joint.cpp:256
double getJointPosition() const
getter for the link side encoder reading
Definition: Joint.cpp:106
void parseFlags(bool &pos, bool &vel, bool &acc, bool &eff, bool &k, bool &d, bool &ft, bool &imu, bool &motor_side, Sync s=Sync::All)
Definition: SyncFlags.h:27
double getPositionReference() const
getter for the commanded motor position reference
Definition: Joint.cpp:178
void setJointPosition(double link_pos)
Setter for the link side encoder reading.
Definition: Joint.cpp:142
bool isFixedControlledJoint() const
return true if the joint is specified fixed in the model, but inside the controlled_joints group of t...
Definition: Joint.cpp:394
double getEffortReference() const
getter for the commanded effort (generalized force) reference
Definition: Joint.cpp:188
Definition: RobotInterface.h:36
bool syncFrom(const Joint &other, SyncFlags... flags)
Synchronize the current Joint with another Joint object.
Definition: Joint.h:608
void setStiffness(double stiffness)
set the joint stiffness
Definition: Joint.cpp:218
void getJointLimits(double &qmin, double &qmax) const
Getter for the joint position limits in the urdf.
Definition: Joint.cpp:250
const std::string & getChainName() const
Getter for the parent chain name.
Definition: Joint.cpp:90
int getJointId() const
Getter for the joint id.
Definition: Joint.cpp:85
void setEffortReference(double effort_ref)
setter for the effort (generalized force) reference
Definition: Joint.cpp:213
double getMotorPosition() const
getter for the motor side encoder reading
Definition: Joint.cpp:111
Container for the Joint state and information.
Definition: Joint.h:47
double getJointVelocity() const
getter for the link side velocity
Definition: Joint.cpp:116
void setJointEffort(double effort)
setter for the joint effort (generalized force)
Definition: Joint.cpp:168
void printTracking() const
Prints a pretty table about joint tracking error.
Definition: Joint.cpp:291
Definition: IXBotModel.h:20
Definition: XBotInterface.h:41