Skip to content
Snippets Groups Projects
Commit 409e1aa6 authored by Florent Lamiraux's avatar Florent Lamiraux Committed by Florent Lamiraux florent@laas.fr
Browse files

[WaypointEdge] Specialize initialization.

  Set error threshold for each internal edge to the value of the edge divided
  by the number of internal edges.
parent 0e2a5d21
No related branches found
No related tags found
No related merge requests found
......@@ -58,6 +58,7 @@ namespace hpp {
/// configuration in the start state by an admissible path.
class HPP_MANIPULATION_DLLAPI Edge : public GraphComponent
{
friend class WaypointEdge;
public:
typedef core::RelativeMotion RelativeMotion;
......@@ -363,6 +364,8 @@ namespace hpp {
void init (const WaypointEdgeWkPtr_t& weak, const GraphWkPtr_t& graph, const StateWkPtr_t& from,
const StateWkPtr_t& to);
/// Initialize each of the internal edges
virtual void initialize ();
/// Print the object in a stream.
virtual std::ostream& print (std::ostream& os) const;
......
......@@ -447,6 +447,22 @@ namespace hpp {
wkPtr_ = weak;
}
void WaypointEdge::initialize ()
{
Edge::initialize();
// Set error threshold of internal edge to error threshold of
// waypoint edge divided by number of edges.
assert(targetConstraint()->configProjector());
value_type eps(targetConstraint()->configProjector()
->errorThreshold()/(value_type)edges_.size());
for(Edges_t::iterator it(edges_.begin()); it != edges_.end(); ++it){
(*it)->initialize();
assert ((*it)->targetConstraint());
assert ((*it)->targetConstraint()->configProjector());
(*it)->targetConstraint()->configProjector()->errorThreshold(eps);
}
}
bool WaypointEdge::canConnect (ConfigurationIn_t q1, ConfigurationIn_t q2) const
{
/// TODO: This is not correct
......@@ -533,6 +549,7 @@ namespace hpp {
states_.back() = stateTo();
const size_type nbDof = graph_.lock ()->robot ()->configSize ();
configs_ = matrix_t (nbDof, number + 2);
invalidate();
}
void WaypointEdge::setWaypoint (const std::size_t index,
......
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