File tree 1 file changed +17
-0
lines changed
planning/behavior_path_avoidance_module/test
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 21
21
using behavior_path_planner::ObjectData;
22
22
using behavior_path_planner::utils::avoidance::isOnRight;
23
23
using behavior_path_planner::utils::avoidance::isSameDirectionShift;
24
+ using behavior_path_planner::utils::avoidance::isShiftNecessary;
24
25
25
26
TEST (BehaviorPathPlanningAvoidanceUtilsTest, shiftLengthDirectionTest)
26
27
{
@@ -37,3 +38,19 @@ TEST(BehaviorPathPlanningAvoidanceUtilsTest, shiftLengthDirectionTest)
37
38
ASSERT_TRUE (isSameDirectionShift (isOnRight (left_obj), positive_shift_length));
38
39
ASSERT_FALSE (isSameDirectionShift (isOnRight (left_obj), negative_shift_length));
39
40
}
41
+
42
+ TEST (BehaviorPathPlanningAvoidanceUtilsTest, shiftNecessaryTest)
43
+ {
44
+ ObjectData right_obj;
45
+ right_obj.direction = route_handler::Direction::RIGHT;
46
+ const double negative_shift_length = -1.0 ;
47
+ const double positive_shift_length = 1.0 ;
48
+
49
+ ASSERT_TRUE (isShiftNecessary (isOnRight (right_obj), positive_shift_length));
50
+ ASSERT_FALSE (isShiftNecessary (isOnRight (right_obj), negative_shift_length));
51
+
52
+ ObjectData left_obj;
53
+ left_obj.direction = route_handler::Direction::LEFT;
54
+ ASSERT_TRUE (isShiftNecessary (isOnRight (left_obj), negative_shift_length));
55
+ ASSERT_FALSE (isShiftNecessary (isOnRight (left_obj), positive_shift_length));
56
+ }
You can’t perform that action at this time.
0 commit comments