Refactor fork handling in guidance (#3264)

refactor fork handler
This commit is contained in:
Huyen Chau Nguyen
2017-01-07 14:13:32 +01:00
committed by GitHub
parent 15c8fd326f
commit f313cb9913
7 changed files with 336 additions and 193 deletions
@@ -42,6 +42,8 @@ IntersectionHandler::IntersectionHandler(const util::NodeBasedDynamicGraph &node
{
}
// Inspects an intersection and a turn from via_edge onto road from the possible basic turn types
// (OnRamp, Continue, Turn) find the suitable turn type
TurnType::Enum IntersectionHandler::findBasicTurnType(const EdgeID via_edge,
const ConnectedRoad &road) const
{
@@ -254,9 +256,13 @@ void IntersectionHandler::assignFork(const EdgeID via_edge,
else
{
if (low_priority_left && !low_priority_right)
{
left.instruction = {TurnType::Turn, DirectionModifier::SlightLeft};
}
else
{
left.instruction = {TurnType::Fork, DirectionModifier::SlightLeft};
}
}
// right side of fork
@@ -265,9 +271,13 @@ void IntersectionHandler::assignFork(const EdgeID via_edge,
else
{
if (low_priority_right && !low_priority_left)
{
right.instruction = {TurnType::Turn, DirectionModifier::SlightRight};
}
else
{
right.instruction = {TurnType::Fork, DirectionModifier::SlightRight};
}
}
}