hpp-pinocchio  6.0.0
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 
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions are
9 // met:
10 //
11 // 1. Redistributions of source code must retain the above copyright
12 // notice, this list of conditions and the following disclaimer.
13 //
14 // 2. Redistributions in binary form must reproduce the above copyright
15 // notice, this list of conditions and the following disclaimer in the
16 // documentation and/or other materials provided with the distribution.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
29 // DAMAGE.
30 
31 #ifndef HPP_PINOCCHIO_BODY_HH
32 #define HPP_PINOCCHIO_BODY_HH
33 
34 #include <hpp/pinocchio/config.hh>
35 #include <hpp/pinocchio/fwd.hh>
36 #include <hpp/util/pointer.hh>
37 #include <pinocchio/multibody/fwd.hpp>
38 
39 namespace hpp {
40 namespace pinocchio {
41 
52  public:
56  Body(DeviceWkPtr_t device, JointIndex joint);
57 
58  virtual ~Body() {}
60 
63 
65  const std::string& name() const;
67 
69  JointPtr_t joint() const;
70 
73 
76 
79 
84  value_type radius() const;
85 
88 
92 
96  const vector3_t& localCenterOfMass() const;
100  value_type mass() const;
101 
103  private:
105  void selfAssert() const;
108  void searchFrameIndex() const;
109 
110  const Model& model() const;
111  Model& model();
112  const ::pinocchio::Frame& frame() const;
113  ::pinocchio::Frame& frame();
114 
115  DeviceWkPtr_t devicePtr;
116  JointIndex jointIndex;
117  mutable FrameIndex
118  frameIndex; // In pinocchio, bodies are stored as frames of type BODY.
119  mutable bool frameIndexSet;
120 }; // class Body
121 } // namespace pinocchio
122 } // namespace hpp
123 #endif // HPP_PINOCCHIO_BODY_HH
Definition: body.hh:51
Body(DeviceWkPtr_t device, JointIndex joint)
CollisionObjectPtr_t outerObjectAt(const size_type &i) const
Access to an outer object.
const vector3_t & localCenterOfMass() const
matrix3_t inertiaMatrix() const
Get Intertia matrix expressed in joint local reference frame.
virtual ~Body()
Definition: body.hh:58
CollisionObjectPtr_t innerObjectAt(const size_type &i) const
Access to an inner object.
const std::string & name() const
Get name.
value_type mass() const
Get mass.
value_type radius() const
size_type nbInnerObjects() const
Number of inner objects.
JointPtr_t joint() const
Get joint holding the body.
size_type nbOuterObjects() const
Number of outer objects.
Robot frame.
Definition: frame.hh:42
#define HPP_PINOCCHIO_DLLAPI
Definition: config.hh:88
shared_ptr< Joint > JointPtr_t
Definition: fwd.hh:123
::pinocchio::ModelTpl< value_type, 0, JointCollectionTpl > Model
Definition: fwd.hh:77
::pinocchio::FrameIndex FrameIndex
Definition: fwd.hh:75
Eigen::Matrix< value_type, 3, 1 > vector3_t
Definition: fwd.hh:99
matrix_t::Index size_type
Definition: fwd.hh:97
double value_type
Definition: fwd.hh:51
::pinocchio::JointIndex JointIndex
Definition: fwd.hh:74
Eigen::Matrix< value_type, 3, 3 > matrix3_t
Definition: fwd.hh:98
shared_ptr< CollisionObject > CollisionObjectPtr_t
Definition: fwd.hh:116
Utility functions.
Definition: body.hh:39
Definition: collision-object.hh:40