Go to the documentation of this file.
5 #ifndef __pinocchio_collision_broadphase_callback_hpp__
6 #define __pinocchio_collision_broadphase_callback_hpp__
44 virtual bool stop()
const = 0;
93 assert(!
stop() &&
"must never happened");
98 const Eigen::DenseIndex go1_index = (Eigen::DenseIndex)co1.geometryObjectIndex;
99 const Eigen::DenseIndex go2_index = (Eigen::DenseIndex)co2.geometryObjectIndex;
104 go1_index < (Eigen::DenseIndex)geometry_model.
ngeoms && go1_index >= 0);
106 go2_index < (Eigen::DenseIndex)geometry_model.
ngeoms && go2_index >= 0);
109 if (pair_index == -1)
114 const bool do_collision_check =
119 if (!do_collision_check)
124 fcl::CollisionRequest collision_request(
126 collision_request.gjk_variant = fcl::GJKVariant::NesterovAcceleration;
130 co1.collisionGeometry().get()
132 || co2.collisionGeometry().get()
135 std::logic_error,
"go1: " << go1_index <<
" or go2: " << go2_index
136 <<
" have not been updated and have missmatching pointers.");
149 catch (std::logic_error & e)
152 std::logic_error,
"Geometries with index go1: "
153 << go1_index <<
" or go2: " << go2_index
154 <<
" have produced an internal error within HPP-FCL.\n what:\n"
199 #include "pinocchio/collision/broadphase-callbacks.hxx"
201 #endif // ifndef __pinocchio_collision_broadphase_callback_hpp__
GeometryData & getGeometryData()
bool stopAtFirstCollision
Whether to stop or not when localizing a first collision.
#define PINOCCHIO_CHECK_INPUT_ARGUMENT(...)
Macro to check an assert-like condition and throw a std::invalid_argument exception (with a message) ...
bool stop() const final
If true, the stopping criteria related to the collision callback has been met and one can stop.
bool accumulate
Whether the callback is used in an accumulate mode where several collide methods are called successiv...
CollisionObject(const shared_ptr< CollisionGeometry > &cgeom_, bool compute_local_aabb=true)
const GeometryModel & getGeometryModel() const
CollisionCallBackBase(const GeometryModel &geometry_model, GeometryData &geometry_data)
Interface for Pinocchio collision callback functors.
GeometryObjectVector geometryObjects
Vector of GeometryObjects used for collision computations.
virtual bool stop() const =0
If true, the stopping criteria related to the collision callback has been met and one can stop.
MatrixXi collisionPairMapping
Matrix relating the collision pair ID to a pair of two GeometryObject indexes.
std::vector< bool > activeCollisionPairs
Vector of collision pairs.
#define PINOCCHIO_THROW_PRETTY(exception, message)
bool computeCollision(const GeometryModel &geom_model, GeometryData &geom_data, const PairIndex pair_id, fcl::CollisionRequest &collision_request)
Compute the collision status between a SINGLE collision pair. The result is store in the collisionRes...
CollisionCallBackDefault(const GeometryModel &geometry_model, GeometryData &geometry_data, bool stopAtFirstCollision=false)
size_t count
Number of visits of the collide method.
Index ngeoms
The number of GeometryObjects.
PairIndex collisionPairIndex
The collision index of the first pair in collision.
bool collide(hpp::fcl::CollisionObject *o1, hpp::fcl::CollisionObject *o2)
const GeometryModel * geometry_model_ptr
Geometry model associated to the callback.
CollisionPairVector collisionPairs
Vector of collision pairs.
bool collision
Whether there is a collision or not.
const GeometryData & getGeometryData() const
GeometryData * geometry_data_ptr
Geometry data associated to the callback.
virtual void done()
Callback method called after the termination of a collisition detection algorithm....
AD< Scalar > max(const AD< Scalar > &x, const AD< Scalar > &y)
void done() final
Callback method called after the termination of a collisition detection algorithm....
Main pinocchio namespace.
pinocchio
Author(s):
autogenerated on Thu Dec 19 2024 03:41:25