18 #ifndef __se3_geometry_hxx__ 19 #define __se3_geometry_hxx__ 30 inline GeometryData::GeometryData(
const GeometryModel & modelGeom)
31 : oMg(modelGeom.ngeoms)
34 , activeCollisionPairs(modelGeom.collisionPairs.size(), true)
35 , distanceRequest (true, 0, 0, fcl::GST_INDEP)
36 , distanceResults(modelGeom.collisionPairs.size())
37 , collisionRequest (1, false, false, 1, false, true, fcl::GST_INDEP)
38 , collisionResults(modelGeom.collisionPairs.size())
40 , collisionPairIndex(0)
44 collisionObjects.reserve(modelGeom.geometryObjects.size());
45 BOOST_FOREACH(
const GeometryObject & geom, modelGeom.geometryObjects)
46 { collisionObjects.push_back
47 (fcl::CollisionObject(geom.fcl)); }
48 fillInnerOuterObjectMaps(modelGeom);
52 #endif // WITH_HPP_FCL 56 const bool autofillJointParent)
60 if( autofillJointParent )
62 object.parentJoint = model.
frames[
object.parentFrame].parent;
65 (model.
frames[
object.parentFrame].type == se3::BODY) );
67 (model.
frames[
object.parentFrame].parent ==
object.parentJoint) );
69 GeomIndex idx = (GeomIndex) (
ngeoms ++);
136 innerObjects.clear();
137 outerObjects.clear();
140 innerObjects[geomModel.
geometryObjects[gid].parentJoint].push_back(gid);
144 outerObjects[geomModel.
geometryObjects[pair.first].parentJoint].push_back(pair.second);
149 inline std::ostream & operator<< (std::ostream & os,
const GeometryModel & geomModel)
151 os <<
"Nb geometry objects = " << geomModel.
ngeoms << std::endl;
153 for(GeomIndex i=0;i<(GeomIndex)(geomModel.
ngeoms);++i)
161 inline std::ostream & operator<< (std::ostream & os,
const GeometryData & geomData)
171 os <<
"WARNING** Without fcl library, no collision checking or distance computations are possible. Only geometry placements can be computed." << std::endl;
172 os <<
"Number of geometry objects = " << geomData.
oMg.size() << std::endl;
182 assert( (pair.first <
ngeoms) && (pair.second <
ngeoms) );
189 for (GeomIndex i = 0; i <
ngeoms; ++i)
192 for (GeomIndex j = i+1; j <
ngeoms; ++j)
195 if (joint_i != joint_j)
203 assert( (pair.first <
ngeoms) && (pair.second <
ngeoms) );
205 CollisionPairsVector_t::iterator it = std::find(
collisionPairs.begin(),
222 CollisionPairsVector_t::const_iterator it = std::find(
collisionPairs.begin(),
231 assert( pairId < activeCollisionPairs.size() );
232 activeCollisionPairs[pairId] = flag;
237 assert( pairId < activeCollisionPairs.size() );
238 activeCollisionPairs[pairId] =
false;
241 #endif //WITH_HPP_FCL 246 #endif // ifndef __se3_geometry_hxx__ void activateCollisionPair(const PairIndex pairId, const bool flag=true)
container::aligned_vector< GeometryObject > geometryObjects
Vector of GeometryObjects used for collision computations.
GeomIndex getGeometryId(const std::string &name) const
Return the index of a GeometryObject given by its name.
void addCollisionPair(const CollisionPair &pair)
Add a collision pair into the vector of collision_pairs. The method check before if the given Collisi...
void removeAllCollisionPairs()
Remove all collision pairs from collisionPairs. Same as collisionPairs.clear().
std::vector< bool > activeCollisionPairs
Vector of collision pairs.
container::aligned_vector< Frame > frames
Vector of operational frames registered on the model.
void addAllCollisionPairs()
Add all possible collision pairs.
PINOCCHIO_DEPRECATED const std::string & getGeometryName(const GeomIndex index) const
Get the name of a GeometryObject given by its index.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW std::string name
Name of the geometry object.
std::string name(const LieGroupVariant &lg)
Visit a LieGroupVariant to get the name of it.
void fillInnerOuterObjectMaps(const GeometryModel &geomModel)
std::vector< CollisionPair > collisionPairs
Vector of collision pairs.
void deactivateCollisionPair(const PairIndex pairId)
void removeCollisionPair(const CollisionPair &pair)
Remove if exists the CollisionPair from the vector collision_pairs.
bool existCollisionPair(const CollisionPair &pair) const
Check if a collision pair exists in collisionPairs. See also findCollisitionPair(const CollisionPair ...
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Index ngeoms
The number of GeometryObjects.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW container::aligned_vector< se3::SE3 > oMg
Vector gathering the SE3 placements of the geometry objects relative to the world. See updateGeometryPlacements to update the placements.
GeomIndex addGeometryObject(GeometryObject object, const Model &model, const bool autofillJointParent=false)
Add a geometry object to a GeometryModel.
PairIndex findCollisionPair(const CollisionPair &pair) const
Return the index of a given collision pair in collisionPairs.
Specialization of an std::vector with an aligned allocator. This specialization might be used when th...
bool existGeometryName(const std::string &name) const
Check if a GeometryObject given by its name exists.