Fix invalid roundabout instructions for different driving modes, #4129
This commit is contained in:
parent
9315dc1c73
commit
03e83ec6a0
@ -61,7 +61,7 @@ Feature: Basic Roundabout
|
|||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,d | ab,cd,cd | depart,roundabout turn left exit-1,arrive |
|
| a,d | ab,cd,cd | depart,roundabout turn left exit-1,arrive |
|
||||||
| a,f | ab,ef,ef,ef | depart,roundabout turn left exit-1,notification right,arrive |
|
| a,f | ab,ef,ef,ef | depart,roundabout turn left exit-1,notification right,arrive |
|
||||||
| a,h | ab,bgecb,gh,gh | depart,invalid right,notification right,arrive |
|
| a,h | ab,bgecb,gh,gh | depart,roundabout turn right exit-1,notification right,arrive |
|
||||||
| d,f | cd,ef,ef,ef | depart,roundabout turn sharp left exit-2,notification right,arrive |
|
| d,f | cd,ef,ef,ef | depart,roundabout turn sharp left exit-2,notification right,arrive |
|
||||||
| d,h | cd,gh,gh,gh | depart,roundabout turn left exit-2,notification right,arrive |
|
| d,h | cd,gh,gh,gh | depart,roundabout turn left exit-2,notification right,arrive |
|
||||||
| d,a | cd,ab,ab | depart,roundabout turn right exit-1,arrive |
|
| d,a | cd,ab,ab | depart,roundabout turn right exit-1,arrive |
|
||||||
@ -70,4 +70,4 @@ Feature: Basic Roundabout
|
|||||||
| f,d | ef,cd,cd | depart,roundabout turn right exit-1,arrive |
|
| f,d | ef,cd,cd | depart,roundabout turn right exit-1,arrive |
|
||||||
| h,a | gh,ab,ab | depart,roundabout turn left exit-2,arrive |
|
| h,a | gh,ab,ab | depart,roundabout turn left exit-2,arrive |
|
||||||
| h,d | gh,cd,cd | depart,roundabout turn straight exit-1,arrive |
|
| h,d | gh,cd,cd | depart,roundabout turn straight exit-1,arrive |
|
||||||
| h,f | gh,bgecb,ef,ef | depart,invalid right,notification right,arrive |
|
| h,f | gh,bgecb,ef,ef | depart,roundabout turn right exit-1,notification right,arrive |
|
||||||
|
@ -171,9 +171,11 @@ void closeOffRoundabout(const bool on_roundabout,
|
|||||||
if (!guidance::haveSameMode(exit_step, prev_step))
|
if (!guidance::haveSameMode(exit_step, prev_step))
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(leavesRoundabout(exit_step.maneuver.instruction));
|
BOOST_ASSERT(leavesRoundabout(exit_step.maneuver.instruction));
|
||||||
prev_step.maneuver.instruction = exit_step.maneuver.instruction;
|
|
||||||
if (!entersRoundabout(prev_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;
|
exit_step.maneuver.instruction.type = TurnType::Notification;
|
||||||
step_index--;
|
step_index--;
|
||||||
}
|
}
|
||||||
@ -198,9 +200,12 @@ void closeOffRoundabout(const bool on_roundabout,
|
|||||||
{
|
{
|
||||||
auto &propagation_step = steps[propagation_index];
|
auto &propagation_step = steps[propagation_index];
|
||||||
auto &next_step = steps[propagation_index + 1];
|
auto &next_step = steps[propagation_index + 1];
|
||||||
propagation_step.ElongateBy(next_step);
|
if (guidance::haveSameMode(propagation_step, next_step))
|
||||||
propagation_step.maneuver.exit = next_step.maneuver.exit;
|
{
|
||||||
next_step.Invalidate();
|
propagation_step.ElongateBy(next_step);
|
||||||
|
propagation_step.maneuver.exit = next_step.maneuver.exit;
|
||||||
|
next_step.Invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
if (entersRoundabout(propagation_step.maneuver.instruction))
|
if (entersRoundabout(propagation_step.maneuver.instruction))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user