XBotInterface  2.4.1
XBotInterface provides a generic API to model and control a robot.
RobotChain.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 
21 #ifndef _XBOT_ROBOTCHAIN_H_
22 #define _XBOT_ROBOTCHAIN_H_
23 
26 
27 namespace XBot {
28 
33 class RobotChain : public KinematicChain {
34 
35 public:
36 
37  typedef std::shared_ptr<RobotChain> Ptr;
38 
39  RobotChain();
40 
41 
42  // Getters for RX
43 
50 
51 
52  // Getters for TX
53 
59 
60  // Setters for TX
61 
67 
86  template <typename... SyncFlags>
87  bool setReferenceFrom(const ModelChain& model_chain, SyncFlags... flags);
88 
89 
90 protected:
91 
92 private:
93 
96 
97  // Setters for RX
98 
105 
108 
109 
110 
111 };
112 
113 template <typename... SyncFlags>
114 bool RobotChain::setReferenceFrom(const ModelChain& other, SyncFlags... flags)
115 {
116  int pos = 0;
117  for (const XBot::Joint::Ptr & j : other._joint_vector) {
118  _joint_vector[pos++]->setReferenceFrom(*j, flags...);
119  }
120 
121  return true;
122 }
123 
124 } // end namespace XBot
125 #endif
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
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::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::RobotChain
Kinematic chain useful for a robot abstraction.
Definition: RobotChain.h:33
XBot::KinematicChain::getVelocityReference
bool getVelocityReference(Eigen::VectorXd &qdot) const
Definition: KinematicChain.cpp:788
KinematicChain.h
XBot::KinematicChain::setPositionReference
bool setPositionReference(const Eigen::VectorXd &q)
Definition: KinematicChain.cpp:1001
ModelChain.h
XBot::KinematicChain::setVelocityReference
bool setVelocityReference(const Eigen::VectorXd &qdot)
Definition: KinematicChain.cpp:1040
XBot::KinematicChain::setJointPosition
bool setJointPosition(const Eigen::VectorXd &q)
Definition: KinematicChain.cpp:895
XBot::KinematicChain::getMotorVelocity
bool getMotorVelocity(Eigen::VectorXd &qdot) const
Definition: KinematicChain.cpp:752
XBot::Joint::Ptr
std::shared_ptr< Joint > Ptr
Definition: Joint.h:53
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::RobotChain::Ptr
std::shared_ptr< RobotChain > Ptr
Definition: RobotChain.h:37
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::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::KinematicChain::getJointPosition
bool getJointPosition(Eigen::VectorXd &q) const
Definition: KinematicChain.cpp:316
XBot::KinematicChain::syncFrom
bool syncFrom(const KinematicChain &other, SyncFlags... flags)
Synchronize the current KinematicChain with another KinematicChain object.
Definition: KinematicChain.h:734
XBot::KinematicChain::getPositionReference
bool getPositionReference(Eigen::VectorXd &q) const
Definition: KinematicChain.cpp:500
XBot::KinematicChain::getMotorPosition
bool getMotorPosition(Eigen::VectorXd &q) const
Definition: KinematicChain.cpp:740
XBot::KinematicChain::setTemperature
bool setTemperature(const Eigen::VectorXd &temp)
Definition: KinematicChain.cpp:1027
XBot::KinematicChain::getJointAcceleration
bool getJointAcceleration(Eigen::VectorXd &qddot) const
Definition: KinematicChain.cpp:727
XBot::KinematicChain::setJointAcceleration
bool setJointAcceleration(const Eigen::VectorXd &qddot)
Definition: KinematicChain.cpp:961
XBot::RobotChain::RobotChain
RobotChain()
Definition: RobotChain.cpp:24
XBot::KinematicChain::_joint_vector
std::vector< XBot::Joint::Ptr > _joint_vector
Definition: KinematicChain.h:687
XBot::RobotChain::setReferenceFrom
bool setReferenceFrom(const ModelChain &model_chain, SyncFlags... flags)
Setter for the robot chain references using a model chain.
Definition: RobotChain.h:114
XBot::KinematicChain::setStiffness
bool setStiffness(const Eigen::VectorXd &K)
Definition: KinematicChain.cpp:1014
XBot::ModelChain
Kinematic chain useful for a model abstraction.
Definition: ModelChain.h:34
XBot
Definition: IXBotModel.h:20
XBot::KinematicChain::setDamping
bool setDamping(const Eigen::VectorXd &D)
Definition: KinematicChain.cpp:935
XBot::KinematicChain::getStiffness
bool getStiffness(Eigen::VectorXd &K) const
Definition: KinematicChain.cpp:764