collision/tree-broadphase-manager.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2022 INRIA
3 //
4 
5 #ifndef __pinocchio_collision_tree_broadphase_manager_hpp__
6 #define __pinocchio_collision_tree_broadphase_manager_hpp__
7 
9 
10 namespace pinocchio
11 {
12 
13  template<typename _Manager>
14  struct TreeBroadPhaseManagerTpl : public BroadPhaseManagerBase<TreeBroadPhaseManagerTpl<_Manager>>
15  {
16  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
17 
18  typedef _Manager Manager;
21 
22  typedef std::vector<hpp::fcl::CollisionObject *> CollisionObjectPointerVector;
23  typedef std::vector<BroadPhaseManager> BroadPhaseManagerVector;
24 
25  typedef typename BroadPhaseManager::Model Model;
28 
30  TreeBroadPhaseManagerTpl() // for std::vector
31  : Base()
32  {
33  }
34 
42  const Model * model_ptr,
43  const GeometryModel * geometry_model_ptr,
44  GeometryData * geometry_data_ptr)
45  : Base(model_ptr, geometry_model_ptr, geometry_data_ptr)
46  {
47  init(static_cast<size_t>(model_ptr->njoints));
48  }
49 
55  : Base(other)
56  {
57  init(other.managers.size());
58  }
59 
62  using Base::getModel;
63 
71  void update(bool compute_local_aabb = false);
72 
78  void update(GeometryData * geom_data_ptr_new);
79 
81  {
82  }
83 
86  bool check() const;
87 
89  bool check(CollisionCallBackBase * callback) const;
90 
93  bool collide(CollisionObject & obj, CollisionCallBackBase * callback) const;
94 
96  bool collide(CollisionCallBackBase * callback) const;
97 
99  bool collide(TreeBroadPhaseManagerTpl & other_manager, CollisionCallBackBase * callback) const;
100 
101  // /// @brief Performs distance computation between one object and all the objects belonging to
102  // the manager void distance(CollisionObject* obj, DistanceCallBackBase * callback) const;
103 
104  // /// @brief Performs distance test for the objects belonging to the manager (i.e., N^2 self
105  // distance) void distance(DistanceCallBackBase * callback) const;
106 
107  // /// @brief Performs distance test with objects belonging to another manager
108  // void distance(TreeBroadPhaseManagerTpl* other_manager, DistanceCallBackBase * callback)
109  // const;
110 
113  {
114  return managers;
115  }
116 
119  {
120  return managers;
121  }
122 
123  protected:
126 
128  void init(const size_t njoints);
129 
130  }; // struct BroadPhaseManagerTpl<BroadPhaseManagerDerived>
131 
132 } // namespace pinocchio
133 
134 /* --- Details -------------------------------------------------------------------- */
135 #include "pinocchio/collision/tree-broadphase-manager.hxx"
136 
137 #endif // ifndef __pinocchio_collision_tree_broadphase_manager_hpp__
pinocchio::TreeBroadPhaseManagerTpl::TreeBroadPhaseManagerTpl
TreeBroadPhaseManagerTpl()
Default constructor.
Definition: collision/tree-broadphase-manager.hpp:30
pinocchio::BroadPhaseManagerBase::getGeometryModel
const GeometryModel & getGeometryModel() const
Returns the geometry model associated to the manager.
Definition: collision/broadphase-manager-base.hpp:133
pinocchio::TreeBroadPhaseManagerTpl::getBroadPhaseManagers
BroadPhaseManagerVector & getBroadPhaseManagers()
Returns internal broad phase managers.
Definition: collision/tree-broadphase-manager.hpp:118
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
pinocchio::TreeBroadPhaseManagerTpl::BroadPhaseManagerVector
std::vector< BroadPhaseManager > BroadPhaseManagerVector
Definition: collision/tree-broadphase-manager.hpp:23
CollisionObject
CollisionObject(const shared_ptr< CollisionGeometry > &cgeom_, bool compute_local_aabb=true)
pinocchio::TreeBroadPhaseManagerTpl::GeometryModel
BroadPhaseManager::GeometryModel GeometryModel
Definition: collision/tree-broadphase-manager.hpp:26
pinocchio::TreeBroadPhaseManagerTpl::Base
BroadPhaseManagerBase< TreeBroadPhaseManagerTpl< _Manager > > Base
Definition: collision/tree-broadphase-manager.hpp:19
pinocchio::TreeBroadPhaseManagerTpl::Manager
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Manager Manager
Definition: collision/tree-broadphase-manager.hpp:18
pinocchio::BroadPhaseManagerBase::getModel
const Model & getModel() const
Returns the model associated to the manager.
Definition: collision/broadphase-manager-base.hpp:127
pinocchio::GeometryData
Definition: multibody/geometry.hpp:233
pinocchio::CollisionCallBackBase
Interface for Pinocchio collision callback functors.
Definition: broadphase-callbacks.hpp:19
pinocchio::TreeBroadPhaseManagerTpl::CollisionObjectPointerVector
std::vector< hpp::fcl::CollisionObject * > CollisionObjectPointerVector
Definition: collision/tree-broadphase-manager.hpp:22
pinocchio::TreeBroadPhaseManagerTpl
Definition: collision/pool/fwd.hpp:38
pinocchio::TreeBroadPhaseManagerTpl::~TreeBroadPhaseManagerTpl
~TreeBroadPhaseManagerTpl()
Definition: collision/tree-broadphase-manager.hpp:80
pinocchio::TreeBroadPhaseManagerTpl::managers
BroadPhaseManagerVector managers
the vector of collision objects.
Definition: collision/tree-broadphase-manager.hpp:125
pinocchio::TreeBroadPhaseManagerTpl::collide
bool collide(CollisionObject &obj, CollisionCallBackBase *callback) const
Performs collision test between one object and all the objects belonging to the manager.
pinocchio::TreeBroadPhaseManagerTpl::check
bool check() const
Check whether the base broad phase manager is aligned with the current collision_objects.
pinocchio::TreeBroadPhaseManagerTpl::TreeBroadPhaseManagerTpl
TreeBroadPhaseManagerTpl(const Model *model_ptr, const GeometryModel *geometry_model_ptr, GeometryData *geometry_data_ptr)
Constructor from a given geometry model and data.
Definition: collision/tree-broadphase-manager.hpp:41
pinocchio::TreeBroadPhaseManagerTpl::TreeBroadPhaseManagerTpl
TreeBroadPhaseManagerTpl(const TreeBroadPhaseManagerTpl &other)
Copy contructor.
Definition: collision/tree-broadphase-manager.hpp:54
pinocchio::TreeBroadPhaseManagerTpl::getBroadPhaseManagers
const BroadPhaseManagerVector & getBroadPhaseManagers() const
Returns internal broad phase managers.
Definition: collision/tree-broadphase-manager.hpp:112
pinocchio::TreeBroadPhaseManagerTpl::init
void init(const size_t njoints)
Initialialisation.
pinocchio::TreeBroadPhaseManagerTpl::BroadPhaseManager
BroadPhaseManagerTpl< Manager > BroadPhaseManager
Definition: collision/tree-broadphase-manager.hpp:20
pinocchio::GeometryModel
Definition: multibody/geometry.hpp:50
pinocchio::TreeBroadPhaseManagerTpl::GeometryData
BroadPhaseManager::GeometryData GeometryData
Definition: collision/tree-broadphase-manager.hpp:27
pinocchio::ModelTpl
Definition: context/generic.hpp:20
pinocchio::TreeBroadPhaseManagerTpl::Model
BroadPhaseManager::Model Model
Definition: collision/tree-broadphase-manager.hpp:25
broadphase-manager.hpp
pinocchio::BroadPhaseManagerTpl
Definition: collision/broadphase-manager.hpp:17
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27
pinocchio::ModelTpl::njoints
int njoints
Number of joints.
Definition: multibody/model.hpp:104
pinocchio::TreeBroadPhaseManagerTpl::update
void update(bool compute_local_aabb=false)
Update the manager from the current geometry positions and update the underlying FCL broad phase mana...


pinocchio
Author(s):
autogenerated on Mon Dec 16 2024 03:41:05