fix interaction between sliproads/segregated intersections

This commit is contained in:
Moritz Kobitzsch
2016-09-06 15:47:03 +02:00
parent a551286a8f
commit 9123c93a90
16 changed files with 73 additions and 111 deletions
@@ -105,6 +105,9 @@ bool isValidMatch(const TurnLaneType::Mask tag, const TurnInstruction instructio
double getMatchingQuality(const TurnLaneType::Mask tag, const ConnectedRoad &road)
{
const constexpr double idealized_turn_angles[] = {0, 35, 90, 135, 180, 225, 270, 315};
const auto modifier = getMatchingModifier(tag);
BOOST_ASSERT(static_cast<std::size_t>(modifier) <
sizeof(idealized_turn_angles) / sizeof(*idealized_turn_angles));
const auto idealized_angle = idealized_turn_angles[getMatchingModifier(tag)];
return angularDeviation(idealized_angle, road.turn.angle);
}