hpp-pinocchio  4.9.1
Wrapping of the kinematic/dynamic chain Pinocchio for HPP.
body.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2016 CNRS
3 // Author: NMansard from Florent Lamiraux
4 //
5 //
6 // This file is part of hpp-pinocchio
7 // hpp-pinocchio is free software: you can redistribute it
8 // and/or modify it under the terms of the GNU Lesser General Public
9 // License as published by the Free Software Foundation, either version
10 // 3 of the License, or (at your option) any later version.
11 //
12 // hpp-pinocchio is distributed in the hope that it will be
13 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Lesser Public License for more details. You should have
16 // received a copy of the GNU Lesser General Public License along with
17 // hpp-pinocchio If not, see
18 // <http://www.gnu.org/licenses/>.
19 
20 #ifndef HPP_PINOCCHIO_BODY_HH
21 # define HPP_PINOCCHIO_BODY_HH
22 
23 # include <hpp/util/pointer.hh>
24 
25 # include <pinocchio/multibody/fwd.hpp>
26 
27 # include <hpp/pinocchio/config.hh>
28 # include <hpp/pinocchio/fwd.hh>
29 
30 namespace hpp {
31  namespace pinocchio {
32 
42  class HPP_PINOCCHIO_DLLAPI Body
43  {
44  public:
48  Body (DeviceWkPtr_t device, JointIndex joint);
49 
50  virtual ~Body () {}
52 
55 
57  const std::string & name () const;
59 
61  JointPtr_t joint () const;
62 
65 
67  size_type nbInnerObjects () const;
68 
70  CollisionObjectPtr_t innerObjectAt (const size_type& i) const;
71 
76  value_type radius () const;
77 
79  size_type nbOuterObjects () const;
80 
82  CollisionObjectPtr_t outerObjectAt (const size_type& i) const;
84 
88  const vector3_t& localCenterOfMass () const;
90  matrix3_t inertiaMatrix() const;
92  value_type mass() const;
93 
95  private:
97  void selfAssert() const;
99  void searchFrameIndex() const;
100 
101  const Model& model() const ;
102  Model& model() ;
103  const ::pinocchio::Frame & frame() const ;
104  ::pinocchio::Frame & frame() ;
105 
106  DeviceWkPtr_t devicePtr;
107  JointIndex jointIndex;
108  mutable FrameIndex frameIndex; // In pinocchio, bodies are stored as frames of type BODY.
109  mutable bool frameIndexSet;
110  }; // class Body
111  } // namespace pinocchio
112 } // namespace hpp
113 #endif // HPP_PINOCCHIO_BODY_HH
virtual ~Body()
Definition: body.hh:50
Utility functions.
boost::shared_ptr< CollisionObject > CollisionObjectPtr_t
Definition: fwd.hh:102
Eigen::Matrix< value_type, 3, 3 > matrix3_t
Definition: fwd.hh:85
Robot frame.
Definition: frame.hh:31
matrix_t::Index size_type
Definition: fwd.hh:84
::pinocchio::FrameIndex FrameIndex
Definition: fwd.hh:63
FCL_REAL radius
Definition: body.hh:42
double value_type
Definition: fwd.hh:40
::pinocchio::JointIndex JointIndex
Definition: fwd.hh:62
Eigen::Matrix< value_type, 3, 1 > vector3_t
Definition: fwd.hh:86
boost::shared_ptr< Joint > JointPtr_t
Definition: fwd.hh:109