MCPcopy Create free account
hub / github.com/comaps/comaps / RightmostDirection

Function RightmostDirection

libs/routing/turns_generator_utils.cpp:68–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68CarDirection 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
82CarDirection LeftmostDirection(double const angle)
83{

Callers 3

LeftmostDirectionFunction · 0.85
UNIT_TESTFunction · 0.85

Calls 1

FindDirectionByAngleFunction · 0.85

Tested by 1

UNIT_TESTFunction · 0.68