pinocchio  3.2.0
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
urdf.hpp
1 //
2 // Copyright (c) 2015-2021 CNRS INRIA
3 // Copyright (c) 2015 Wandercraft, 86 rue de Paris 91400 Orsay, France.
4 //
5 
6 #ifndef __pinocchio_parsers_urdf_hpp__
7 #define __pinocchio_parsers_urdf_hpp__
8 
9 #include "pinocchio/multibody/model.hpp"
10 #include "pinocchio/multibody/geometry.hpp"
11 #include "pinocchio/parsers/meshloader-fwd.hpp"
12 
13 #include <memory>
14 
16 // forward declaration of the unique type from urdfdom which is expose.
17 namespace urdf
18 {
19  class ModelInterface;
20 }
22 
23 namespace pinocchio
24 {
25  namespace urdf
26  {
27 
38  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
40  const std::string & filename,
43  const bool verbose = false);
44 
53  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
55  const std::string & filename,
57  const bool verbose = false);
58 
71  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
73  const std::shared_ptr<::urdf::ModelInterface> urdfTree,
76  const bool verbose = false);
77 
88  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
90  const std::shared_ptr<::urdf::ModelInterface> urdfTree,
92  const bool verbose = false);
93 
106  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
108  const std::string & xml_stream,
111  const bool verbose = false);
112 
123  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
125  const std::string & xml_stream,
127  const bool verbose = false);
128 
153  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
156  const std::string & filename,
157  const GeometryType type,
158  GeometryModel & geom_model,
159  const std::vector<std::string> & package_paths = std::vector<std::string>(),
160  ::hpp::fcl::MeshLoaderPtr mesh_loader = ::hpp::fcl::MeshLoaderPtr());
161 
185  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
188  const std::string & filename,
189  const GeometryType type,
190  GeometryModel & geom_model,
191  const std::string & package_path,
192  hpp::fcl::MeshLoaderPtr mesh_loader = hpp::fcl::MeshLoaderPtr())
193 
194  {
195  const std::vector<std::string> dirs(1, package_path);
196  return buildGeom(model, filename, type, geom_model, dirs, mesh_loader);
197  }
198 
223  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
226  const std::istream & xml_stream,
227  const GeometryType type,
228  GeometryModel & geom_model,
229  const std::vector<std::string> & package_paths = std::vector<std::string>(),
230  hpp::fcl::MeshLoaderPtr mesh_loader = hpp::fcl::MeshLoaderPtr());
231 
255  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
258  const std::istream & xml_stream,
259  const GeometryType type,
260  GeometryModel & geom_model,
261  const std::string & package_path,
262  hpp::fcl::MeshLoaderPtr mesh_loader = hpp::fcl::MeshLoaderPtr())
263 
264  {
265  const std::vector<std::string> dirs(1, package_path);
266  return buildGeom(model, xml_stream, type, geom_model, dirs, mesh_loader);
267  }
268 
269  } // namespace urdf
270 } // namespace pinocchio
271 
272 #include "pinocchio/parsers/urdf/model.hxx"
273 #include "pinocchio/parsers/urdf/geometry.hxx"
274 
275 #endif // ifndef __pinocchio_parsers_urdf_hpp__
ModelTpl< Scalar, Options, JointCollectionTpl > & buildModelFromXML(const std::string &xml_stream, const typename ModelTpl< Scalar, Options, JointCollectionTpl >::JointModel &rootJoint, ModelTpl< Scalar, Options, JointCollectionTpl > &model, const bool verbose=false)
Build the model from an XML stream with a particular joint as root of the model tree inside the model...
GeometryModel & buildGeom(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const std::string &filename, const GeometryType type, GeometryModel &geom_model, const std::vector< std::string > &package_paths=std::vector< std::string >(), ::hpp::fcl::MeshLoaderPtr mesh_loader=::hpp::fcl::MeshLoaderPtr())
Build The GeometryModel from a URDF file. Search for meshes in the directories specified by the user ...
ModelTpl< Scalar, Options, JointCollectionTpl > & buildModel(const std::string &filename, const typename ModelTpl< Scalar, Options, JointCollectionTpl >::JointModel &rootJoint, ModelTpl< Scalar, Options, JointCollectionTpl > &model, const bool verbose=false)
Build the model from a URDF file with a particular joint as root of the model tree inside the model g...
Main pinocchio namespace.
Definition: treeview.dox:11