diff --git a/src/path-planner/states-path-finder.cc b/src/path-planner/states-path-finder.cc index e2dd79fbd15f88531d66a9a3d626bf812e3dcf75..62819f7608f8f1a91025a55dab216ccdd2658571 100644 --- a/src/path-planner/states-path-finder.cc +++ b/src/path-planner/states-path-finder.cc @@ -237,6 +237,10 @@ namespace hpp { return false; } + static bool isLoopTransition (const graph::EdgePtr_t& transition) { + return transition->stateTo() == transition->stateFrom(); + } + void StatesPathFinder::gatherGraphConstraints () { typedef graph::Edge Edge; @@ -315,6 +319,9 @@ namespace hpp { // Avoid identical consecutive transition if (transition == parent.e) continue; + // Avoid loop transitions + if (isLoopTransition(transition)) continue; + // Insert parent d.queue1.push ( d.addParent (_state, transition)