Commit cd790bd8 authored by Florent Lamiraux's avatar Florent Lamiraux Committed by Florent Lamiraux florent@laas.fr
Browse files

Merge remote-tracking branch 'jmirabel/devel' into k-prm-star

parents 3d736e7f 78b8aaf8
......@@ -419,6 +419,15 @@ namespace hpp {
/// \name Obstacles
/// \{
/// Add collision objects of a device as obstacles to the list.
/// \param device the Device to be added.
/// \param collision whether collision checking should be performed
/// for this object.
/// \param distance whether distance computation should be performed
/// for this object.
virtual void addObstacle (const DevicePtr_t& device, bool collision,
bool distance);
/// Add obstacle to the list.
/// \param inObject a new object.
/// \param collision whether collision checking should be performed
......
......@@ -115,15 +115,6 @@ namespace hpp {
const Model obsModel = initObstacleModel();
}
// Struct that constructs an empty shared pointer to PathOptimizer.
struct NoneOptimizer
{
static PathOptimizerPtr_t create (const Problem&)
{
return PathOptimizerPtr_t ();
}
}; // struct NoneOptimizer
// Struct that constructs an empty shared pointer to PathProjector.
struct NonePathProjector
{
......@@ -184,16 +175,10 @@ namespace hpp {
configurationShooters.add ("BasicConfigurationShooter", BasicConfigurationShooter::create);
// TODO "WeighedDistance" is kept for backward compatibility
distances.add ("WeighedDistance", WeighedDistance::createFromProblem);
distances.add ("Weighed", WeighedDistance::createFromProblem);
distances.add ("ReedsShepp", bind (distance::ReedsShepp::create, _1));
// TODO "SteeringMethodStraight" is kept for backward compatibility
steeringMethods.add ("SteeringMethodStraight",
Factory<steeringMethod::Straight>::create);
steeringMethods.add ("Straight",
Factory<steeringMethod::Straight>::create);
steeringMethods.add ("Straight", Factory<steeringMethod::Straight>::create);
steeringMethods.add ("ReedsShepp", steeringMethod::ReedsShepp::createWithGuess);
steeringMethods.add ("Dubins", steeringMethod::Dubins::createWithGuess);
steeringMethods.add ("Snibud", steeringMethod::Snibud::createWithGuess);
......@@ -205,7 +190,6 @@ namespace hpp {
pathOptimizers.add ("PartialShortcut", pathOptimization::PartialShortcut::create);
pathOptimizers.add ("ConfigOptimization", pathOptimization::ConfigOptimization::create);
pathOptimizers.add ("SimpleTimeParameterization", pathOptimization::SimpleTimeParameterization::create);
pathOptimizers.add ("None", NoneOptimizer::create); // TODO: Delete me
// pathOptimizers.add ("SplineGradientBased_cannonical1",pathOptimization::SplineGradientBased<path::CanonicalPolynomeBasis, 1>::create);
// pathOptimizers.add ("SplineGradientBased_cannonical2",pathOptimization::SplineGradientBased<path::CanonicalPolynomeBasis, 2>::create);
......@@ -867,6 +851,23 @@ namespace hpp {
}
}
void ProblemSolver::addObstacle (const DevicePtr_t& device,
bool collision, bool distance)
{
device->computeForwardKinematics();
device->updateGeometryPlacements();
const std::string& prefix = device->name();
// Detach objects from joints
pinocchio::DeviceObjectVector& objects = device->objectVector();
for (pinocchio::DeviceObjectVector::iterator itObj = objects.begin();
itObj != objects.end(); ++itObj) {
addObstacle (prefix + (*itObj)->name (),
*(*itObj)->fcl (),
collision, distance);
}
}
void ProblemSolver::addObstacle (const CollisionObjectPtr_t& object,
bool collision, bool distance)
{
......
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