collision/broadphase-manager-base.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2022 INRIA
3 //
4 
5 #ifndef __pinocchio_collision_broadphase_manager_base_hpp__
6 #define __pinocchio_collision_broadphase_manager_base_hpp__
7 
10 
11 namespace pinocchio
12 {
13 
14  template<typename Derived>
16  {
18  BroadPhaseManagerBase() // for std::vector
22  {
23  }
24 
27  const Model * model_ptr,
33  {
34  }
35 
38  : model_ptr(other.model_ptr)
41  {
42  }
43 
45  operator=(const BroadPhaseManagerBase & other) // Copy assignment operator
46  {
47  model_ptr = other.model_ptr;
50  return *this;
51  }
52 
53  Derived & derived()
54  {
55  return static_cast<Derived &>(*this);
56  }
57  const Derived & derived() const
58  {
59  return static_cast<const Derived &>(*this);
60  }
61 
64  bool check() const
65  {
66  return derived().check();
67  }
68 
70  bool check(CollisionCallBackBase * callback) const
71  {
72  return derived().check(callback);
73  }
74 
82  void update(bool compute_local_aabb = false)
83  {
84  derived().update(compute_local_aabb);
85  }
86 
92  void update(GeometryData * geom_data_ptr_new)
93  {
94  derived().update(geom_data_ptr_new);
95  }
96 
99  bool collide(CollisionObject & obj, CollisionCallBackBase * callback) const
100  {
101  return derived().collide(obj, callback);
102  }
103 
105  bool collide(CollisionCallBackBase * callback) const
106  {
107  return derived().collide(callback);
108  }
109 
111  bool collide(BroadPhaseManagerBase & other_manager, CollisionCallBackBase * callback) const
112  {
113  return derived().collide(other_manager.derived(), callback);
114  }
115 
116  // /// @brief Performs distance computation between one object and all the objects belonging to
117  // the manager void distance(CollisionObject* obj, DistanceCallBackBase * callback) const;
118 
119  // /// @brief Performs distance test for the objects belonging to the manager (i.e., N^2 self
120  // distance) void distance(DistanceCallBackBase * callback) const;
121 
122  // /// @brief Performs distance test with objects belonging to another manager
123  // void distance(BroadPhaseCollisionManager* other_manager, DistanceCallBackBase * callback)
124  // const;
125 
127  const Model & getModel() const
128  {
129  return *model_ptr;
130  }
131 
134  {
135  return *geometry_model_ptr;
136  }
137 
140  {
141  return *geometry_data_ptr;
142  }
143 
146  {
147  return *geometry_data_ptr;
148  }
149 
150  protected:
152  const Model * model_ptr;
153 
156 
159 
160  }; // struct BroadPhaseManagerBase<Derived>
161 
162 } // namespace pinocchio
163 
164 #endif // ifndef __pinocchio_collision_broadphase_manager_base_hpp__
pinocchio::BroadPhaseManagerBase::collide
bool collide(CollisionObject &obj, CollisionCallBackBase *callback) const
Performs collision test between one object and all the objects belonging to the manager.
Definition: collision/broadphase-manager-base.hpp:99
pinocchio::BroadPhaseManagerBase::getGeometryModel
const GeometryModel & getGeometryModel() const
Returns the geometry model associated to the manager.
Definition: collision/broadphase-manager-base.hpp:133
callback
callback
pinocchio::BroadPhaseManagerBase
Definition: collision/broadphase-manager-base.hpp:15
pinocchio::BroadPhaseManagerBase::getGeometryData
const GeometryData & getGeometryData() const
Returns the geometry data associated to the manager.
Definition: collision/broadphase-manager-base.hpp:139
CollisionObject
CollisionObject(const shared_ptr< CollisionGeometry > &cgeom_, bool compute_local_aabb=true)
broadphase-callbacks.hpp
pinocchio::BroadPhaseManagerBase::derived
Derived & derived()
Definition: collision/broadphase-manager-base.hpp:53
nullptr
#define nullptr
pinocchio::BroadPhaseManagerBase::getModel
const Model & getModel() const
Returns the model associated to the manager.
Definition: collision/broadphase-manager-base.hpp:127
pinocchio::BroadPhaseManagerBase::geometry_model_ptr
const GeometryModel * geometry_model_ptr
Pointer to the geometry model.
Definition: collision/broadphase-manager-base.hpp:155
pinocchio::GeometryData
Definition: multibody/geometry.hpp:233
pinocchio::CollisionCallBackBase
Interface for Pinocchio collision callback functors.
Definition: broadphase-callbacks.hpp:19
pinocchio::BroadPhaseManagerBase::operator=
BroadPhaseManagerBase & operator=(const BroadPhaseManagerBase &other)
Definition: collision/broadphase-manager-base.hpp:45
pinocchio::BroadPhaseManagerBase::geometry_data_ptr
GeometryData * geometry_data_ptr
Pointer to the geometry data.
Definition: collision/broadphase-manager-base.hpp:158
pinocchio::BroadPhaseManagerBase::BroadPhaseManagerBase
BroadPhaseManagerBase(const BroadPhaseManagerBase &other)
Copy constructor.
Definition: collision/broadphase-manager-base.hpp:37
pinocchio::BroadPhaseManagerBase::BroadPhaseManagerBase
BroadPhaseManagerBase()
Default constructor.
Definition: collision/broadphase-manager-base.hpp:18
pinocchio::BroadPhaseManagerBase::derived
const Derived & derived() const
Definition: collision/broadphase-manager-base.hpp:57
geometry.hpp
pinocchio::BroadPhaseManagerBase::getGeometryData
GeometryData & getGeometryData()
Returns the geometry data associated to the manager.
Definition: collision/broadphase-manager-base.hpp:145
pinocchio::BroadPhaseManagerBase::collide
bool collide(CollisionCallBackBase *callback) const
Performs collision test for the objects belonging to the manager.
Definition: collision/broadphase-manager-base.hpp:105
pinocchio::BroadPhaseManagerBase::update
void update(bool compute_local_aabb=false)
Update the manager from the current geometry positions and update the underlying FCL broad phase mana...
Definition: collision/broadphase-manager-base.hpp:82
pinocchio::BroadPhaseManagerBase::check
bool check() const
Check whether the base broad phase manager is aligned with the current collision_objects.
Definition: collision/broadphase-manager-base.hpp:64
pinocchio::BroadPhaseManagerBase::update
void update(GeometryData *geom_data_ptr_new)
Update the manager with a new geometry data.
Definition: collision/broadphase-manager-base.hpp:92
pinocchio::GeometryModel
Definition: multibody/geometry.hpp:50
pinocchio::BroadPhaseManagerBase::model_ptr
const Model * model_ptr
Pointer to the model.
Definition: collision/broadphase-manager-base.hpp:152
pinocchio::BroadPhaseManagerBase::check
bool check(CollisionCallBackBase *callback) const
Check whether the callback is inline with *this.
Definition: collision/broadphase-manager-base.hpp:70
pinocchio::ModelTpl
Definition: context/generic.hpp:20
pinocchio::BroadPhaseManagerBase::collide
bool collide(BroadPhaseManagerBase &other_manager, CollisionCallBackBase *callback) const
Performs collision test with objects belonging to another manager.
Definition: collision/broadphase-manager-base.hpp:111
pinocchio::BroadPhaseManagerBase::BroadPhaseManagerBase
BroadPhaseManagerBase(const Model *model_ptr, const GeometryModel *geometry_model_ptr, GeometryData *geometry_data_ptr)
Constructor from a given geometry model and geometry data.
Definition: collision/broadphase-manager-base.hpp:26
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Thu Dec 19 2024 03:41:25