XBotInterface  2.4.1
XBotInterface provides a generic API to model and control a robot.
KinematicChain.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 IIT-ADVR
3  * Author: Arturo Laurenzi, Luca Muratore
4  * email: arturo.laurenzi@iit.it, luca.muratore@iit.it
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>
18 */
19 
20 #ifndef __KINEMATIC_CHAIN_H__
21 #define __KINEMATIC_CHAIN_H__
22 
23 #include <string>
24 #include <vector>
25 #include <map>
26 #include <memory>
27 #include <iostream>
28 
29 #include <eigen3/Eigen/Dense>
30 
31 #include <XBotInterface/Joint.h>
35 // #include <XBotInterface/Hand.h>
36 
37 
38 namespace XBot
39 {
40 
41 // NOTE forward declaration because of friendship
42 class XBotInterface;
43 class RobotInterface;
44 
50 {
51 
52 public:
53 
54  typedef std::shared_ptr<KinematicChain> Ptr;
55  typedef std::shared_ptr<const KinematicChain> ConstPtr;
56 
57  friend XBot::XBotInterface;
58  friend XBot::RobotInterface;
59 
65 
72  KinematicChain(const std::string &chain_name,
73  const XBot::XBotCoreModel &XBotModel);
74 
80  explicit KinematicChain(const std::string& chain_name);
81 
87  KinematicChain(const KinematicChain &other);
88 
95 
103  bool getChainState(const std::string& state_name, JointIdMap& q) const;
104 
112  bool getChainState(const std::string& state_name, JointNameMap& q) const;
113 
114 
124  bool getChainState(const std::string& state_name, Eigen::VectorXd& q) const;
125 
132  std::map<std::string, ForceTorqueSensor::ConstPtr> getForceTorque() const;
133 
140  std::map<std::string, ImuSensor::ConstPtr> getImu() const;
141 
150  ForceTorqueSensor::ConstPtr getForceTorque(const std::string& parent_link_name) const;
151 
160  ImuSensor::ConstPtr getImu(const std::string& parent_link_name) const;
161 
162 
171  void getJointLimits(Eigen::VectorXd& q_min, Eigen::VectorXd& q_max) const;
172 
180  void getVelocityLimits(Eigen::VectorXd& qdot_max) const;
189  void getEffortLimits(Eigen::VectorXd& tau_max) const;
190 
200  void getJointLimits(int i, double& q_min, double& q_max) const;
201 
210  void getVelocityLimits(int i, double& qdot_max) const;
211 
220  void getEffortLimits(int i, double& tau_max) const;
221 
230  bool checkJointLimits(const Eigen::VectorXd& q,
231  std::vector<std::string>& violating_joints) const;
232 
241  bool checkVelocityLimits(const Eigen::VectorXd& qdot,
242  std::vector<std::string>& violating_joints) const;
243 
252  bool checkEffortLimits(const Eigen::VectorXd& tau,
253  std::vector<std::string>& violating_joints) const;
254 
261  bool checkJointLimits(const Eigen::VectorXd& q) const;
262 
269  bool checkVelocityLimits(const Eigen::VectorXd& qdot) const;
270 
277  bool checkEffortLimits(const Eigen::VectorXd& tau) const;
278 
285  bool enforceJointLimits(Eigen::VectorXd& q) const;
286 
293  bool enforceVelocityLimit(Eigen::VectorXd& qdot) const;
294 
301  bool enforceEffortLimit(Eigen::VectorXd& tau) const;
302 
313  bool mapToEigen(const JointIdMap& id_map, Eigen::VectorXd& eigen_vector) const;
314 
325  bool mapToEigen(const JointNameMap& name_map, Eigen::VectorXd& eigen_vector) const;
326 
336  bool eigenToMap(const Eigen::VectorXd& eigen_vector, JointIdMap& id_map) const;
337 
347  bool eigenToMap(const Eigen::VectorXd& eigen_vector, JointNameMap& name_map) const;
348 
355  void pushBackJoint(Joint::Ptr joint);
356 
363  void removeJoint(int i);
364 
370  bool isVirtual() const;
371 
377  const std::string &getChainName() const;
378 
384  const std::string &getBaseLinkName() const;
385 
391  const std::string &getTipLinkName() const;
392 
401  const std::string &getChildLinkName(int i) const;
402 
411  const std::string &getParentLinkName(int i) const;
412 
420  const std::string& getJointName(int i) const;
421 
422 
429  const std::vector<std::string>& getJointNames() const;
430 
438  int getJointId(int i) const;
439 
448  int getChainDofIndex(int joint_id) const;
449 
458  int getChainDofIndex(const std::string& joint_name) const;
459 
466  bool hasJoint(int joint_id) const;
467 
474  bool hasJoint(const std::string& joint_name) const;
475 
482  const std::vector<int>& getJointIds() const;
483 
491  int getJointNum() const;
492 
498  const std::vector< urdf::JointConstSharedPtr > &getUrdfJoints() const;
499 
505  const std::vector< urdf::LinkConstSharedPtr > &getUrdfLinks() const;
506 
507 
514  void shallowCopy(const KinematicChain& chain);
515 
522  Joint::ConstPtr getJoint(int i) const;
523 
524  // Getters for RX
525 
526  bool getJointPosition(Eigen::VectorXd &q) const;
527  bool getMotorPosition(Eigen::VectorXd &q) const;
528  bool getJointVelocity(Eigen::VectorXd &qdot) const;
529  bool getMotorVelocity(Eigen::VectorXd &qdot) const;
530  bool getJointAcceleration(Eigen::VectorXd &qddot) const;
531  bool getJointEffort(Eigen::VectorXd &tau) const;
532  bool getTemperature(Eigen::VectorXd &temp) const;
533 
534  bool getJointPosition(JointIdMap &q) const;
535  bool getMotorPosition(JointIdMap &q) const;
536  bool getJointVelocity(JointIdMap &qdot) const;
537  bool getMotorVelocity(JointIdMap &qdot) const;
538  bool getJointAcceleration(JointIdMap &qddot) const;
539  bool getJointEffort(JointIdMap &tau) const;
540  bool getTemperature(JointIdMap &temp) const;
541 
542  bool getJointPosition(JointNameMap &q) const;
543  bool getMotorPosition(JointNameMap &q) const;
544  bool getJointVelocity(JointNameMap &qdot) const;
545  bool getMotorVelocity(JointNameMap &qdot) const;
546  bool getJointAcceleration(JointNameMap &qddot) const;
547  bool getJointEffort(JointNameMap &tau) const;
548  bool getTemperature(JointNameMap &temp) const;
549 
550  double getJointPosition(int index) const;
551  double getMotorPosition(int index) const;
552  double getJointVelocity(int index) const;
553  double getMotorVelocity(int index) const;
554  double getJointAcceleration(int index) const;
555  double getJointEffort(int index) const;
556  double getTemperature(int index) const;
557 
558  // Setters for RX
559 
560  bool setJointPosition(const Eigen::VectorXd &q);
561  bool setMotorPosition(const Eigen::VectorXd &q);
562  bool setJointVelocity(const Eigen::VectorXd &qdot);
563  bool setMotorVelocity(const Eigen::VectorXd &qdot);
564  bool setJointAcceleration(const Eigen::VectorXd &qddot);
565  bool setJointEffort(const Eigen::VectorXd &tau);
566  bool setTemperature(const Eigen::VectorXd &temp);
567 
568  bool setJointPosition(const JointIdMap &q);
569  bool setMotorPosition(const JointIdMap &q);
570  bool setJointVelocity(const JointIdMap &qdot);
571  bool setMotorVelocity(const JointIdMap &qdot);
572  bool setJointAcceleration(const JointIdMap &qddot);
573  bool setJointEffort(const JointIdMap &tau);
574  bool setTemperature(const JointIdMap &temp);
575 
576  bool setJointPosition(const JointNameMap &q);
577  bool setMotorPosition(const JointNameMap &q);
578  bool setJointVelocity(const JointNameMap &qdot);
579  bool setMotorVelocity(const JointNameMap &qdot);
580  bool setJointAcceleration(const JointNameMap &qddot);
581  bool setJointEffort(const JointNameMap &tau);
582  bool setTemperature(const JointNameMap &temp);
583 
584  bool setJointPosition(int i, double q);
585  bool setMotorPosition(int i, double q);
586  bool setJointVelocity(int i, double qdot);
587  bool setMotorVelocity(int i, double qdot);
588  bool setJointAcceleration(int i, double qddot);
589  bool setJointEffort(int i, double tau);
590  bool setTemperature(int i, double temp);
591 
592  // Getters for TX
593 
594  bool getPositionReference(Eigen::VectorXd &q) const;
595  bool getVelocityReference(Eigen::VectorXd &qdot) const;
596  bool getEffortReference(Eigen::VectorXd &tau) const;
597  bool getStiffness(Eigen::VectorXd &K) const;
598  bool getDamping(Eigen::VectorXd &D) const;
599 
600  bool getPositionReference(JointIdMap &q) const;
601  bool getVelocityReference(JointIdMap &qdot) const;
602  bool getEffortReference(JointIdMap &tau) const;
603  bool getStiffness(JointIdMap &K) const;
604  bool getDamping(JointIdMap &D) const;
605 
606  bool getPositionReference(JointNameMap &q) const;
607  bool getVelocityReference(JointNameMap &qdot) const;
608  bool getEffortReference(JointNameMap &tau) const;
609  bool getStiffness(JointNameMap &K) const;
610  bool getDamping(JointNameMap &D) const;
611 
612  double getPositionReference(int index) const;
613  double getVelocityReference(int index) const;
614  double getEffortReference(int index) const;
615  double getStiffness(int index) const;
616  double getDamping(int index) const;
617 
618  // Setters for TX
619 
620  bool setPositionReference(const Eigen::VectorXd &q);
621  bool setVelocityReference(const Eigen::VectorXd &qdot);
622  bool setEffortReference(const Eigen::VectorXd &tau);
623  bool setStiffness(const Eigen::VectorXd &K);
624  bool setDamping(const Eigen::VectorXd &D);
625 
626  bool setPositionReference(const JointIdMap &q);
627  bool setVelocityReference(const JointIdMap &qdot);
628  bool setEffortReference(const JointIdMap &tau);
629  bool setStiffness(const JointIdMap &K);
630  bool setDamping(const JointIdMap &D);
631 
632  bool setPositionReference(const JointNameMap &q);
633  bool setVelocityReference(const JointNameMap &qdot);
634  bool setEffortReference(const JointNameMap &tau);
635  bool setStiffness(const JointNameMap &K);
636  bool setDamping(const JointNameMap &D);
637 
638  bool setPositionReference(int i, double q);
639  bool setVelocityReference(int i, double qdot);
640  bool setEffortReference(int i, double tau);
641  bool setStiffness(int i, double K);
642  bool setDamping(int i, double D);
643 
662  template <typename... SyncFlags>
663  bool syncFrom(const KinematicChain& other, SyncFlags... flags);
664 
670  void print() const;
671 
677  void printTracking() const;
678 
679  friend std::ostream& operator<<(std::ostream& os, const XBot::KinematicChain& c);
680 
681 
682 
683 protected:
684 
685  std::map<std::string, XBot::Joint::Ptr> _joint_name_map;
686  std::map<int, XBot::Joint::Ptr> _joint_id_map;
687  std::vector<XBot::Joint::Ptr> _joint_vector;
688 
689  std::vector<ForceTorqueSensor::Ptr> _ft_vector;
690  std::map<std::string, ForceTorqueSensor::Ptr> _ft_map;
691 
692  std::vector<ImuSensor::Ptr> _imu_vector;
693  std::map<std::string, ImuSensor::Ptr> _imu_map;
694 // std::map<std::string, Hand::Ptr> _hand_map;
695 
702  Joint::Ptr getJointInternal(int i) const;
703 
704  std::map< std::string, ForceTorqueSensor::Ptr > getForceTorqueInternal() const;
705  std::map< std::string, ImuSensor::Ptr > getImuInternal() const;
706 
707 
708 private:
709 
710 
711  std::vector<urdf::JointConstSharedPtr> _urdf_joints;
712  std::vector<urdf::LinkConstSharedPtr> _urdf_links;
713 
714  std::vector<std::string> _ordered_joint_name;
715  std::vector<int> _ordered_joint_id;
716 
717  XBot::XBotCoreModel _XBotModel;
718 
719  std::string _chain_name;
720  int _joint_num;
721 
722  bool _is_virtual;
723 
724  XBot::Joint::Ptr getJointByName(const std::string& joint_name);
725  XBot::Joint::ConstPtr getJointByName(const std::string& joint_name) const;
726  XBot::Joint::ConstPtr getJointById(int joint_id) const;
727 
728 
729 };
730 
731 std::ostream& operator<<(std::ostream& os, const XBot::KinematicChain& c);
732 
733 template <typename... SyncFlags>
734 bool KinematicChain::syncFrom(const KinematicChain &other, SyncFlags... flags)
735 {
736 
737  for (const XBot::Joint::Ptr & j : other._joint_vector) {
738 
739  if(hasJoint(j->getJointName())){
740  auto this_joint = getJointByName(j->getJointName());
741  this_joint->syncFrom(*j, flags...);
742  }
743  }
744 
745  return true;
746 }
747 
748 }
749 
750 #endif // __KINEMATIC_CHAIN_H__
XBot::KinematicChain::getVelocityLimits
void getVelocityLimits(Eigen::VectorXd &qdot_max) const
Gets a vector of the chain joint velocity limits, as specified in the URDF file.
Definition: KinematicChain.cpp:1661
XBot::KinematicChain::getJointVelocity
bool getJointVelocity(Eigen::VectorXd &qdot) const
Definition: KinematicChain.cpp:715
XBot::KinematicChain::getJointEffort
bool getJointEffort(Eigen::VectorXd &tau) const
Definition: KinematicChain.cpp:691
XBot::KinematicChain::enforceJointLimits
bool enforceJointLimits(Eigen::VectorXd &q) const
Modifies the input joint position vector by enforcing joint limits.
Definition: KinematicChain.cpp:2074
XBot::KinematicChain::getJoint
Joint::ConstPtr getJoint(int i) const
Getter for the i-th Joint Ptr.
Definition: KinematicChain.cpp:1794
XBot::KinematicChain
Kinematic chain abstraction as a set of joints and sensors.
Definition: KinematicChain.h:49
XBot::KinematicChain::setMotorPosition
bool setMotorPosition(const Eigen::VectorXd &q)
Definition: KinematicChain.cpp:975
XBot::operator<<
std::ostream & operator<<(std::ostream &os, const XBot::Joint &j)
ostream operator << for a Joint object
Definition: Joint.cpp:322
XBot::KinematicChain::KinematicChain
KinematicChain()
Default constructor.
Definition: KinematicChain.cpp:29
XBot::KinematicChain::getForceTorque
std::map< std::string, ForceTorqueSensor::ConstPtr > getForceTorque() const
Getter for the force-torque sensor map pertaining to the chain.
Definition: KinematicChain.cpp:1818
XBot::KinematicChain::setEffortReference
bool setEffortReference(const Eigen::VectorXd &tau)
Definition: KinematicChain.cpp:922
XBot::KinematicChain::getEffortReference
bool getEffortReference(Eigen::VectorXd &tau) const
Definition: KinematicChain.cpp:703
XBot::KinematicChain::isVirtual
bool isVirtual() const
Method for determining whether a chain is virtual, i.e.
Definition: KinematicChain.cpp:231
XBot::KinematicChain::getVelocityReference
bool getVelocityReference(Eigen::VectorXd &qdot) const
Definition: KinematicChain.cpp:788
XBot::KinematicChain::print
void print() const
Prints a pretty table about chain state.
Definition: KinematicChain.cpp:2001
XBot::JointIdMap
std::unordered_map< int, double > JointIdMap
std::map with key representing the joint ID (i.e.
Definition: TypedefAndEnums.h:33
XBot::KinematicChain::getChainName
const std::string & getChainName() const
Method returning the name of the chain.
Definition: KinematicChain.cpp:284
XBot::KinematicChain::getForceTorqueInternal
std::map< std::string, ForceTorqueSensor::Ptr > getForceTorqueInternal() const
Definition: KinematicChain.cpp:1827
XBot::KinematicChain::enforceEffortLimit
bool enforceEffortLimit(Eigen::VectorXd &tau) const
Modifies the input joint effort vector by enforcing effort limits.
Definition: KinematicChain.cpp:2060
XBot::KinematicChain::setPositionReference
bool setPositionReference(const Eigen::VectorXd &q)
Definition: KinematicChain.cpp:1001
XBot::KinematicChain::setVelocityReference
bool setVelocityReference(const Eigen::VectorXd &qdot)
Definition: KinematicChain.cpp:1040
XBot::KinematicChain::getJointNum
int getJointNum() const
Method returning the number of enabled joints belonging to the chain.
Definition: KinematicChain.cpp:269
XBot::ForceTorqueSensor::ConstPtr
std::shared_ptr< const ForceTorqueSensor > ConstPtr
Definition: ForceTorqueSensor.h:46
XBot::KinematicChain::setJointPosition
bool setJointPosition(const Eigen::VectorXd &q)
Definition: KinematicChain.cpp:895
XBot::KinematicChain::ConstPtr
std::shared_ptr< const KinematicChain > ConstPtr
Definition: KinematicChain.h:55
XBot::KinematicChain::getJointName
const std::string & getJointName(int i) const
Method returning the name of the i-th joint of the chain.
Definition: KinematicChain.cpp:305
XBot::KinematicChain::getMotorVelocity
bool getMotorVelocity(Eigen::VectorXd &qdot) const
Definition: KinematicChain.cpp:752
XBot::JointNameMap
std::unordered_map< std::string, double > JointNameMap
std::map with key representing the joint human-readable name and value representing a joint state (e....
Definition: TypedefAndEnums.h:51
XBot::KinematicChain::getUrdfLinks
const std::vector< urdf::LinkConstSharedPtr > & getUrdfLinks() const
Method returning the vector of urdf::Links corresponding to the chain.
Definition: KinematicChain.cpp:264
XBot::KinematicChain::getJointNames
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.
Definition: KinematicChain.cpp:1577
XBot::KinematicChain::getParentLinkName
const std::string & getParentLinkName(int i) const
Method returning the name of the parent link corresponding to the i-th joint of the chain.
Definition: KinematicChain.cpp:300
XBot::KinematicChain::getJointLimits
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.
Definition: KinematicChain.cpp:1643
XBot::KinematicChain::_joint_name_map
std::map< std::string, XBot::Joint::Ptr > _joint_name_map
Definition: KinematicChain.h:685
XBot::KinematicChain::getImuInternal
std::map< std::string, ImuSensor::Ptr > getImuInternal() const
Definition: KinematicChain.cpp:1860
Joint.h
XBot::KinematicChain::Ptr
std::shared_ptr< KinematicChain > Ptr
Definition: KinematicChain.h:54
XBot::Joint::Ptr
std::shared_ptr< Joint > Ptr
Definition: Joint.h:53
XBot::KinematicChain::getUrdfJoints
const std::vector< urdf::JointConstSharedPtr > & getUrdfJoints() const
Method returning the vector of urdf::Joints corresponding to the chain.
Definition: KinematicChain.cpp:259
XBot::KinematicChain::setJointEffort
bool setJointEffort(const Eigen::VectorXd &tau)
Definition: KinematicChain.cpp:909
XBot::KinematicChain::getTemperature
bool getTemperature(Eigen::VectorXd &temp) const
Definition: KinematicChain.cpp:776
XBot::KinematicChain::checkEffortLimits
bool checkEffortLimits(const Eigen::VectorXd &tau, std::vector< std::string > &violating_joints) const
Check the input joint effort vector against joint limits.
Definition: KinematicChain.cpp:1689
XBot::KinematicChain::setMotorVelocity
bool setMotorVelocity(const Eigen::VectorXd &qdot)
Definition: KinematicChain.cpp:988
XBot::KinematicChain::pushBackJoint
void pushBackJoint(Joint::Ptr joint)
add a joint in the kinematic chain pushing it in the end of the chain
Definition: KinematicChain.cpp:237
XBot::KinematicChain::checkVelocityLimits
bool checkVelocityLimits(const Eigen::VectorXd &qdot, std::vector< std::string > &violating_joints) const
Check the input joint velocity vector against joint limits.
Definition: KinematicChain.cpp:1750
XBot::KinematicChain::operator=
KinematicChain & operator=(const KinematicChain &rhs)
Custom copy assignment, which guarantees independence between copies by performing a deep copy.
Definition: KinematicChain.cpp:187
ImuSensor.h
XBot::KinematicChain::setJointVelocity
bool setJointVelocity(const Eigen::VectorXd &qdot)
Definition: KinematicChain.cpp:948
XBot::KinematicChain::getDamping
bool getDamping(Eigen::VectorXd &D) const
Definition: KinematicChain.cpp:679
XBot::Joint::ConstPtr
std::shared_ptr< const Joint > ConstPtr
Definition: Joint.h:54
XBot::KinematicChain::printTracking
void printTracking() const
Prints a pretty table about chain tracking.
Definition: KinematicChain.cpp:2025
XBot::KinematicChain::mapToEigen
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...
Definition: KinematicChain.cpp:2151
XBot::KinematicChain::getJointPosition
bool getJointPosition(Eigen::VectorXd &q) const
Definition: KinematicChain.cpp:316
XBot::KinematicChain::_joint_id_map
std::map< int, XBot::Joint::Ptr > _joint_id_map
Definition: KinematicChain.h:686
XBot::KinematicChain::syncFrom
bool syncFrom(const KinematicChain &other, SyncFlags... flags)
Synchronize the current KinematicChain with another KinematicChain object.
Definition: KinematicChain.h:734
XBot::KinematicChain::getChildLinkName
const std::string & getChildLinkName(int i) const
Method returning the name of the child link corresponding to the i-th joint of the chain.
Definition: KinematicChain.cpp:295
XBot::KinematicChain::getPositionReference
bool getPositionReference(Eigen::VectorXd &q) const
Definition: KinematicChain.cpp:500
XBot::KinematicChain::_ft_vector
std::vector< ForceTorqueSensor::Ptr > _ft_vector
Definition: KinematicChain.h:689
ForceTorqueSensor.h
XBot::KinematicChain::getJointId
int getJointId(int i) const
Method returning the ID of the i-th joint of the chain.
Definition: KinematicChain.cpp:289
XBot::KinematicChain::checkJointLimits
bool checkJointLimits(const Eigen::VectorXd &q, std::vector< std::string > &violating_joints) const
Check the input joint position vector against joint limits.
Definition: KinematicChain.cpp:1720
XBot::XBotCoreModel
Definition: XBotCoreModel.h:40
XBot::KinematicChain::getMotorPosition
bool getMotorPosition(Eigen::VectorXd &q) const
Definition: KinematicChain.cpp:740
XBot::KinematicChain::operator<<
friend std::ostream & operator<<(std::ostream &os, const XBot::KinematicChain &c)
Definition: KinematicChain.cpp:1563
XBot::KinematicChain::getEffortLimits
void getEffortLimits(Eigen::VectorXd &tau_max) const
Gets a vector of the chain joint effort limits, as specified in the URDF file.
Definition: KinematicChain.cpp:1628
XBot::KinematicChain::setTemperature
bool setTemperature(const Eigen::VectorXd &temp)
Definition: KinematicChain.cpp:1027
XBot::KinematicChain::removeJoint
void removeJoint(int i)
remove the i-th joint in the kinematic chain
Definition: KinematicChain.cpp:249
XBot::KinematicChain::getJointInternal
Joint::Ptr getJointInternal(int i) const
Getter for the i-th Joint Ptr.
Definition: KinematicChain.cpp:1784
XBot::KinematicChain::getChainDofIndex
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 ...
Definition: KinematicChain.cpp:1990
XBot::KinematicChain::getJointAcceleration
bool getJointAcceleration(Eigen::VectorXd &qddot) const
Definition: KinematicChain.cpp:727
XBot::KinematicChain::_ft_map
std::map< std::string, ForceTorqueSensor::Ptr > _ft_map
Definition: KinematicChain.h:690
XBot::KinematicChain::getTipLinkName
const std::string & getTipLinkName() const
Method returning the name of the chain tip link.
Definition: KinematicChain.cpp:279
XBot::KinematicChain::setJointAcceleration
bool setJointAcceleration(const Eigen::VectorXd &qddot)
Definition: KinematicChain.cpp:961
XBot::RobotInterface
Definition: RobotInterface.h:36
XBot::KinematicChain::_joint_vector
std::vector< XBot::Joint::Ptr > _joint_vector
Definition: KinematicChain.h:687
XBot::KinematicChain::enforceVelocityLimit
bool enforceVelocityLimit(Eigen::VectorXd &qdot) const
Modifies the input joint velcoity vector by enforcing joint limits.
Definition: KinematicChain.cpp:2088
XBotCoreModel.h
XBot::KinematicChain::setStiffness
bool setStiffness(const Eigen::VectorXd &K)
Definition: KinematicChain.cpp:1014
XBot::KinematicChain::getImu
std::map< std::string, ImuSensor::ConstPtr > getImu() const
Getter for the IMU sensor map pertaining to the chain.
Definition: KinematicChain.cpp:1851
XBot::KinematicChain::getJointIds
const std::vector< int > & getJointIds() const
Returns a vector containing the IDs of all joints in the chain, from base link to tip link.
Definition: KinematicChain.cpp:1572
XBot::KinematicChain::shallowCopy
void shallowCopy(const KinematicChain &chain)
Updates the current object (this) by performing a shallow copy with the chain passed as argument.
Definition: KinematicChain.cpp:215
XBot::KinematicChain::getChainState
bool getChainState(const std::string &state_name, JointIdMap &q) const
Gets the chain joints group state configuration as specified in the robot SRDF.
Definition: KinematicChain.cpp:1942
XBot::ImuSensor::ConstPtr
std::shared_ptr< const ImuSensor > ConstPtr
Definition: ImuSensor.h:33
XBot::KinematicChain::getBaseLinkName
const std::string & getBaseLinkName() const
Method returning the name of the chain base link.
Definition: KinematicChain.cpp:274
XBot
Definition: IXBotModel.h:20
XBot::KinematicChain::setDamping
bool setDamping(const Eigen::VectorXd &D)
Definition: KinematicChain.cpp:935
XBot::KinematicChain::eigenToMap
bool eigenToMap(const Eigen::VectorXd &eigen_vector, JointIdMap &id_map) const
Converts a state vector for the whole chain to its JointIdMap representation.
Definition: KinematicChain.cpp:2117
XBot::KinematicChain::getStiffness
bool getStiffness(Eigen::VectorXd &K) const
Definition: KinematicChain.cpp:764
XBot::KinematicChain::hasJoint
bool hasJoint(int joint_id) const
check if the chain has a joint with a certain id
Definition: KinematicChain.cpp:1623
XBot::KinematicChain::_imu_map
std::map< std::string, ImuSensor::Ptr > _imu_map
Definition: KinematicChain.h:693
XBot::XBotInterface
Definition: XBotInterface.h:41
XBot::KinematicChain::_imu_vector
std::vector< ImuSensor::Ptr > _imu_vector
Definition: KinematicChain.h:692