cd.c File Reference Detailed DescriptionImplementation of the interface with the collision detection engine. Different collision detection engines offer different performances and even different capabilities. Moreover, some applications require specific collision detection procedures (distance between bodies, interpretration, separating normal, etc). In general, the more the functionality of the collision detection engine the slower the process. Thus, a trade off must be reached for each application.
Definition in file cd.c.
Function Documentation
Stores the information collected during last collision check into a file. The information printed is in the form of a matlab script that can be directly used to generate contact variables and equations from the collision info. This relies on the existence of additiona matlab scripts describing the geometry of the objects. We used this to generate contact aware cuik systems by using cuikmove to select the initial grasp. This is part of our grasping pipeline. This function assumes that the object ot grasp is the last link in the world file.
Definition at line 2038 of file cd.c. References GetLinkName(), GetMechanismLink(), HTransformPrint(), TCollisionInfo::id1, TCollisionInfo::id2, TCollisionInfo::isLink1, TCollisionInfo::isLink2, NO_UINT, TCollisionInfo::t1, and TCollisionInfo::t2. Referenced by StoreCollisionInfo().
Prints information about the last collision check. See PrintCollisionInfo for more details.
Definition at line 2102 of file cd.c. References GetLinkName(), GetMechanismLink(), GetObstacleName(), HTransformApply(), HTransformDelete(), HTransformInverse(), TCollisionInfo::isLink1, and TCollisionInfo::isLink2. Referenced by PrintCollisionInfo().
Callback called whenever a collision is detected. This is the version where we print info about the collisions: colliding links, collision points, and normal in the collision. We only print information about the first detected collision.
Definition at line 455 of file cd.c. References TsolidObj::bodyID, TsolidCD::collision, FALSE, HTransformCopy(), HTransformIdentity(), TCollisionInfo::id1, TCollisionInfo::id2, TCollisionInfo::isLink1, TCollisionInfo::isLink2, TsolidObj::linkID, TsolidCD::mc, MEM_DUP, TsolidCD::nc, NO_UINT, Norm(), TCollisionInfo::normal, TsolidCD::object, TCollisionInfo::point, ScaleVector(), TsolidCD::simple, TsolidObj::t, TCollisionInfo::t1, TCollisionInfo::t2, TRUE, and ZERO. Referenced by InitSolidCD().
Adds the shape to the current collision detection. Note that the collision detection structure is not passed as a parameter to this function since we use SOLID that relies on global variables (not so good programming style).
Definition at line 524 of file cd.c. References CYLINDER, DECOR_SHAPE, Error(), GetOFFInfo(), GetPolyhedronRadius(), GetPolyhedronStatus(), GetPolyhedronType(), LINE, OFF, SEGMENTS, and SPHERE. Referenced by InitSolidCD().
The SOLID collision detection software define shapes in a pre-defined positions (spheres centered at 0, cylinders aligned with the Y axis,...). This function returns a homogeneous matrix that places the convex polyhedron in its correct position from the default position of the collision detector.
Definition at line 584 of file cd.c. References CYLINDER, DECOR_SHAPE, Error(), GetPolyhedronCenter(), GetPolyhedronDefiningPoint(), GetPolyhedronStatus(), GetPolyhedronType(), HTransformIdentity(), HTransformIsIdentity(), HTransformProduct(), HTransformRz2(), HTransformTxyz(), HTransformTy(), HTransformX2Vect(), LINE, OFF, SEGMENTS, and SPHERE. Referenced by InitSolidCD().
Initializes the Solid collision engine.
Definition at line 627 of file cd.c. References AddShape2Solid(), TsolidObj::bodyID, CDCallBackInfo(), TsolidCD::collision, TsolidObj::correction, DECOR_SHAPE, GetEnvironmentNObstacles(), GetLinkBody(), GetLinkBodyStatus(), GetMechanismLink(), GetMechanismNBodies(), GetMechanismNLinks(), GetObstacleShape(), GetObstacleShapeStatus(), TsolidObj::handler, HTransform2GLMatrix(), HTransformIdentity(), TsolidObj::id, LinkCanCollide(), TsolidObj::linkID, LinkNBodies(), TsolidCD::mc, TsolidCD::nc, NEW, NO_UINT, TsolidCD::np, TsolidCD::object, ObstacleCanCollide(), TsolidObj::respClass, TsolidCD::respTable, TsolidCD::scene, TsolidObj::shape, TsolidCD::simple, SolidCorrection(), TsolidObj::t, TsolidObj::tc, and TRUE. Referenced by InitCD().
Determines if there is a collision using the SOLID collision engine.
Definition at line 778 of file cd.c. References TsolidObj::bodyID, TsolidCD::collision, TsolidObj::correction, EmptyLinkConf(), GetLinkConfTransform(), TsolidObj::handler, HTransform2GLMatrix(), HTransformCopy(), HTransformDelete(), HTransformProduct(), TsolidObj::linkID, TsolidCD::nc, NO_UINT, TsolidCD::np, TsolidCD::object, TsolidCD::respTable, TsolidCD::scene, TsolidCD::simple, TsolidObj::t, and TsolidObj::tc. Referenced by CheckCollision().
Deletes the Solid related collision information.
Definition at line 835 of file cd.c. References TsolidCD::collision, TsolidObj::handler, HTransformDelete(), TsolidCD::np, TsolidCD::object, TsolidCD::respTable, TsolidCD::scene, TsolidObj::shape, TsolidObj::t, and TsolidObj::tc. Referenced by DeleteCD().
Initializes the Vcollide collision engine.
Definition at line 861 of file cd.c. References ActivateCollisionsVcollide(), AddPolyhedron2Vcollide(), TvcollideCD::bodyID, DeactivateCollisionsVcollide(), DECOR_SHAPE, GetEnvironmentNObstacles(), GetLinkBody(), GetLinkBodyStatus(), GetMechanismLink(), GetMechanismNBodies(), GetMechanismNLinks(), GetObstacleShape(), GetObstacleShapeStatus(), GetOFFInfo(), InitVcollide(), LinkCanCollide(), TvcollideCD::linkID, LinkNBodies(), NEW, NO_UINT, TvcollideCD::np, ObstacleCanCollide(), TvcollideCD::vc, and TvcollideCD::vcID. Referenced by InitCD().
Determines if there is a collision using the VCOLLIDE collision engine.
Definition at line 958 of file cd.c. References TvcollideCD::linkID, MoveVcollideObject(), NO_UINT, TvcollideCD::np, TvcollideCD::vc, TvcollideCD::vcID, and VcollideTest(). Referenced by CheckCollision().
Deletes the Vcollide related collision information.
Definition at line 974 of file cd.c. References TvcollideCD::bodyID, DeleteVcollide(), DeleteVcollideObject(), TvcollideCD::linkID, TvcollideCD::np, TvcollideCD::vc, and TvcollideCD::vcID. Referenced by DeleteCD().
Initializes the PQP collision engine.
Definition at line 992 of file cd.c. References TpqpCD::bodyID, DECOR_SHAPE, DefinePQPModel(), GetEnvironmentNObstacles(), GetLinkBody(), GetLinkBodyStatus(), GetMechanismLink(), GetMechanismNBodies(), GetMechanismNLinks(), GetObstacleShape(), GetObstacleShapeStatus(), GetOFFInfo(), LinkCanCollide(), TpqpCD::linkID, LinkNBodies(), TpqpCD::model, NEW, NO_UINT, TpqpCD::np, TpqpCD::nPairs, ObstacleCanCollide(), TpqpCD::p1, and TpqpCD::p2. Referenced by InitCD().
Determines if there is a collision using the PQP collision engine.
Definition at line 1093 of file cd.c. References FALSE, TpqpCD::linkID, TpqpCD::model, NO_UINT, TpqpCD::p1, TpqpCD::p2, and PQPTest(). Referenced by CheckCollision().
Deletes the PQP related collision information.
Definition at line 1126 of file cd.c. References TpqpCD::bodyID, DeletePQPModel(), TpqpCD::linkID, TpqpCD::model, TpqpCD::np, TpqpCD::p1, and TpqpCD::p2. Referenced by DeleteCD().
Initializes the collision detector.
Definition at line 2135 of file cd.c. References BULLET, TworldCD::bullet, C_BULLET, C_FCL, TworldCD::engine, Error(), FCL, TworldCD::fcl, InitPQPCD(), InitSolidCD(), InitVcollideCD(), NEW, NOCD, PQP, TworldCD::pqp, RIGIDCLL, TworldCD::rigidCLL, SOLID, TworldCD::solid, VCOLLIDE, and TworldCD::vcollide. Referenced by InitWorldCD().
Identifies links that can collide either with other links or with obstacles.
Definition at line 2218 of file cd.c. References FALSE. Referenced by AnyCollision(), InitPQPCD(), InitSolidCD(), and InitVcollideCD(). Identifies obstacles that can collide a given link..
Definition at line 2240 of file cd.c. References FALSE. Referenced by InitPQPCD(), InitSolidCD(), and InitVcollideCD().
Determines the collision library used.
Definition at line 2255 of file cd.c. References TworldCD::engine. Referenced by MoveAndCheckCD(), and WorldContinuousCD().
Determines if there is a collision.
Definition at line 2260 of file cd.c. References BULLET, TworldCD::bullet, C_BULLET, C_FCL, CheckCollisionPQP(), CheckCollisionSolid(), CheckCollisionVcollide(), TworldCD::engine, Error(), FALSE, FCL, TworldCD::fcl, NOCD, PQP, TworldCD::pqp, RIGIDCLL, TworldCD::rigidCLL, SOLID, TworldCD::solid, VCOLLIDE, and TworldCD::vcollide. Referenced by MoveAndCheckCDFromTransforms().
Stores information collected during last collision check into a file. This is only used from the cuikmove application, when using the "save" option. The information to be stored is collected during the collision detection and latter compleated in a call to PrintCollisionInfo. In other words, this function can only be used after detecting a collision and after calling PrintCollisionInfo. The cuikmove alrady coordinates these steps: it first uses MoveWorldDOF and if the user press the "Save" button, it then calls this function. Up to now this only works for the SOLID collision engine. See StoreCollisionInfoInt for more deatils.
Definition at line 2346 of file cd.c. References BULLET, TworldCD::bullet, TsolidCD::collision, TworldCD::engine, Error(), FCL, TworldCD::fcl, TsolidCD::nc, SOLID, TworldCD::solid, and StoreCollisionInfoInt(). Referenced by PrintWorldCollisionInfo().
Prints some information collected during last collision check. Up to now this only works for the SOLID collision engine. This is used when obtain contact information while interactively moving the robots.
Definition at line 2374 of file cd.c. References BULLET, TworldCD::bullet, TsolidCD::collision, TworldCD::engine, Error(), FCL, TworldCD::fcl, TsolidCD::nc, PrintCollisionInfoInt(), SOLID, and TworldCD::solid. Referenced by MoveAndCheckCDFromTransforms().
Releases the structures used for collision detection.
Definition at line 2403 of file cd.c. References BULLET, TworldCD::bullet, C_BULLET, C_FCL, DeletePQPCD(), DeleteSolidCD(), DeleteVcollideCD(), TworldCD::engine, Error(), FCL, TworldCD::fcl, NOCD, PQP, TworldCD::pqp, RIGIDCLL, TworldCD::rigidCLL, SOLID, TworldCD::solid, VCOLLIDE, and TworldCD::vcollide. Referenced by DeleteWorldCD(), and InitWorldCD(). |
Follow us!