Commit e4548eee authored by Florent Lamiraux's avatar Florent Lamiraux
Browse files

Add a method to reset consstraint set in problem solver.

parent 5d8def3d
......@@ -90,6 +90,9 @@ namespace hpp {
return constraints_;
}
/// Reset constraint set
void resetConstraints ();
/// Create new problem.
void resetProblem ();
......
......@@ -16,9 +16,10 @@
// hpp-core If not, see
// <http://www.gnu.org/licenses/>.
#include <hpp/util/debug.hh>
#include <hpp/core/problem-solver.hh>
# include <hpp/core/diffusing-planner.hh>
# include <hpp/core/roadmap.hh>
#include <hpp/core/diffusing-planner.hh>
#include <hpp/core/roadmap.hh>
#include <hpp/core/discretized-collision-checking.hh>
#include <hpp/core/random-shortcut.hh>
#include <hpp/core/roadmap.hh>
......@@ -88,7 +89,16 @@ namespace hpp {
void ProblemSolver::addConstraint (const ConstraintPtr_t& constraint)
{
constraints_->addConstraint (constraint);
if (robot_)
constraints_->addConstraint (constraint);
else
hppDout (info, "Cannot add constraint while robot is not set");
}
void ProblemSolver::resetConstraints ()
{
if (robot_)
constraints_ = ConstraintSet::create (robot_, "Default constraint set");
}
void ProblemSolver::resetProblem ()
......
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