diff --git a/include/hpp/manipulation/fwd.hh b/include/hpp/manipulation/fwd.hh index 96d12d85d7d77cab68a2400d18f39a9ce1479692..957ac715c46d29ec5cf58ea03bc0379575b89561 100644 --- a/include/hpp/manipulation/fwd.hh +++ b/include/hpp/manipulation/fwd.hh @@ -144,6 +144,7 @@ namespace hpp { typedef core::JointAndShapes_t JointAndShapes_t; typedef std::list <std::string> StringList_t; + typedef std::vector <std::string> Strings_t; namespace pathOptimization { HPP_PREDEF_CLASS (SmallSteps); diff --git a/include/hpp/manipulation/graph/helper.hh b/include/hpp/manipulation/graph/helper.hh index f6a78e4d852d9376230cb2c31b039230d1372e1e..cf01745adfe6731559d3ac4a5504b75054147ef2 100644 --- a/include/hpp/manipulation/graph/helper.hh +++ b/include/hpp/manipulation/graph/helper.hh @@ -191,15 +191,15 @@ namespace hpp { struct ObjectDef_t { std::string name; - StringList_t handles, shapes; + Strings_t handles, shapes; }; GraphPtr_t graphBuilder ( const ProblemSolverPtr_t& ps, const std::string& graphName, - const StringList_t& griNames, - const std::list <ObjectDef_t>& objs, - const StringList_t& envNames, + const Strings_t& griNames, + const std::vector <ObjectDef_t>& objs, + const Strings_t& envNames, const Rules_t& rules, const value_type& prePlaceWidth = 0.05); /// \} diff --git a/include/hpp/manipulation/problem-solver.hh b/include/hpp/manipulation/problem-solver.hh index 0fd9a121b0f04eeaf992739f3bb4a0d4a5d9eddd..dcca195cf45c90c4e7fb62732e7ed1d4202bba47 100644 --- a/include/hpp/manipulation/problem-solver.hh +++ b/include/hpp/manipulation/problem-solver.hh @@ -91,8 +91,8 @@ namespace hpp { /// \param margin see hpp::constraints::ConvexShapeContact::setNormalMargin /// void createPlacementConstraint (const std::string& name, - const StringList_t& surface1, - const StringList_t& surface2, + const Strings_t& surface1, + const Strings_t& surface2, const value_type& margin = 1e-4); /// Create pre-placement constraint @@ -103,8 +103,8 @@ namespace hpp { /// \param margin see hpp::constraints::ConvexShapeContact::setNormalMargin /// void createPrePlacementConstraint (const std::string& name, - const StringList_t& surface1, - const StringList_t& surface2, + const Strings_t& surface1, + const Strings_t& surface2, const value_type& width, const value_type& margin = 1e-4); diff --git a/src/graph/helper.cc b/src/graph/helper.cc index 1a3ec3106d0a760ba13b8c1d3464acbb8d5ae62c..e542b21eb15e59321ba7dfd4d139452aad42c622 100644 --- a/src/graph/helper.cc +++ b/src/graph/helper.cc @@ -1007,9 +1007,9 @@ namespace hpp { GraphPtr_t graphBuilder ( const ProblemSolverPtr_t& ps, const std::string& graphName, - const StringList_t& griNames, - const std::list <ObjectDef_t>& objs, - const StringList_t& envNames, + const Strings_t& griNames, + const std::vector <ObjectDef_t>& objs, + const Strings_t& envNames, const std::vector <Rule>& rules, const value_type& prePlaceWidth) { diff --git a/src/problem-solver.cc b/src/problem-solver.cc index d5c5a2915f705b48db648d20d1c812f983c8ab96..0bf22ca04efaf37ead2777d0429524539d60e250 100644 --- a/src/problem-solver.cc +++ b/src/problem-solver.cc @@ -239,17 +239,18 @@ namespace hpp { } void ProblemSolver::createPlacementConstraint - (const std::string& name, const StringList_t& surface1, - const StringList_t& surface2, const value_type& margin) + (const std::string& name, const Strings_t& surface1, + const Strings_t& surface2, const value_type& margin) { bool explicit_(true); if (!robot_) throw std::runtime_error ("No robot loaded"); JointAndShapes_t floorSurfaces, objectSurfaces, l; - for (StringList_t::const_iterator it1 = surface1.begin (); + for (Strings_t::const_iterator it1 = surface1.begin (); it1 != surface1.end(); ++it1) { if (!robot_->jointAndShapes.has (*it1)) throw std::runtime_error ("First list of triangles not found."); l = robot_->jointAndShapes.get (*it1); + objectSurfaces.insert(objectSurfaces.end(), l.begin(), l.end()); for(auto js : l){ JointPtr_t j(js.first); // If one robot contact surface is not on a freeflying object, @@ -261,11 +262,10 @@ namespace hpp { { explicit_ = false; } - objectSurfaces.insert(objectSurfaces.end(), l.begin(), l.end()); } } - for (StringList_t::const_iterator it2 = surface2.begin (); + for (Strings_t::const_iterator it2 = surface2.begin (); it2 != surface2.end(); ++it2) { // Search first robot triangles if (robot_->jointAndShapes.has (*it2)) @@ -319,13 +319,13 @@ namespace hpp { } void ProblemSolver::createPrePlacementConstraint - (const std::string& name, const StringList_t& surface1, - const StringList_t& surface2, const value_type& width, + (const std::string& name, const Strings_t& surface1, + const Strings_t& surface2, const value_type& width, const value_type& margin) { if (!robot_) throw std::runtime_error ("No robot loaded"); JointAndShapes_t floorSurfaces, objectSurfaces, l; - for (StringList_t::const_iterator it1 = surface1.begin (); + for (Strings_t::const_iterator it1 = surface1.begin (); it1 != surface1.end(); ++it1) { if (!robot_->jointAndShapes.has (*it1)) throw std::runtime_error ("First list of triangles not found."); @@ -333,7 +333,7 @@ namespace hpp { objectSurfaces.insert(objectSurfaces.end(), l.begin(), l.end()); } - for (StringList_t::const_iterator it2 = surface2.begin (); + for (Strings_t::const_iterator it2 = surface2.begin (); it2 != surface2.end(); ++it2) { // Search first robot triangles if (robot_->jointAndShapes.has (*it2))