@@ -924,6 +924,8 @@ TEST_F(EvalTest, testYawRate_5)
924
924
setTargetMetric (" yaw_rate_CAR" );
925
925
926
926
const double yaw_rate = 5.0 ;
927
+ const double yaw_rate_flip_fixed =
928
+ std::min (yaw_rate, (M_PI - yaw_rate * time_step_) / time_step_);
927
929
928
930
for (double time = 0 ; time <= time_delay_ + 0.01 ; time += time_step_) {
929
931
const auto objects = rotateObjects (
@@ -936,7 +938,7 @@ TEST_F(EvalTest, testYawRate_5)
936
938
const auto objects = rotateObjects (
937
939
makeStraightPredictedObjects (time , ObjectClassification::CAR, 0.0 ), yaw_rate * time );
938
940
publishEgoTF (time );
939
- EXPECT_NEAR (publishObjectsAndGetMetric (objects), yaw_rate , epsilon);
941
+ EXPECT_NEAR (publishObjectsAndGetMetric (objects), yaw_rate_flip_fixed , epsilon);
940
942
}
941
943
}
942
944
@@ -946,6 +948,8 @@ TEST_F(EvalTest, testYawRate_minus_5)
946
948
setTargetMetric (" yaw_rate_CAR" );
947
949
948
950
const double yaw_rate = 5.0 ;
951
+ const double yaw_rate_flip_fixed =
952
+ std::min (yaw_rate, (M_PI - yaw_rate * time_step_) / time_step_);
949
953
950
954
for (double time = 0 ; time <= time_delay_ + 0.01 ; time += time_step_) {
951
955
const auto objects = rotateObjects (
@@ -958,7 +962,7 @@ TEST_F(EvalTest, testYawRate_minus_5)
958
962
const auto objects = rotateObjects (
959
963
makeStraightPredictedObjects (time , ObjectClassification::CAR, 0.0 ), -yaw_rate * time );
960
964
publishEgoTF (time );
961
- EXPECT_NEAR (publishObjectsAndGetMetric (objects), yaw_rate , epsilon);
965
+ EXPECT_NEAR (publishObjectsAndGetMetric (objects), yaw_rate_flip_fixed , epsilon);
962
966
}
963
967
}
964
968
// ==========================================================================================
0 commit comments