types.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2015-2023 CNRS INRIA
3 //
4 
5 #ifndef __pinocchio_parsers_urdf_types_hpp__
6 #define __pinocchio_parsers_urdf_types_hpp__
7 
8 #include <urdf_model/model.h>
9 
10 #include <string>
11 #include <exception>
12 #ifdef PINOCCHIO_URDFDOM_USE_STD_SHARED_PTR
13  #include <memory>
14  #define PINOCCHIO_URDF_SHARED_PTR(type) std::shared_ptr<type>
15  #define PINOCCHIO_URDF_WEAK_PTR(type) std::weak_ptr<type>
16 #else
17  #include <boost/shared_ptr.hpp>
18  #define PINOCCHIO_URDF_SHARED_PTR(type) std::shared_ptr<type>
19  #define PINOCCHIO_URDF_WEAK_PTR(type) boost::weak_ptr<type>
20 #endif
21 
22 #ifndef PINOCCHIO_URDFDOM_TYPEDEF_SHARED_PTR
23 
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
28 
29 namespace urdf
30 {
43 
44  template<class T, class U>
47  {
48  #ifdef PINOCCHIO_URDFDOM_USE_STD_SHARED_PTR
49  return std::const_pointer_cast<T>(r);
50  #else
51  return boost::const_pointer_cast<T>(r);
52  #endif
53  }
54 
55  template<class T, class U>
58  {
59  #ifdef PINOCCHIO_URDFDOM_USE_STD_SHARED_PTR
60  return std::dynamic_pointer_cast<T>(r);
61  #else
62  return boost::dynamic_pointer_cast<T>(r);
63  #endif
64  }
65 
66  template<class T, class U>
69  {
70  #ifdef PINOCCHIO_URDFDOM_USE_STD_SHARED_PTR
71  return std::static_pointer_cast<T>(r);
72  #else
73  return boost::static_pointer_cast<T>(r);
74  #endif
75  }
76 } // namespace urdf
77 
78  #undef PINOCCHIO_URDF_TYPEDEF_CLASS_POINTER
79 
80 #else // PINOCCHIO_URDFDOM_TYPEDEF_SHARED_PTR
81 
82  #include <urdf_world/types.h>
83 
84 #endif // PINOCCHIO_URDFDOM_TYPEDEF_SHARED_PTR
85 
86 #endif // ifndef __pinocchio_parsers_urdf_types_hpp__
simulation-contact-dynamics.T
int T
Definition: simulation-contact-dynamics.py:89
PINOCCHIO_URDF_SHARED_PTR
#define PINOCCHIO_URDF_SHARED_PTR(type)
Definition: types.hpp:18
pinocchio::Joint
JointTpl< context::Scalar > Joint
Definition: joint-generic.hpp:22
Sphere
Sphere()
r
FCL_REAL r
urdf::static_pointer_cast
static_pointer_cast(PINOCCHIO_URDF_SHARED_PTR(U) const &r)
Definition: types.hpp:68
urdf::const_pointer_cast
const_pointer_cast(PINOCCHIO_URDF_SHARED_PTR(U) const &r)
Definition: types.hpp:46
urdf
Definition: types.hpp:29
ocp.U
U
Definition: ocp.py:80
Geometry
Cylinder
Cylinder()
urdf::dynamic_pointer_cast
dynamic_pointer_cast(PINOCCHIO_URDF_SHARED_PTR(U) const &r)
Definition: types.hpp:57
Box
Box()
urdf::PINOCCHIO_URDF_TYPEDEF_CLASS_POINTER
PINOCCHIO_URDF_TYPEDEF_CLASS_POINTER(Box)


pinocchio
Author(s):
autogenerated on Sun Dec 22 2024 03:41:12