12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
14
15
- #include " ament_index_cpp/get_package_share_directory.hpp"
16
- #include " gtest/gtest.h"
17
15
#include " rclcpp/rclcpp.hpp"
18
16
#include " rclcpp/time.hpp"
19
17
@@ -61,7 +59,7 @@ class EvalTest : public ::testing::Test
61
59
{" --ros-args" , " --params-file" ,
62
60
share_dir + " /param/perception_online_evaluator.defaults.yaml" });
63
61
options.append_parameter_override (" prediction_time_horizons" , std::vector<double >{5.0 });
64
- options.append_parameter_override (" smoothing_window_size" , int ( 11 ) );
62
+ options.append_parameter_override (" smoothing_window_size" , 11 );
65
63
66
64
dummy_node = std::make_shared<rclcpp::Node>(" perception_online_evaluator_test" , options);
67
65
eval_node = std::make_shared<EvalNode>(options);
@@ -418,15 +416,15 @@ TEST_F(EvalTest, testYawDeviation_oscillation_rotate)
418
416
if (time == time_delay_) {
419
417
objects = rotateObjects (makeDeviatedStraightPredictedObjects (time , 0 ), yaw);
420
418
} else {
421
- objects =
422
- rotateObjects ( makeDeviatedStraightPredictedObjects (time , deviation * sign), 2 * M_PI * std::rand ());
419
+ objects = rotateObjects (
420
+ makeDeviatedStraightPredictedObjects (time , deviation * sign), 2 * M_PI * std::rand ());
423
421
sign *= -1.0 ;
424
422
}
425
423
publishObjects (objects);
426
424
}
427
425
428
- const auto last_objects =
429
- rotateObjects ( makeDeviatedStraightPredictedObjects (time_delay_ * 2 , deviation), 2 * M_PI * std::rand ());
426
+ const auto last_objects = rotateObjects (
427
+ makeDeviatedStraightPredictedObjects (time_delay_ * 2 , deviation), 2 * M_PI * std::rand ());
430
428
EXPECT_NEAR (publishObjectsAndGetMetric (last_objects), yaw, epsilon);
431
429
}
432
430
@@ -442,14 +440,17 @@ TEST_F(EvalTest, testYawDeviation_distortion_rotate)
442
440
if (time == time_delay_) {
443
441
objects = rotateObjects (makeDeviatedStraightPredictedObjects (time , deviation), yaw);
444
442
} else if (time == time_delay_ + time_step_) {
445
- objects = rotateObjects (makeDeviatedStraightPredictedObjects (time , -deviation), 2 * M_PI * std::rand ());
443
+ objects = rotateObjects (
444
+ makeDeviatedStraightPredictedObjects (time , -deviation), 2 * M_PI * std::rand ());
446
445
} else {
447
- objects = rotateObjects (makeDeviatedStraightPredictedObjects (time , 0 ), 2 * M_PI * std::rand ());
446
+ objects =
447
+ rotateObjects (makeDeviatedStraightPredictedObjects (time , 0 ), 2 * M_PI * std::rand ());
448
448
}
449
449
publishObjects (objects);
450
450
}
451
451
452
- const auto last_objects = rotateObjects (makeDeviatedStraightPredictedObjects (time_delay_ * 2 , deviation), 2 * M_PI * std::rand ());
452
+ const auto last_objects = rotateObjects (
453
+ makeDeviatedStraightPredictedObjects (time_delay_ * 2 , deviation), 2 * M_PI * std::rand ());
453
454
EXPECT_NEAR (publishObjectsAndGetMetric (last_objects), yaw, epsilon);
454
455
}
455
456
0 commit comments