76 {
77
78 Chassis chassis;
79 if (FLAGS_test_chassis_file.empty()) {
80 AERROR <<
"Requires FLAGS_test_chassis_file to be set";
81 return false;
82 }
84 FLAGS_test_data_dir + "/" + FLAGS_test_chassis_file, &chassis)) {
85 AERROR <<
"failed to load file: " << FLAGS_test_chassis_file;
86 return false;
87 }
88
89 if (FLAGS_test_localization_file.empty()) {
90 AERROR <<
"Requires FLAGS_test_localization_file to be set";
91 return false;
92 }
93 LocalizationEstimate localization;
95 FLAGS_test_data_dir + "/" + FLAGS_test_localization_file,
96 &localization)) {
97 AERROR <<
"failed to load file: " << FLAGS_test_localization_file;
98 return false;
99 }
102
103
104 if (FLAGS_test_prediction_file.empty()) {
105 AERROR <<
"Requires FLAGS_test_prediction_file to be set";
106 return false;
107 }
108 PredictionObstacles prediction;
110 FLAGS_test_data_dir + "/" + FLAGS_test_prediction_file,
111 &prediction)) {
112 AERROR <<
"failed to load file: " << FLAGS_test_prediction_file;
113 return false;
114 }
115
116 if (FLAGS_test_routing_response_file.empty()) {
117 AERROR <<
"Requires FLAGS_test_routing_response_file";
118 return false;
119 }
120 RoutingResponse routing_response;
122 FLAGS_test_data_dir + "/" + FLAGS_test_routing_response_file,
123 &routing_response)) {
124 AERROR <<
"failed to load file: " << FLAGS_test_routing_response_file;
125 return false;
126 }
127
128
129 TrafficLightDetection traffic_light_detection;
131 FLAGS_test_data_dir + "/" + FLAGS_test_traffic_light_file,
132 &traffic_light_detection)) {
133 AERROR <<
"failed to load file: " << FLAGS_test_traffic_light_file;
134 return false;
135 }
136
138 std::make_shared<PredictionObstacles>(prediction);
141 std::make_shared<LocalizationEstimate>(localization);
143 std::make_shared<TrafficLightDetection>(traffic_light_detection);
144
145 AINFO <<
"Successfully feed proto files.";
146 return true;
147}
static void SetNowInSeconds(const double seconds)
This is for mock clock mode only.
static void SetMode(ClockMode mode)
bool GetProtoFromFile(const std::string &file_name, google::protobuf::Message *message)
Parses the content of the file specified by the file_name as a representation of protobufs,...
std::shared_ptr< localization::LocalizationEstimate > localization_estimate
std::shared_ptr< prediction::PredictionObstacles > prediction_obstacles
std::shared_ptr< canbus::Chassis > chassis
std::shared_ptr< perception::TrafficLightDetection > traffic_light