Verified Commit 9c38b775 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

geometry: rename pairId into pair_id

parent e4dbe7fc
//
// Copyright (c) 2015-2020 CNRS INRIA
// Copyright (c) 2015-2021 CNRS INRIA
//
#ifndef __pinocchio_algo_geometry_hpp__
......@@ -90,14 +90,14 @@ namespace pinocchio
///
/// \param[in] GeomModel the geometry model (const)
/// \param[out] GeomData the corresponding geometry data, where computations are done.
/// \param[in] pairId The collsion pair index in the GeometryModel.
/// \param[in] pair_id The collsion pair index in the GeometryModel.
///
/// \return Return true is the collision objects are colliding.
/// \note The complete collision result is also available in geom_data.collisionResults[pairId]
/// \note The complete collision result is also available in geom_data.collisionResults[pair_id]
///
bool computeCollision(const GeometryModel & geom_model,
GeometryData & geom_data,
const PairIndex & pairId);
const PairIndex & pair_id);
///
/// \brief Calls computeCollision for every active pairs of GeometryData.
......@@ -145,15 +145,15 @@ namespace pinocchio
///
/// \param[in] GeomModel the geometry model (const)
/// \param[out] GeomData the corresponding geometry data, where computations are done.
/// \param[in] pairId The index of the collision pair in geom model.
/// \param[in] pair_id The index of the collision pair in geom model.
///
/// \return A reference on fcl struct containing the distance result, referring an element
/// of vector geom_data::distanceResults.
/// \note The complete distance result is also available in geom_data.distanceResults[pairId]
/// \note The complete distance result is also available in geom_data.distanceResults[pair_id]
///
fcl::DistanceResult & computeDistance(const GeometryModel & geom_model,
GeometryData & geom_data,
const PairIndex & pairId);
const PairIndex & pair_id);
///
/// Compute the forward kinematics, update the geometry placements and
......
......@@ -50,16 +50,16 @@ namespace pinocchio
inline bool computeCollision(const GeometryModel & geom_model,
GeometryData & geom_data,
const PairIndex & pairId)
const PairIndex & pair_id)
{
PINOCCHIO_CHECK_INPUT_ARGUMENT( pairId < geom_model.collisionPairs.size() );
const CollisionPair & pair = geom_model.collisionPairs[pairId];
PINOCCHIO_CHECK_INPUT_ARGUMENT( pair_id < geom_model.collisionPairs.size() );
const CollisionPair & pair = geom_model.collisionPairs[pair_id];
PINOCCHIO_CHECK_INPUT_ARGUMENT( pairId < geom_data.collisionResults.size() );
PINOCCHIO_CHECK_INPUT_ARGUMENT( pair_id < geom_data.collisionResults.size() );
PINOCCHIO_CHECK_INPUT_ARGUMENT( pair.first < geom_model.ngeoms );
PINOCCHIO_CHECK_INPUT_ARGUMENT( pair.second < geom_model.ngeoms );
fcl::CollisionResult& collisionResult = geom_data.collisionResults[pairId];
fcl::CollisionResult& collisionResult = geom_data.collisionResults[pair_id];
collisionResult.clear();
fcl::Transform3f oM1 (toFclTransform3f(geom_data.oMg[pair.first ])),
......@@ -69,13 +69,13 @@ namespace pinocchio
{
fcl::collide(geom_model.geometryObjects[pair.first ].geometry.get(), oM1,
geom_model.geometryObjects[pair.second].geometry.get(), oM2,
geom_data.collisionRequests[pairId],
geom_data.collisionRequests[pair_id],
collisionResult);
}
catch(std::invalid_argument & e)
{
std::stringstream ss;
ss << "Problem when trying to check the collision of collision pair #" << pairId << " (" << pair.first << "," << pair.second << ")" << std::endl;
ss << "Problem when trying to check the collision of collision pair #" << pair_id << " (" << pair.first << "," << pair.second << ")" << std::endl;
ss << e.what() << std::endl;
throw std::invalid_argument(ss.str());
}
......@@ -130,16 +130,16 @@ namespace pinocchio
inline fcl::DistanceResult & computeDistance(const GeometryModel & geom_model,
GeometryData & geom_data,
const PairIndex & pairId)
const PairIndex & pair_id)
{
PINOCCHIO_CHECK_INPUT_ARGUMENT( pairId < geom_model.collisionPairs.size() );
const CollisionPair & pair = geom_model.collisionPairs[pairId];
PINOCCHIO_CHECK_INPUT_ARGUMENT( pair_id < geom_model.collisionPairs.size() );
const CollisionPair & pair = geom_model.collisionPairs[pair_id];
PINOCCHIO_CHECK_INPUT_ARGUMENT( pairId < geom_data.distanceResults.size() );
PINOCCHIO_CHECK_INPUT_ARGUMENT( pair_id < geom_data.distanceResults.size() );
PINOCCHIO_CHECK_INPUT_ARGUMENT( pair.first < geom_model.ngeoms );
PINOCCHIO_CHECK_INPUT_ARGUMENT( pair.second < geom_model.ngeoms );
geom_data.distanceResults[pairId].clear();
geom_data.distanceResults[pair_id].clear();
fcl::Transform3f oM1 (toFclTransform3f(geom_data.oMg[pair.first ])),
oM2 (toFclTransform3f(geom_data.oMg[pair.second]));
......@@ -147,18 +147,18 @@ namespace pinocchio
{
fcl::distance( geom_model.geometryObjects[pair.first ].geometry.get(), oM1,
geom_model.geometryObjects[pair.second].geometry.get(), oM2,
geom_data.distanceRequests[pairId],
geom_data.distanceResults[pairId]);
geom_data.distanceRequests[pair_id],
geom_data.distanceResults[pair_id]);
}
catch(std::invalid_argument & e)
{
std::stringstream ss;
ss << "Problem when trying to compute the distance of collision pair #" << pairId << " (" << pair.first << "," << pair.second << ")" << std::endl;
ss << "Problem when trying to compute the distance of collision pair #" << pair_id << " (" << pair.first << "," << pair.second << ")" << std::endl;
ss << e.what() << std::endl;
throw std::invalid_argument(ss.str());
}
return geom_data.distanceResults[pairId];
return geom_data.distanceResults[pair_id];
}
inline std::size_t computeDistances(const GeometryModel & geom_model,
......
......@@ -272,11 +272,11 @@ namespace pinocchio
/// condition can be used to temporarily remove a pair without touching the model, in a versatile
/// manner.
///
/// \param[in] pairId the index of the pair in GeomModel::collisionPairs vector.
/// \param[in] pair_id the index of the pair in GeomModel::collisionPairs vector.
///
/// \sa GeomData
///
void activateCollisionPair(const PairIndex pairId);
void activateCollisionPair(const PairIndex pair_id);
///
/// \brief Activate all collision pairs.
......@@ -300,13 +300,13 @@ namespace pinocchio
///
/// Deactivate a collision pair.
///
/// Calls indeed GeomData::activateCollisionPair(pairId)
/// Calls indeed GeomData::activateCollisionPair(pair_id)
///
/// \param[in] pairId the index of the pair in GeomModel::collisionPairs vector.
/// \param[in] pair_id the index of the pair in GeomModel::collisionPairs vector.
///
/// \sa GeomData::activateCollisionPair
///
void deactivateCollisionPair(const PairIndex pairId);
void deactivateCollisionPair(const PairIndex pair_id);
///
/// \brief Deactivate all collision pairs.
......
......@@ -235,11 +235,11 @@ namespace pinocchio
return (PairIndex) std::distance(collisionPairs.begin(), it);
}
inline void GeometryData::activateCollisionPair(const PairIndex pairId)
inline void GeometryData::activateCollisionPair(const PairIndex pair_id)
{
PINOCCHIO_CHECK_INPUT_ARGUMENT(pairId < activeCollisionPairs.size(),
"The input argument pairId is larger than the number of collision pairs contained in activeCollisionPairs.");
activeCollisionPairs[pairId] = true;
PINOCCHIO_CHECK_INPUT_ARGUMENT(pair_id < activeCollisionPairs.size(),
"The input argument pair_id is larger than the number of collision pairs contained in activeCollisionPairs.");
activeCollisionPairs[pair_id] = true;
}
inline void GeometryData::activateAllCollisionPairs()
......@@ -305,11 +305,11 @@ namespace pinocchio
}
}
inline void GeometryData::deactivateCollisionPair(const PairIndex pairId)
inline void GeometryData::deactivateCollisionPair(const PairIndex pair_id)
{
PINOCCHIO_CHECK_INPUT_ARGUMENT(pairId < activeCollisionPairs.size(),
"The input argument pairId is larger than the number of collision pairs contained in activeCollisionPairs.");
activeCollisionPairs[pairId] = false;
PINOCCHIO_CHECK_INPUT_ARGUMENT(pair_id < activeCollisionPairs.size(),
"The input argument pair_id is larger than the number of collision pairs contained in activeCollisionPairs.");
activeCollisionPairs[pair_id] = false;
}
inline void GeometryData::deactivateAllCollisionPairs()
......
Supports Markdown
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