sample-models.hpp 4.19 KB
Newer Older
1
//
2
// Copyright (c) 2015-2016 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_sample_models_hpp__
#define __se3_sample_models_hpp__
21
22

#include "pinocchio/multibody/model.hpp"
23
#include "pinocchio/multibody/geometry.hpp"
24
25
26
27

namespace se3
{
  namespace buildModels
28
  {  
29
30
31
32
    /** \brief Create a 6-DOF kinematic chain shoulder-elbow-wrist.
     *
     * \param model: model, typically given empty, where the kinematic chain is added.
     */
33
    void manipulator(Model& model);
34
35
36
37
38
39
    /** \brief Create the geometries on top of the kinematic model created by manipulator function.
     *
     * \param model, const, kinematic chain typically produced by the function manipulator(model).
     * \warning this method is expecting specific namings of the kinematic chain, use it with care
     * not using after manipulator(model).
     */
40
    void manipulatorGeometries(const Model& model, GeometryModel & geom);
41

42
43
    /** \brief Create a 28-DOF kinematic chain of a floating humanoid robot.
     * 
44
45
46
47
     * The kinematic chain has four 6-DOF limbs shoulder-elbow-wrist, one 2-DOF torso, one
     * 2-DOF neck. The float joint is either a JointModelFreeFloating (with nq=7 and nv=6),
     * or a composite joint with a JointModelTranslation
     * and a roll-pitch-yaw joint JointModelSphericalZYX (with total nq=nv=6).
48
49
50
51
52
53
     * Using a free-floating or a composite joint is decided by the boolean usingFF.
     *
     * \param model: model, typically given empty, where the kinematic chain is added.
     * \param usingFF: if True, implement the chain with a plain JointModelFreeFloating; if False,
     * uses a composite joint. This changes the size of the configuration space (35 vs 34).
     */
54
    void humanoid(Model& model,bool usingFF=true);
55
56
57
58
59
60
    /** \brief Create the geometries on top of the kinematic model created by humanoid function.
     *
     * \param model, const, kinematic chain typically produced by the function humanoid(model).
     * \warning this method is expecting specific namings of the kinematic chain, use it with care
     * not using after humanoid(model).
     */
61
    void humanoidGeometries(const Model& model, GeometryModel & geom);
62
    
63
    /** \brief Create a humanoid kinematic tree with 6-DOF limbs and random joint placements.
64
65
66
67
68
69
70
     *
     * This method is only meant to be used in unittest. Due to random placement and masses,
     * the resulting model is likely to not correspond to any physically-plausible model. 
     * You may want to consider se3::humanoid and se3::humanoidGeometries functions that
     * rather define a plain and non-random model. 
     * \param model: model, typically given empty, where the kinematic chain is added.
     * \param usingFF: if True, implement the chain with a plain JointModelFreeFloating; if False,
71
72
     * uses a composite joint translation + roll-pitch-yaw.
     * This changes the size of the configuration space (33 vs 32).
73
74
75
76
77
78
79
80
     */
    void humanoidRandom(Model& model, bool usingFF = true);

    /** \brief Create a random humanoid tree with 2d limbs.
     * \ deprecated This function has been replaced by the non-random se3::humanoid function.
     */
    PINOCCHIO_DEPRECATED
    void humanoid2d(Model& model);
81

82
83
84
85
86
87
    /** \brief Alias of humanoidRandom, for compatibility reasons.
     * \deprecated use se3::humanoid or se3::humanoidRandom instead. 
     */
    PINOCCHIO_DEPRECATED
    inline void humanoidSimple(Model& model, bool usingFF = true) { humanoidRandom(model,usingFF); }
   
88
  } // namespace buildModels
89
} // namespace se3
90

91
#endif // ifndef __se3_sample_models_hpp__