00001 /***************************************************************************/ 00008 #ifndef ROBOTURDF_H_ 00009 #define ROBOTURDF_H_ 00010 00011 #include "robodyn_controllers/Robot.h" 00012 #include "tinyxml.h" 00013 #include <map> 00014 #include <stdexcept> 00015 #include <kdl_parser/kdl_parser.hpp> 00016 00017 /***************************************************************************/ 00023 class RobotURDF : public Robot 00024 { 00025 public: 00026 RobotURDF(const std::string& filename, const std::string& rootLink); 00027 virtual ~RobotURDF(); 00028 00029 private: 00030 struct Joint 00031 { 00032 KDL::Joint::JointType type; 00033 std::string parent; 00034 std::string child; 00035 KDL::Frame frame; 00036 }; 00037 00038 typedef std::map<std::string, KDL::RigidBodyInertia> LinkMap; 00039 typedef std::map<std::string, Joint> JointMap; 00040 00041 void parseFile(const std::string& filename, const std::string& rootLink); 00042 00043 // void parseLink(TiXmlElement *element); 00044 void parseJoint(TiXmlElement* element); 00045 00046 // void getChildJoints(std::string parent_name, JointMap *joints); 00047 00048 // void buildTree(KDL::Chain& chain, const std::string chain_name, const std::string chain_hook, 00049 // const std::string joint_name, const Joint& basej); 00050 00051 // LinkMap linkMap; 00052 // JointMap jointMap; 00053 }; 00054 00055 00056 #endif /* ROBOTURDF_H_ */