urdf.hpp 3.8 KB
Newer Older
1
//
2
// Copyright (c) 2015-2017 CNRS
3
// Copyright (c) 2015 Wandercraft, 86 rue de Paris 91400 Orsay, France.
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//
// This file is part of Pinocchio
// Pinocchio is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// Pinocchio is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// Pinocchio If not, see
// <http://www.gnu.org/licenses/>.

19
20
#ifndef __se3_parsers_urdf_hpp__
#define __se3_parsers_urdf_hpp__
21
22

#include "pinocchio/multibody/model.hpp"
23
#include "pinocchio/deprecated.hh"
24
#include "pinocchio/multibody/geometry.hpp"
25
#include "pinocchio/parsers/urdf/types.hpp"
26

jcarpent's avatar
jcarpent committed
27
28
#include <urdf_model/model.h>

29
30
namespace se3
{
31
  namespace urdf
32
  {
33

34
35
36
37
38
    /// 
    /// \brief Build the model from a URDF file with a particular joint as root of the model tree inside
    /// the model given as reference argument.
    ///
    /// \param[in] filemane The URDF complete file path.
39
    /// \param[in] rootJoint The joint at the root of the model tree.
40
41
42
43
44
    /// \param[in] verbose Print parsing info.
    /// \param[out] model Reference model where to put the parsed information.
    /// \return Return the reference on argument model for convenience.
    /// 
    Model& buildModel (const std::string & filename,
45
                       const JointModelVariant & rootJoint,
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
                       Model & model, 
                       const bool verbose = false) throw (std::invalid_argument);


    ///
    /// \brief Build the model from a URDF file with a fixed joint as root of the model tree.
    ///
    /// \param[in] filemane The URDF complete file path.
    /// \param[in] verbose Print parsing info.
    /// \param[out] model Reference model where to put the parsed information.
    /// \return Return the reference on argument model for convenience.
    ///
    Model & buildModel (const std::string & filename,
                        Model & model,
                        const bool verbose = false) throw (std::invalid_argument);

62
63
64
65
66
67
68
69
70

    /**
     * @brief      Build The GeometryModel from a URDF file. Search for meshes
     *             in the directories specified by the user first and then in
     *             the environment variable ROS_PACKAGE_PATH
     *
     * @param[in]  model         The model of the robot, built with
     *                           urdf::buildModel
     * @param[in]  filename      The URDF complete (absolute) file path
71
     * @param[in]  packageDirs  A vector containing the different directories
72
73
74
     *                           where to search for models and meshes, typically 
     *                           obtained from calling se3::rosPaths()
     *
75
76
77
78
79
     * @param[in]   type         The type of objects that must be loaded (must be VISUAL or COLLISION)
     * @param[out]  geomModel    Reference where to put the parsed information.
     *
     * @return      Returns the reference on geom model for convenience.
     *
80
81
     * \warning     If hpp-fcl has not been found during compilation, COLLISION types can not be loaded
     *
82
83
84
85
86
     */
    GeometryModel& buildGeom(const Model & model,
                             const std::string & filename,
                             const GeometryType type,
                             GeometryModel & geomModel,
87
                             const std::vector<std::string> & packageDirs = std::vector<std::string> ())
88
89
    throw (std::invalid_argument);

90

91
  } // namespace urdf
92
93
} // namespace se3

94
#endif // ifndef __se3_parsers_urdf_hpp__