Fix invalid roundabout instructions for different driving modes, #4129

This commit is contained in:
Michael Krasnyk
2017-06-07 09:43:17 +02:00
committed by Patrick Niklaus
parent 9315dc1c73
commit 03e83ec6a0
2 changed files with 12 additions and 7 deletions
+10 -5
View File
@@ -171,9 +171,11 @@ void closeOffRoundabout(const bool on_roundabout,
if (!guidance::haveSameMode(exit_step, prev_step))
{
BOOST_ASSERT(leavesRoundabout(exit_step.maneuver.instruction));
prev_step.maneuver.instruction = exit_step.maneuver.instruction;
if (!entersRoundabout(prev_step.maneuver.instruction))
prev_step.maneuver.exit = exit_step.maneuver.exit;
{
prev_step.maneuver.instruction = exit_step.maneuver.instruction;
}
prev_step.maneuver.exit = exit_step.maneuver.exit;
exit_step.maneuver.instruction.type = TurnType::Notification;
step_index--;
}
@@ -198,9 +200,12 @@ void closeOffRoundabout(const bool on_roundabout,
{
auto &propagation_step = steps[propagation_index];
auto &next_step = steps[propagation_index + 1];
propagation_step.ElongateBy(next_step);
propagation_step.maneuver.exit = next_step.maneuver.exit;
next_step.Invalidate();
if (guidance::haveSameMode(propagation_step, next_step))
{
propagation_step.ElongateBy(next_step);
propagation_step.maneuver.exit = next_step.maneuver.exit;
next_step.Invalidate();
}
if (entersRoundabout(propagation_step.maneuver.instruction))
{