| 66 | } |
| 67 | |
| 68 | CarDirection RightmostDirection(double const angle) |
| 69 | { |
| 70 | static std::vector<std::pair<double, CarDirection>> const kLowerBounds = { |
| 71 | {145., CarDirection::TurnSharpRight}, |
| 72 | {50., CarDirection::TurnRight}, |
| 73 | {10., CarDirection::TurnSlightRight}, |
| 74 | // For sure it's incorrect to give directions TurnLeft or TurnSlighLeft if we need the rightmost turn. |
| 75 | // So GoStraight direction is given even for needed sharp left turn when other turns on the left and are more |
| 76 | // sharp. The reason: the rightmost turn is the most straight one here. |
| 77 | {-180., CarDirection::GoStraight}}; |
| 78 | |
| 79 | return FindDirectionByAngle(kLowerBounds, angle); |
| 80 | } |
| 81 | |
| 82 | CarDirection LeftmostDirection(double const angle) |
| 83 | { |