17 #include <boost/shared_ptr.hpp>
18 #include <Ravelin/VectorNd.h>
19 #include <Ravelin/MatrixNd.h>
24 class SpherePrimitive;
25 class CylinderPrimitive;
26 class TriangleMeshPrimitive;
29 class RCArticulatedBody;
30 class MCArticulatedBody;
37 static bool read(
const std::string& fname, std::string& name, std::vector<RigidBodyPtr>& links, std::vector<JointPtr>& joints);
46 for (std::map<RigidBodyPtr, void*>::const_iterator i = visual_transform_nodes.begin(); i != visual_transform_nodes.end(); i++)
47 ((osg::Node*) i->second)->unref();
51 std::map<RigidBodyPtr, void*> visual_transform_nodes;
52 std::map<JointPtr, RigidBodyPtr> joint_parent, joint_child;
53 std::map<std::string, std::pair<Ravelin::VectorNd, std::string> > materials;
54 std::map<RigidBodyPtr, boost::shared_ptr<Ravelin::Pose3d> > visualization_poses;
55 std::map<CollisionGeometryPtr, boost::shared_ptr<Ravelin::Pose3d> > collision_poses;
56 std::map<RigidBodyPtr, boost::shared_ptr<Ravelin::Pose3d> > inertial_poses;
59 static void find_outboards(
const URDFData& data,
RigidBodyPtr link, std::vector<std::pair<JointPtr, RigidBodyPtr> >& outboards, std::map<RigidBodyPtr, RigidBodyPtr>& parents);
60 static void output_data(
const URDFData& data,
RigidBodyPtr link);
62 static void find_children(
const URDFData& data,
RigidBodyPtr link, std::queue<RigidBodyPtr>& q, std::map<RigidBodyPtr, RigidBodyPtr>& parents);
63 static bool read_texture(boost::shared_ptr<const XMLTree> node, URDFData& data, std::string& fname);
64 static bool read_color(boost::shared_ptr<const XMLTree> node, URDFData& data, Ravelin::VectorNd& color);
65 static void read_material(boost::shared_ptr<const XMLTree> node, URDFData& data,
void* osg_node);
66 static PrimitivePtr read_primitive(boost::shared_ptr<const XMLTree> node, URDFData& data);
68 static boost::shared_ptr<SpherePrimitive> read_sphere(boost::shared_ptr<const XMLTree> node, URDFData& data);
69 static boost::shared_ptr<BoxPrimitive> read_box(boost::shared_ptr<const XMLTree> node, URDFData& data);
70 static boost::shared_ptr<CylinderPrimitive> read_cylinder(boost::shared_ptr<const XMLTree> node, URDFData& data);
71 static Ravelin::Matrix3d read_inertia(boost::shared_ptr<const XMLTree> node, URDFData& data);
72 static double read_mass(boost::shared_ptr<const XMLTree> node, URDFData& data);
73 static Ravelin::Pose3d read_origin(boost::shared_ptr<const XMLTree> node, URDFData& data);
74 static void read_collision(boost::shared_ptr<const XMLTree> node, URDFData& data,
RigidBodyPtr link);
75 static void read_visual(boost::shared_ptr<const XMLTree> node, URDFData& data,
RigidBodyPtr link);
76 static void read_inertial(boost::shared_ptr<const XMLTree> node, URDFData& data,
RigidBodyPtr link);
77 static void read_safety_controller(boost::shared_ptr<const XMLTree> node, URDFData& data,
JointPtr joint);
78 static void read_calibration(boost::shared_ptr<const XMLTree> node, URDFData& data,
JointPtr joint);
79 static void read_limits(boost::shared_ptr<const XMLTree> node, URDFData& data,
JointPtr joint);
80 static void read_dynamics(boost::shared_ptr<const XMLTree> node, URDFData& data,
JointPtr joint);
81 static void read_axis(boost::shared_ptr<const XMLTree> node, URDFData& data,
JointPtr joint);
82 static RigidBodyPtr read_parent(boost::shared_ptr<const XMLTree> node, URDFData& data,
const std::vector<RigidBodyPtr>& links);
83 static RigidBodyPtr read_child(boost::shared_ptr<const XMLTree> node, URDFData& data,
const std::vector<RigidBodyPtr>& links);
84 static void read_joint(boost::shared_ptr<const XMLTree> node, URDFData& data,
const std::vector<RigidBodyPtr>& links, std::vector<JointPtr>& joints);
85 static void read_joints(boost::shared_ptr<const XMLTree> node, URDFData& data,
const std::vector<RigidBodyPtr>& links, std::vector<JointPtr>& joints);
86 static void read_links(boost::shared_ptr<const XMLTree> node, URDFData& data, std::vector<RigidBodyPtr>& links);
87 static void read_link(boost::shared_ptr<const XMLTree> node, URDFData& data, std::vector<RigidBodyPtr>& links);
88 static bool read_robot(boost::shared_ptr<const XMLTree> node, URDFData& data, std::string& name, std::vector<RigidBodyPtr>& links, std::vector<JointPtr>& joints);
boost::shared_ptr< Primitive > PrimitivePtr
Primitive smart pointer.
Definition: Types.h:80
Used to read the simulator state from URDF.
Definition: URDFReader.h:34
boost::shared_ptr< RigidBody > RigidBodyPtr
Rigid body smart pointer.
Definition: Types.h:62
static bool read(const std::string &fname, std::string &name, std::vector< RigidBodyPtr > &links, std::vector< JointPtr > &joints)
Reads an XML file and constructs all read objects.
Definition: URDFReader.cpp:65
boost::shared_ptr< Joint > JointPtr
Reduced-coordinate articulated body joint smart pointer.
Definition: Types.h:74