Unverified Commit fb5b2b73 authored by Florent Lamiraux's avatar Florent Lamiraux Committed by GitHub
Browse files

Merge pull request #177 from DianeBury/continuousValidationRefactoring

Minor changes and fixes for continuous validation
parents 27c60fe1 bb982eb4
......@@ -34,15 +34,17 @@ namespace hpp {
{
/// First object in collision
CollisionObjectConstPtr_t object1;
std::string objectName1;
/// Second object in collision
CollisionObjectConstPtr_t object2;
std::string objectName2;
/// fcl collision results
fcl::CollisionResult result;
/// Write report in a stream
virtual std::ostream& print (std::ostream& os) const
{
os << "Collision between object " << object1->name () << " and "
<< object2->name ();
os << "Collision between object " << (object1 ? object1->name() : objectName1) << " and "
<< (object2 ? object2->name() : objectName2);
return os;
}
}; // class CollisionValidationReport
......
......@@ -98,6 +98,12 @@ namespace hpp {
/// called to do the new initialization
void changeInitializer (continuousValidation::InitializerPtr_t initializer);
/// Get tolerance value
value_type tolerance () const
{
return tolerance_;
}
virtual ~ContinuousValidation ();
protected:
typedef continuousValidation::BodyPairCollisions_t BodyPairCollisions_t;
......
......@@ -90,6 +90,7 @@ namespace hpp {
virtual void addCollisionPair (const CollisionObjectConstPtr_t& /*left*/,
const CollisionObjectConstPtr_t &/*right*/) {}
virtual std::string name () const = 0;
virtual std::ostream& print (std::ostream& os) const = 0;
virtual BodyPairCollisionPtr_t copy () const = 0;
......@@ -149,7 +150,7 @@ namespace hpp {
/// \retval distanceLowerBound
/// \retval report the collision validation report
/// \return true if the bodies are not in collision, else false
bool computeDistanceLowerBound(value_type &distanceLowerBound,
virtual bool computeDistanceLowerBound(value_type &distanceLowerBound,
CollisionValidationReportPtr_t& report, pinocchio::DeviceData& data) const;
}; // class BodyPairCollision
......
......@@ -20,6 +20,7 @@
# define HPP_CORE_CONTINUOUS_VALIDATION_INITIALIZER_HH
# include <hpp/core/fwd.hh>
# include <hpp/core/continuous-validation.hh>
namespace hpp {
namespace core {
......
......@@ -47,7 +47,7 @@ namespace hpp {
{
interval.first = -std::numeric_limits <value_type>::infinity ();
interval.second = std::numeric_limits <value_type>::infinity ();
pinocchio::DeviceSync robot (robot_);
hpp::pinocchio::DeviceSync robot (robot_);
robot.currentConfiguration (config);
robot.computeForwardKinematics();
robot.updateGeometryPlacements();
......@@ -63,7 +63,6 @@ namespace hpp {
return true;
}
bool ContinuousValidation::validate(const PathPtr_t &path, bool reverse, PathPtr_t &validPart,
PathValidationReportPtr_t &report)
{
......@@ -198,7 +197,10 @@ namespace hpp {
{
ia = (*_colPair)->indexJointA ();
ib = (*_colPair)->indexJointB ();
if (ia < 0 || ib < 0) continue;
if (ia < 0 || ib < 0) {
++_colPair;
continue;
}
switch (relMotion(ia, ib))
{
case RelativeMotion::Parameterized:
......
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