5 #ifndef __pinocchio_parsers_urdf_types_hpp__ 6 #define __pinocchio_parsers_urdf_types_hpp__ 8 #include <urdf_model/model.h> 12 #ifdef PINOCCHIO_URDFDOM_USE_STD_SHARED_PTR 14 #define PINOCCHIO_URDF_SHARED_PTR(type) std::shared_ptr<type> 15 #define PINOCCHIO_URDF_WEAK_PTR(type) std::weak_ptr<type> 17 #include <boost/shared_ptr.hpp> 18 #define PINOCCHIO_URDF_SHARED_PTR(type) boost::shared_ptr<type> 19 #define PINOCCHIO_URDF_WEAK_PTR(type) boost::weak_ptr<type> 22 #ifndef PINOCCHIO_URDFDOM_TYPEDEF_SHARED_PTR 24 #define PINOCCHIO_URDF_TYPEDEF_CLASS_POINTER(Class) \ 25 typedef PINOCCHIO_URDF_SHARED_PTR(Class) Class##SharedPtr; \ 26 typedef PINOCCHIO_URDF_SHARED_PTR(const Class) Class##ConstSharedPtr; \ 27 typedef PINOCCHIO_URDF_WEAK_PTR(Class) Class##WeakPtr 31 PINOCCHIO_URDF_TYPEDEF_CLASS_POINTER(Box);
32 PINOCCHIO_URDF_TYPEDEF_CLASS_POINTER(Collision);
33 PINOCCHIO_URDF_TYPEDEF_CLASS_POINTER(Cylinder);
34 PINOCCHIO_URDF_TYPEDEF_CLASS_POINTER(Geometry);
35 PINOCCHIO_URDF_TYPEDEF_CLASS_POINTER(Inertial);
36 PINOCCHIO_URDF_TYPEDEF_CLASS_POINTER(Joint);
37 PINOCCHIO_URDF_TYPEDEF_CLASS_POINTER(Link);
38 PINOCCHIO_URDF_TYPEDEF_CLASS_POINTER(Material);
39 PINOCCHIO_URDF_TYPEDEF_CLASS_POINTER(Mesh);
40 PINOCCHIO_URDF_TYPEDEF_CLASS_POINTER(ModelInterface);
41 PINOCCHIO_URDF_TYPEDEF_CLASS_POINTER(Sphere);
42 PINOCCHIO_URDF_TYPEDEF_CLASS_POINTER(Visual);
44 template<
class T,
class U>
45 PINOCCHIO_URDF_SHARED_PTR(T) const_pointer_cast(PINOCCHIO_URDF_SHARED_PTR(U)
const & r)
47 #ifdef PINOCCHIO_URDFDOM_USE_STD_SHARED_PTR 48 return std::const_pointer_cast<T>(r);
50 return boost::const_pointer_cast<T>(r);
54 template<
class T,
class U>
55 PINOCCHIO_URDF_SHARED_PTR(T) dynamic_pointer_cast(PINOCCHIO_URDF_SHARED_PTR(U)
const & r)
57 #ifdef PINOCCHIO_URDFDOM_USE_STD_SHARED_PTR 58 return std::dynamic_pointer_cast<T>(r);
60 return boost::dynamic_pointer_cast<T>(r);
64 template<
class T,
class U>
65 PINOCCHIO_URDF_SHARED_PTR(T) static_pointer_cast(PINOCCHIO_URDF_SHARED_PTR(U)
const & r)
67 #ifdef PINOCCHIO_URDFDOM_USE_STD_SHARED_PTR 68 return std::static_pointer_cast<T>(r);
70 return boost::static_pointer_cast<T>(r);
75 #undef PINOCCHIO_URDF_TYPEDEF_CLASS_POINTER 77 #else // PINOCCHIO_URDFDOM_TYPEDEF_SHARED_PTR 79 #include <urdf_world/types.h> 81 #endif // PINOCCHIO_URDFDOM_TYPEDEF_SHARED_PTR 83 #endif // ifndef __pinocchio_parsers_urdf_types_hpp__