Klamp't  0.9.0
URDFConverter.h
1 /*
2  * URDFConverter.h
3  *
4  * Created on: Mar 10, 2013
5  * Author: yajia
6  */
7 
8 #ifndef KLAMPT_IO_URDFCONVERTER_H
9 #define KLAMPT_IO_URDFCONVERTER_H
10 
11 #include <vector>
12 #include <KrisLibrary/math3d/primitives.h>
13 #include "Modeling/Robot.h"
14 #include "urdf_link.h"
15 
16 namespace Klampt {
17  using namespace std;
18  using namespace Math3D;
19 
20 class URDFLinkNode {
21 public:
22  URDFLinkNode(std::shared_ptr<urdf::Link>& link, int index, int index_parent);
23  void GetTransformations();
24  void GetGeometryProperty(bool useVisGeom=false);
25  void GetJoint();
26  std::shared_ptr<urdf::Link> link;
27  int index;
28  int index_parent;
29  RigidTransform T_link_to_inertia;
30  RigidTransform T_link_to_inertia_inverse;
31  RigidTransform T_link_to_visgeom;
32  RigidTransform T_link_to_colgeom;
33  RigidTransform T_parent;
34  Vector3 axis;
35  string geomName; //if empty, the geometry is loaded in geomData
36  Geometry::AnyGeometry3D geomData;
37  Matrix4 geomScale;
38  urdf::Joint* joint;
39 };
40 
42 public:
43  static int GetLinkIndexfromName(string name, const vector<string> linknames);
44  static RobotModelJoint::Type jointType_URDF2ROB(int );
45  static void DFSLinkTree( URDFLinkNode& root, vector<URDFLinkNode>& linkNodes);
46  static void setJointforNodes(vector< std::shared_ptr<urdf::Joint> >& joints, vector<URDFLinkNode>& linkNodes);
47  static Math3D::Matrix3 convertInertial( urdf::Inertial& I);
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 } //namespace Klampt
59 
60 #endif /* URDFCONVERTER_H_ */
Definition: URDFConverter.h:41
Type
Definition: Robot.h:28
Definition: URDFConverter.h:20
Definition: urdf_link.h:159
Definition: urdf_joint.h:169
Definition: ContactDistance.h:6