Link.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
3  * All rights reserved. This program is made available under the terms of the
4  * Eclipse Public License v1.0 which accompanies this distribution, and is
5  * available at http://www.eclipse.org/legal/epl-v10.html
6  * Contributors:
7  * National Institute of Advanced Industrial Science and Technology (AIST)
8  */
14 #ifndef HRPMODEL_LINK_H_INCLUDED
15 #define HRPMODEL_LINK_H_INCLUDED
16 
17 #include <string>
18 #include <ostream>
19 #include <vector>
20 #include <boost/intrusive_ptr.hpp>
21 #include <hrpUtil/Eigen3d.h>
23 #include "Config.h"
24 
25 namespace hrp {
26  class Link;
27 }
28 
29 HRPMODEL_API std::ostream& operator<<(std::ostream &out, hrp::Link& link);
30 
31 namespace hrp {
32 
33  class Body;
34  class Sensor;
35  class Light;
36 
37  class ColdetModel;
38  typedef boost::intrusive_ptr<ColdetModel> ColdetModelPtr;
39 
40  class HRPMODEL_API Link {
41 
42  public:
43 
44  Link();
45  Link(const Link& link);
46  virtual ~Link();
47 
48  bool isValid() { return (index >= 0); }
49  void addChild(Link* link);
50  bool detachChild(Link* link);
51  bool isRoot() { return !parent; }
52 
53  void setAttitude(const Matrix33& R) { this->R = R * Rs.transpose(); }
54  Matrix33 attitude() { return Matrix33(this->R * Rs); }
55  Matrix33 calcRfromAttitude(const Matrix33& R) { return Matrix33(R * Rs.transpose()); }
56 
61  void calcSubMassCM();
62 
67  void calcSubMassInertia(Matrix33& subIw);
68 
72  void setSegmentAttitude(const Matrix33& R) { this->R = R * Rs.transpose(); }
73 
77  Matrix33 segmentAttitude() { return Matrix33(this->R * Rs); }
78 
80  coldetModel->setPosition(R, p);
81  }
82 
84 
85  int index;
86  int jointId;
87 
88  std::string name;
89 
90  enum JointType {
94  SLIDE_JOINT
95  };
96 
98 
102 
104 
114 
119 
120  double q;
121  double dq;
122  double ddq;
123  double u;
124 
128 
130 
131  double m;
135 
138 
142 
146 
149 
152 
153  // needed ?
154  //Vector3 f; ///< force from the parent link
155  //Vector3 tau; ///< torque from the parent link
156 
164  double uu;
165  double dd;
166 
167  double Jm2;
168 
169  double ulimit;
170  double llimit;
171  double uvlimit;
172  double lvlimit;
173  double climit;
174 
176  double torqueConst;
177  double encoderPulse;
178  double Ir;
179  double gearRatio;
182 
184  bool isCrawler;
185 
186  ColdetModelPtr coldetModel;
187 
191  };
192 
193  typedef std::vector<ConstraintForce> ConstraintForceArray;
194  ConstraintForceArray constraintForces;
195 
196  double subm;
198  std::vector<Sensor *> sensors;
199  std::vector<Light *> lights;
200  private:
201 
202  Link& operator=(const Link& link); // no implementation is given to disable the copy operator
203  void setBodyIter(Body* body);
204  friend std::ostream& ::operator<<(std::ostream &out, hrp::Link& link);
205  void putInformation(std::ostream& out); // for the iostream output
206  };
207 
208 };
209 
210 
211 #endif
Eigen::Vector3d Vector3
Definition: EigenTypes.h:11
Eigen::Matrix3d Matrix33
Definition: EigenTypes.h:12
list index
Definition: Body.h:44
boost::intrusive_ptr< ColdetModel > ColdetModelPtr
Definition: ColdetModel.h:268


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sat Apr 13 2019 02:14:23