提交 5feb1939 编写于 作者: G gaohan02 提交者: GoLancer

pass all unittest

上级 1cc447a4
......@@ -119,14 +119,14 @@ void HMMatcher::TrackObjectPropertyMatch(
*unassigned_objects, &association_mat);
// from perception-common
common::SecureMat<double> global_costs = hungarian_matcher_.global_costs();
global_costs.Resize(unassigned_tracks->size(), unassigned_objects->size());
common::SecureMat<double>* global_costs =
hungarian_matcher_.mutable_global_costs();
global_costs->Resize(unassigned_tracks->size(), unassigned_objects->size());
for (size_t i = 0; i < unassigned_tracks->size(); ++i) {
for (size_t j = 0; j < unassigned_objects->size(); ++j) {
global_costs(i, j) = association_mat[i][j];
(*global_costs)(i, j) = association_mat[i][j];
}
}
std::vector<TrackObjectPair> property_assignments;
std::vector<size_t> property_unassigned_tracks;
std::vector<size_t> property_unassigned_objects;
......
/******************************************************************************
* Copyright 2018 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
......@@ -16,6 +16,7 @@ cc_test(
cc_test(
name = "radar_conti_ars_preprocessor_test",
size = "small",
srcs = [
"radar_conti_ars_preprocessor_test.cc",
],
......@@ -27,6 +28,7 @@ cc_test(
cc_test(
name = "radar_dummy_algorithms_test",
size = "small",
srcs = [
"radar_dummy_algorithms_test.cc",
],
......@@ -38,6 +40,7 @@ cc_test(
cc_test(
name = "radar_filter_adaptive_kalman_filter_test",
size = "small",
srcs = [
"radar_filter_adaptive_kalman_filter_test.cc",
],
......@@ -49,6 +52,7 @@ cc_test(
cc_test(
name = "radar_hdmap_radar_roi_filter_test",
size = "small",
srcs = [
"radar_hdmap_radar_roi_filter_test.cc",
],
......@@ -60,6 +64,7 @@ cc_test(
cc_test(
name = "radar_interface_base_matcher_test",
size = "small",
srcs = [
"radar_interface_base_matcher_test.cc",
],
......@@ -72,6 +77,7 @@ cc_test(
cc_test(
name = "radar_tracker_conti_ars_tracker_empty_test",
size = "small",
srcs = [
"radar_tracker_conti_ars_tracker_empty_test.cc",
],
......@@ -83,6 +89,7 @@ cc_test(
cc_test(
name = "radar_tracker_conti_ars_tracker_test",
size = "small",
srcs = [
"radar_tracker_conti_ars_tracker_test.cc",
],
......@@ -94,6 +101,7 @@ cc_test(
cc_test(
name = "radar_tracker_hm_matcher_test",
size = "small",
srcs = [
"radar_tracker_hm_matcher_test.cc",
],
......@@ -106,6 +114,7 @@ cc_test(
cc_test(
name = "radar_tracker_radar_track_manager_test",
size = "small",
srcs = [
"radar_tracker_radar_track_manager_test.cc",
],
......@@ -117,6 +126,7 @@ cc_test(
cc_test(
name = "radar_tracker_radar_track_test",
size = "small",
srcs = [
"radar_tracker_radar_track_test.cc",
],
......
......@@ -33,7 +33,8 @@ class ContiArsPreprocessorTest : public testing::Test {
TEST_F(ContiArsPreprocessorTest, init) {
float delay_time = preprocessor.GetDelayTime();
EXPECT_FLOAT_EQ(delay_time, 0.0);
FLAGS_work_root = "./radar_test_data/preprocessor";
FLAGS_work_root = "/apollo/modules/perception/testdata/"
"radar/preprocessor";
bool init_result = preprocessor.Init();
EXPECT_TRUE(init_result);
delay_time = preprocessor.GetDelayTime();
......@@ -43,6 +44,13 @@ TEST_F(ContiArsPreprocessorTest, init) {
TEST_F(ContiArsPreprocessorTest, preprocess) {
ContiRadar raw_obs;
Header radar_header;
radar_header.set_timestamp_sec(151237772.355345434);
radar_header.set_radar_timestamp(151237772355345434);
radar_header.set_module_name("radar");
radar_header.set_sequence_num(0);
raw_obs.mutable_header()->CopyFrom(radar_header);
PreprocessorOptions options;
ContiRadar corrected_obs;
......@@ -94,6 +102,12 @@ TEST_F(ContiArsPreprocessorTest, preprocess) {
raw_obs.clear_contiobs();
corrected_obs.clear_contiobs();
radar_header.set_timestamp_sec(151237772.425345434);
radar_header.set_radar_timestamp(151237772425345434);
radar_header.set_module_name("radar");
radar_header.set_sequence_num(0);
raw_obs.mutable_header()->CopyFrom(radar_header);
conti_obs = raw_obs.add_contiobs();
conti_obs->set_obstacle_id(1);
conti_obs->set_meas_state(1);
......@@ -125,6 +139,12 @@ TEST_F(ContiArsPreprocessorTest, preprocess) {
raw_obs.clear_contiobs();
corrected_obs.clear_contiobs();
radar_header.set_timestamp_sec(151237772.485345434);
radar_header.set_radar_timestamp(151237772485345434);
radar_header.set_module_name("radar");
radar_header.set_sequence_num(0);
raw_obs.mutable_header()->CopyFrom(radar_header);
SetMaxRadarIdx();
conti_obs = raw_obs.add_contiobs();
conti_obs->set_obstacle_id(50);
......
......@@ -24,7 +24,8 @@ namespace radar {
TEST(ContiArsTrackerTest, conti_ars_tracker_empty_init_test) {
BaseTracker* tracker = new ContiArsTracker();
FLAGS_work_root = "./radar_test_data/conti_ars_tracker/empty";
FLAGS_work_root = "/apollo/modules/perception/testdata/"
"radar/conti_ars_tracker/empty";
EXPECT_EQ(tracker->Init(), false);
delete tracker;
}
......
......@@ -27,7 +27,8 @@ namespace radar {
TEST(ContiArsTrackerTest, conti_ars_tracker_init_test) {
BaseTracker* tracker = new ContiArsTracker();
FLAGS_work_root = "./radar_test_data/conti_ars_tracker";
FLAGS_work_root = "/apollo/modules/perception/testdata/"
"radar/conti_ars_tracker";
EXPECT_EQ(tracker->Init(), true);
EXPECT_EQ(tracker->Name(), "ContiArsTracker");
delete tracker;
......
......@@ -30,7 +30,8 @@ namespace radar {
TEST(HMMatcherTest, hm_matcher_init_test) {
BaseMatcher* matcher = new HMMatcher();
EXPECT_TRUE(matcher != nullptr);
FLAGS_work_root = "./radar_test_data/matcher";
FLAGS_work_root = "/apollo/modules/perception/testdata/"
"radar/matcher";
EXPECT_EQ(matcher->Init(), true);
delete matcher;
}
......@@ -59,7 +60,8 @@ TEST(HMMatcherTest, hm_matcher_propterty_match_test) {
TEST(HMMatcherTest, hm_matcher_test) {
BaseMatcher* matcher = new HMMatcher();
EXPECT_TRUE(matcher != nullptr);
FLAGS_work_root = "./radar_test_data/matcher";
FLAGS_work_root = "/apollo/modules/perception/testdata/"
"radar/matcher";
EXPECT_EQ(matcher->Init(), true);
EXPECT_EQ(matcher->Name(), "HMMatcher");
double match_distance = 2.5;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册