pinocchio  3.3.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 
39  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
41  const std::string & filename,
43  const std::string & rootJointName,
45  const bool verbose = false);
46 
57  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
59  const std::string & filename,
62  const bool verbose = false);
63 
72  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
74  const std::string & filename,
76  const bool verbose = false);
77 
90  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
92  const std::shared_ptr<::urdf::ModelInterface> urdfTree,
95  const bool verbose = false);
96 
110  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
112  const std::shared_ptr<::urdf::ModelInterface> urdfTree,
114  const std::string & rootJointName,
116  const bool verbose = false);
117 
128  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
130  const std::shared_ptr<::urdf::ModelInterface> urdfTree,
132  const bool verbose = false);
133 
147  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
149  const std::string & xml_stream,
151  const std::string & rootJointName,
153  const bool verbose = false);
154 
167  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
169  const std::string & xml_stream,
172  const bool verbose = false);
173 
184  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
186  const std::string & xml_stream,
188  const bool verbose = false);
189 
214  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
217  const std::string & filename,
218  const GeometryType type,
219  GeometryModel & geom_model,
220  const std::vector<std::string> & package_paths = std::vector<std::string>(),
221  ::hpp::fcl::MeshLoaderPtr mesh_loader = ::hpp::fcl::MeshLoaderPtr());
222 
246  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
249  const std::string & filename,
250  const GeometryType type,
251  GeometryModel & geom_model,
252  const std::string & package_path,
253  hpp::fcl::MeshLoaderPtr mesh_loader = hpp::fcl::MeshLoaderPtr())
254 
255  {
256  const std::vector<std::string> dirs(1, package_path);
257  return buildGeom(model, filename, type, geom_model, dirs, mesh_loader);
258  }
259 
284  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
287  const std::istream & xml_stream,
288  const GeometryType type,
289  GeometryModel & geom_model,
290  const std::vector<std::string> & package_paths = std::vector<std::string>(),
291  hpp::fcl::MeshLoaderPtr mesh_loader = hpp::fcl::MeshLoaderPtr());
292 
316  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
319  const std::istream & xml_stream,
320  const GeometryType type,
321  GeometryModel & geom_model,
322  const std::string & package_path,
323  hpp::fcl::MeshLoaderPtr mesh_loader = hpp::fcl::MeshLoaderPtr())
324 
325  {
326  const std::vector<std::string> dirs(1, package_path);
327  return buildGeom(model, xml_stream, type, geom_model, dirs, mesh_loader);
328  }
329 
330  } // namespace urdf
331 } // namespace pinocchio
332 
333 #include "pinocchio/parsers/urdf/model.hxx"
334 #include "pinocchio/parsers/urdf/geometry.hxx"
335 
336 #endif // ifndef __pinocchio_parsers_urdf_hpp__
ModelTpl< Scalar, Options, JointCollectionTpl > & buildModel(const std::string &filename, const typename ModelTpl< Scalar, Options, JointCollectionTpl >::JointModel &rootJoint, const std::string &rootJointName, 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...
ModelTpl< Scalar, Options, JointCollectionTpl > & buildModelFromXML(const std::string &xml_stream, const typename ModelTpl< Scalar, Options, JointCollectionTpl >::JointModel &rootJoint, const std::string &rootJointName, 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 ...
Main pinocchio namespace.
Definition: treeview.dox:11