Verified Commit 83a586e9 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

python: expose more info when hpp-fcl is missing

parent 0abc3fef
......@@ -46,7 +46,7 @@ namespace pinocchio
}; // struct CollisionPairPythonVisitor
struct GeometryDataPythonVisitor
: public boost::python::def_visitor< GeometryDataPythonVisitor >
: public boost::python::def_visitor< GeometryDataPythonVisitor >
{
/* --- Exposing C++ API to python through the handler ----------------- */
......@@ -61,11 +61,11 @@ namespace pinocchio
&GeometryData::oMg,
"Vector of collision objects placement relative to the world frame.\n"
"note: These quantities have to be updated by calling updateGeometryPlacements.")
#ifdef PINOCCHIO_WITH_HPP_FCL
.def_readonly("activeCollisionPairs",
&GeometryData::activeCollisionPairs,
"Vector of active CollisionPairs")
#ifdef PINOCCHIO_WITH_HPP_FCL
.def_readonly("distanceRequest",
&GeometryData::distanceRequest,
"Defines which information should be computed by FCL for distance computations")
......@@ -86,6 +86,7 @@ namespace pinocchio
&GeometryData::radius,
"Vector of radius of bodies, i.e. the distance between the further point of the geometry object from the joint center.\n"
"note: This radius information might be usuful in continuous collision checking")
#endif // PINOCCHIO_WITH_HPP_FCL
.def("fillInnerOuterObjectMaps", &GeometryData::fillInnerOuterObjectMaps,
bp::args("self","GeometryModel"),
......@@ -98,9 +99,6 @@ namespace pinocchio
.def("deactivateCollisionPair",&GeometryData::deactivateCollisionPair,
bp::args("self","pair_id"),
"Deactivate the collsion pair pair_id in geomModel.collisionPairs if it exists.")
#endif // PINOCCHIO_WITH_HPP_FCL
;
}
......
......@@ -172,6 +172,7 @@ namespace pinocchio
enum { Options = 0 };
typedef SE3Tpl<Scalar,Options> SE3;
typedef std::vector<GeomIndex> GeomIndexList;
///
/// \brief Vector gathering the SE3 placements of the geometry objects relative to the world.
......@@ -182,6 +183,11 @@ namespace pinocchio
///
PINOCCHIO_ALIGNED_STD_VECTOR(SE3) oMg;
///
/// \brief Vector of collision pairs.
///
std::vector<bool> activeCollisionPairs;
#ifdef PINOCCHIO_WITH_HPP_FCL
///
/// \brief Collision objects (ie a fcl placed geometry).
......@@ -191,11 +197,6 @@ namespace pinocchio
///
std::vector<fcl::CollisionObject> collisionObjects;
///
/// \brief Vector of collision pairs.
///
std::vector<bool> activeCollisionPairs;
///
/// \brief Defines what information should be computed by distance computation.
///
......@@ -223,7 +224,7 @@ namespace pinocchio
std::vector<double> radius;
///
/// \brief index of the collision pair
/// \brief Index of the collision pair
///
/// It is used by some method to return additional information. For instance,
/// the algo computeCollisions() sets it to the first colliding pair.
......@@ -248,8 +249,6 @@ namespace pinocchio
GeometryData(const GeometryModel & geomModel);
~GeometryData() {};
#ifdef PINOCCHIO_WITH_HPP_FCL
/// Fill both innerObjects and outerObjects maps, from vectors collisionObjects and
/// collisionPairs.
///
......@@ -287,7 +286,6 @@ namespace pinocchio
///
void deactivateCollisionPair(const PairIndex pairId);
#endif //PINOCCHIO_WITH_HPP_FCL
friend std::ostream & operator<<(std::ostream & os, const GeometryData & geomData);
}; // struct GeometryData
......
......@@ -13,9 +13,8 @@ namespace pinocchio
{
inline GeometryData::GeometryData(const GeometryModel & geom_model)
: oMg(geom_model.ngeoms)
#ifdef PINOCCHIO_WITH_HPP_FCL
, activeCollisionPairs(geom_model.collisionPairs.size(), true)
#ifdef PINOCCHIO_WITH_HPP_FCL
, distanceRequest(true)
, distanceResults(geom_model.collisionPairs.size())
, collisionRequest(::hpp::fcl::NO_REQUEST,1)
......@@ -68,8 +67,6 @@ namespace pinocchio
return GeomIndex(it - geometryObjects.begin());
}
inline bool GeometryModel::existGeometryName(const std::string & name) const
{
return std::find_if(geometryObjects.begin(),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment