! * \brief Corrects |turn.m_turn| if |turn.m_turn == CarDirection::GoStraight|. * If the other way is not sharp enough, turn.m_turn is set to |turnToSet|. */
| 358 | * If the other way is not sharp enough, turn.m_turn is set to |turnToSet|. |
| 359 | */ |
| 360 | void CorrectGoStraight(TurnCandidate const & notRouteCandidate, double const routeAngle, CarDirection const & turnToSet, |
| 361 | TurnItem & turn) |
| 362 | { |
| 363 | if (turn.m_turn != CarDirection::GoStraight) |
| 364 | return; |
| 365 | |
| 366 | // Correct turn if alternative cadidate's angle is not sharp enough compared to the route. |
| 367 | if (abs(notRouteCandidate.m_angle) < abs(routeAngle) + kMinAbsAngleDiffForStraightRoute) |
| 368 | { |
| 369 | LOG(LDEBUG, ("Turn: ", turn.m_index, " GoStraight correction.")); |
| 370 | turn.m_turn = turnToSet; |
| 371 | } |
| 372 | } |
| 373 | |
| 374 | // If the route goes along the rightmost or the leftmost way among available ones: |
| 375 | // 1. RightmostDirection or LeftmostDirection is selected |
no outgoing calls
no test coverage detected