Skip to content

Commit

Permalink
fix division by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Moritz Kobitzsch authored and TheMarex committed Mar 18, 2016
1 parent f8fbf98 commit 45289ce
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/extractor/guidance/turn_analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -794,12 +794,13 @@ TurnAnalysis::handleThreeWayTurn(const EdgeID via_edge,
std::vector<ConnectedRoad> intersection) const
{
BOOST_ASSERT(intersection[0].turn.angle < 0.001);
const auto isObviousOfTwo = [](const ConnectedRoad turn, const ConnectedRoad other)
const auto isObviousOfTwo = [](const ConnectedRoad road, const ConnectedRoad other)
{
return (angularDeviation(turn.turn.angle, STRAIGHT_ANGLE) < NARROW_TURN_ANGLE &&
return (angularDeviation(road.turn.angle, STRAIGHT_ANGLE) < NARROW_TURN_ANGLE &&
angularDeviation(other.turn.angle, STRAIGHT_ANGLE) > 85) ||
(angularDeviation(road.turn.angle,STRAIGHT_ANGLE) < std::numeric_limits<double>::epsilon()) ||
(angularDeviation(other.turn.angle, STRAIGHT_ANGLE) /
angularDeviation(turn.turn.angle, STRAIGHT_ANGLE) >
angularDeviation(road.turn.angle, STRAIGHT_ANGLE) >
1.4);
};

Expand Down

0 comments on commit 45289ce

Please sign in to comment.