hpp-pinocchio  4.9.1
Wrapping of the kinematic/dynamic chain Pinocchio for HPP.
collision-object.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_COLLISION_OBJECT_HH
21 # define HPP_PINOCCHIO_COLLISION_OBJECT_HH
22 
23 #include <map>
24 
25 # include <pinocchio/multibody/fwd.hpp>
26 
27 # include <hpp/pinocchio/deprecated.hh>
28 # include <hpp/pinocchio/config.hh>
29 # include <hpp/pinocchio/fwd.hh>
30 
31 namespace pinocchio
32 {
33  struct GeometryObject;
34 }
35 
36 namespace hpp {
37  namespace pinocchio {
39 
44  class HPP_PINOCCHIO_DLLAPI CollisionObject {
45  public:
46 
47  typedef std::vector<GeomIndex> GeomIndexList;
48  typedef std::map < JointIndex, GeomIndexList > ObjectVec_t;
49 
52  const GeomIndex geom );
53 
57  GeomDataPtr_t geomData,
58  const GeomIndex geom );
59 
60  const std::string& name () const;
61 
63  const GeometryObject & pinocchio () const;
64  GeometryObject & pinocchio ();
65 
67  FclConstCollisionObjectPtr_t fcl (const GeomData& data) const;
68  FclCollisionObjectPtr_t fcl ( GeomData& data) const;
69  FclConstCollisionObjectPtr_t fcl () const ;
71 
76  FclConstCollisionObjectPtr_t fcl (const DeviceData& d) const;
77 
79  const JointIndex& jointIndex () const { return jointIndex_; }
80 
82  JointPtr_t joint () ;
83  JointConstPtr_t joint () const;
84 
86  const Transform3f& positionInJointFrame () const;
87 
93  const fcl::Transform3f& getFclTransform () const;
94  const Transform3f& getTransform () const;
95  const Transform3f& getTransform (DeviceData& d) const;
96 
97  const GeomIndex& indexInModel () const
98  {
99  return geomInModelIndex;
100  }
101 
106  void move (const Transform3f& position);
107 
108  protected:
109 
111  void selfAssert() const;
112 
113  private:
114  GeomData& geomData() const;
115  GeomData& geomData(DeviceData& d) const;
116  const GeomData& geomData(const DeviceData& d) const;
117 
118  DevicePtr_t devicePtr;
119  GeomModelPtr_t geomModel_;
120  // If geomData_ is not null when the object is part of the environment.
121  // Otherwise, it is null.
122  GeomDataPtr_t geomData_;
123  JointIndex jointIndex_;
124  GeomIndex geomInModelIndex; // Index in global model list.
125  }; // class CollisionObject
126  } // namespace pinocchio
127 } // namespace hpp
128 
129 #endif // HPP_PINOCCHIO_COLLISION_OBJECT_HH
boost::shared_ptr< Device > DevicePtr_t
Definition: fwd.hh:104
std::vector< GeomIndex > GeomIndexList
Definition: collision-object.hh:47
const GeomIndex & indexInModel() const
Definition: collision-object.hh:97
Utility functions.
::pinocchio::GeomIndex GeomIndex
Definition: fwd.hh:64
Definition: device-data.hh:41
std::string name(const LieGroupGenericTpl< LieGroupCollection > &lg)
const JointIndex & jointIndex() const
Get joint index.
Definition: collision-object.hh:79
boost::shared_ptr< GeomData > GeomDataPtr_t
Definition: fwd.hh:121
const Transform3f & getTransform() const
std::map< JointIndex, GeomIndexList > ObjectVec_t
Definition: collision-object.hh:48
CollisionObject(const boost::shared_ptr< CollisionGeometry > &cgeom_)
Definition: collision-object.hh:44
FCL_REAL d
::pinocchio::GeometryObject GeometryObject
Definition: collision-object.hh:38
::pinocchio::SE3 Transform3f
Definition: fwd.hh:69
boost::shared_ptr< const Joint > JointConstPtr_t
Definition: fwd.hh:110
::pinocchio::JointIndex JointIndex
Definition: fwd.hh:62
boost::shared_ptr< GeomModel > GeomModelPtr_t
Definition: fwd.hh:119
boost::shared_ptr< Joint > JointPtr_t
Definition: fwd.hh:109