Klamp't  0.8.1
URDFConverter.h
1 /*
2  * URDFConverter.h
3  *
4  * Created on: Mar 10, 2013
5  * Author: yajia
6  */
7 
8 #ifndef URDFCONVERTER_H_
9 #define URDFCONVERTER_H_
10 
11 #include <vector>
12 #include <KrisLibrary/math3d/primitives.h>
13 #include "Modeling/Robot.h"
14 #include "urdf_link.h"
15 using namespace std;
16 using namespace Math3D;
17 
18 class URDFLinkNode {
19 public:
20  URDFLinkNode(std::shared_ptr<urdf::Link>& link, int index, int index_parent);
21  void GetTransformations();
22  void GetGeometryProperty(bool useVisGeom=false);
23  void GetJoint();
24  std::shared_ptr<urdf::Link> link;
25  int index;
26  int index_parent;
27  RigidTransform T_link_to_inertia;
28  RigidTransform T_link_to_inertia_inverse;
29  RigidTransform T_link_to_visgeom;
30  RigidTransform T_link_to_colgeom;
31  RigidTransform T_parent;
32  Vector3 axis;
33  bool geomPrimitive;
34  string geomName;
35  string geomData; //Stores the primitive data if it's a primitive
36  Matrix4 geomScale;
37  urdf::Joint* joint;
38 };
39 
41 public:
42  static int GetLinkIndexfromName(string name, const vector<string> linknames);
43  static RobotJoint::Type jointType_URDF2ROB(int );
44  static void DFSLinkTree( URDFLinkNode& root, vector<URDFLinkNode>& linkNodes);
45  static void setJointforNodes(vector< std::shared_ptr<urdf::Joint> >& joints, vector<URDFLinkNode>& linkNodes);
46  static Math3D::Matrix3 convertInertial( urdf::Inertial& I);
47  static void QuatToRotationMat(const Vector4& aa, Matrix3& mat);
48  static void processTParentTransformations(vector<URDFLinkNode>& linkNodes);
49 
50  //The location for package:// directives
51  static string packageRootPath;
52  //Set this to true if visualization geometry should be used
53  static bool useVisGeom;
54  //Set this to true if the geometry Y-Z plane should be flipped
55  static bool flipYZ;
56 };
57 
58 #endif /* URDFCONVERTER_H_ */
Definition: URDFConverter.h:18
Definition: URDFConverter.h:40
Type
Definition: Robot.h:24
Definition: urdf_link.h:159
Definition: urdf_joint.h:169