Skip to content
Snippets Groups Projects
Commit 889c56fc authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Fix TODO regarding projection with WaypointEdge

parent 032052a0
No related branches found
No related tags found
No related merge requests found
...@@ -202,7 +202,7 @@ namespace hpp { ...@@ -202,7 +202,7 @@ namespace hpp {
typedef std::pair < EdgePtr_t, NodePtr_t > Waypoint; typedef std::pair < EdgePtr_t, NodePtr_t > Waypoint;
Waypoint waypoint_; Waypoint waypoint_;
mutable Configuration_t config_; mutable Configuration_t config_, result_;
}; // class WaypointEdge }; // class WaypointEdge
/// Edge that find intersection of level set. /// Edge that find intersection of level set.
......
...@@ -204,9 +204,9 @@ namespace hpp { ...@@ -204,9 +204,9 @@ namespace hpp {
{ {
assert (waypoint_.first); assert (waypoint_.first);
core::PathPtr_t pathToWaypoint; core::PathPtr_t pathToWaypoint;
// TO DO: Many times, this will be called rigth after WaypointEdge::applyConstraints so config_ // Many times, this will be called rigth after WaypointEdge::applyConstraints so config_
// already satisfies the constraints. // already satisfies the constraints.
config_ = q2; if (!result_.isApprox (q2)) config_ = q2;
if (!waypoint_.first->applyConstraints (q1, config_)) if (!waypoint_.first->applyConstraints (q1, config_))
return false; return false;
if (!waypoint_.first->build (pathToWaypoint, q1, config_, d)) if (!waypoint_.first->build (pathToWaypoint, q1, config_, d))
...@@ -230,10 +230,12 @@ namespace hpp { ...@@ -230,10 +230,12 @@ namespace hpp {
bool WaypointEdge::applyConstraints (ConfigurationIn_t qoffset, ConfigurationOut_t q) const bool WaypointEdge::applyConstraints (ConfigurationIn_t qoffset, ConfigurationOut_t q) const
{ {
assert (waypoint_.first); assert (waypoint_.first);
if (!waypoint_.first->applyConstraints (qoffset, q))
return false;
config_ = q; config_ = q;
return Edge::applyConstraints (config_, q); if (!waypoint_.first->applyConstraints (qoffset, config_))
return false;
bool success = Edge::applyConstraints (config_, q);
result_ = q;
return success;
} }
void WaypointEdge::createWaypoint (const unsigned d, const std::string& bname) void WaypointEdge::createWaypoint (const unsigned d, const std::string& bname)
...@@ -258,6 +260,7 @@ namespace hpp { ...@@ -258,6 +260,7 @@ namespace hpp {
edge->name (ss.str ()); edge->name (ss.str ());
waypoint_ = Waypoint (edge, node); waypoint_ = Waypoint (edge, node);
config_ = Configuration_t(graph_.lock ()->robot ()->configSize ()); config_ = Configuration_t(graph_.lock ()->robot ()->configSize ());
result_ = Configuration_t(graph_.lock ()->robot ()->configSize ());
} }
NodePtr_t WaypointEdge::node () const NodePtr_t WaypointEdge::node () const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment