broadphase.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2022 INRIA
3 //
4 
5 #ifndef __pinocchio_collision_broadphase_hpp__
6 #define __pinocchio_collision_broadphase_hpp__
7 
9 
11 
13 
16 
17 namespace pinocchio
18 {
19 
33  template<typename BroadPhaseManagerDerived>
36  CollisionCallBackBase * callback)
37  {
38  PINOCCHIO_CHECK_INPUT_ARGUMENT(broadphase_manager.check(callback));
39  broadphase_manager.collide(callback);
40  callback->done();
41  return callback->collision;
42  }
43 
56  template<typename BroadPhaseManagerDerived>
59  const bool stopAtFirstCollision = false)
60  {
62  broadphase_manager.getGeometryModel(), broadphase_manager.getGeometryData(),
63  stopAtFirstCollision);
64 
65  return computeCollisions(broadphase_manager, &callback);
66  }
67 
88  template<
89  typename Scalar,
90  int Options,
91  template<typename, int> class JointCollectionTpl,
92  typename BroadPhaseManagerDerived,
93  typename ConfigVectorType>
94  inline bool computeCollisions(
98  CollisionCallBackBase * callback,
99  const Eigen::MatrixBase<ConfigVectorType> & q)
100  {
102  model, data, broadphase_manager.getGeometryModel(), broadphase_manager.getGeometryData(), q);
103 
104  broadphase_manager.update(false);
105  return computeCollisions(broadphase_manager, &callback);
106  }
107 
127  template<
128  typename Scalar,
129  int Options,
130  template<typename, int> class JointCollectionTpl,
131  typename BroadPhaseManagerDerived,
132  typename ConfigVectorType>
133  inline bool computeCollisions(
137  const Eigen::MatrixBase<ConfigVectorType> & q,
138  const bool stopAtFirstCollision = false)
139  {
141  model, data, broadphase_manager.getGeometryModel(), broadphase_manager.getGeometryData(), q);
142 
143  broadphase_manager.update(false);
144 
146  broadphase_manager.getGeometryModel(), broadphase_manager.getGeometryData(),
147  stopAtFirstCollision);
148  return computeCollisions(broadphase_manager, &callback);
149  }
150 
151 } // namespace pinocchio
152 
153 /* --- Details -------------------------------------------------------------------- */
154 #include "pinocchio/collision/broadphase.hxx"
155 
156 #endif // ifndef __pinocchio_collision_broadphase_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
pinocchio::DataTpl
Definition: context/generic.hpp:25
callback
callback
PINOCCHIO_CHECK_INPUT_ARGUMENT
#define PINOCCHIO_CHECK_INPUT_ARGUMENT(...)
Macro to check an assert-like condition and throw a std::invalid_argument exception (with a message) ...
Definition: include/pinocchio/macros.hpp:192
pinocchio::computeCollisions
bool computeCollisions(BroadPhaseManagerBase< BroadPhaseManagerDerived > &broadphase_manager, CollisionCallBackBase *callback)
Calls computeCollision for every active pairs of GeometryData. This function assumes that updateGeome...
Definition: broadphase.hpp:34
pinocchio::updateGeometryPlacements
void updateGeometryPlacements(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const GeometryModel &geom_model, GeometryData &geom_data, const Eigen::MatrixBase< ConfigVectorType > &q)
Apply a forward kinematics and update the placement of the geometry objects.
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::Options
Options
Definition: joint-configuration.hpp:1082
broadphase-callbacks.hpp
setup.data
data
Definition: cmake/cython/setup.in.py:48
pinocchio::CollisionCallBackDefault
Definition: broadphase-callbacks.hpp:66
broadphase_collision_manager.h
pinocchio::python::Scalar
context::Scalar Scalar
Definition: admm-solver.cpp:29
pinocchio::CollisionCallBackBase
Interface for Pinocchio collision callback functors.
Definition: broadphase-callbacks.hpp:19
fcl.hpp
geometry.hpp
pinocchio::q
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > & q
Definition: joint-configuration.hpp:1083
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::ModelTpl
Definition: context/generic.hpp:20
broadphase-manager.hpp
pinocchio::model
JointCollectionTpl & model
Definition: joint-configuration.hpp:1082
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


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