From 69117ebe2d6d0fd14df66e06dd2bb5d74238efc3 Mon Sep 17 00:00:00 2001 From: Yuliang Guo <33yuliangguo@gmail.com> Date: Mon, 3 Dec 2018 22:51:10 -0800 Subject: [PATCH] Perception: update a condition to output trafficlights (#2125) * Solve all the related issues to make traffic light run. Specific issues include: 1. Correct the wrong format in .dag, parameter, and configuration files. 2. add camara parameter files which are expected from the code. 3. Correct the wrong use of Cyber::SUCC in an algorithm condition in trafficlights_perception_component.cc. * sync with the latest lib.so name * output single traffic light result based on voting * modify the condition to output trafficlights result --- .../onboard/component/trafficlights_perception_component.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/perception/onboard/component/trafficlights_perception_component.cc b/modules/perception/onboard/component/trafficlights_perception_component.cc index 26bef39bdd..6226ab4aba 100644 --- a/modules/perception/onboard/component/trafficlights_perception_component.cc +++ b/modules/perception/onboard/component/trafficlights_perception_component.cc @@ -783,7 +783,7 @@ bool TrafficLightsPerceptionComponent::TransformOutputMessage( if (max_light_id > 0) std::swap(lights[0], lights[max_light_id]); - if (max_light_id > 0) { + if (max_light_id >= 0) { apollo::perception::TrafficLight *light_result = (*out_msg)->add_traffic_light(); light_result->set_id(lights.at(0)->id); @@ -968,7 +968,7 @@ void TrafficLightsPerceptionComponent::Visualize( } cv::resize(output_image, output_image, cv::Size(), 0.5, 0.5); - cv::imshow("Traffic Lihgt", output_image); + cv::imshow("Traffic Light", output_image); // cv::imwrite("/apollo/debug_vis/" + // std::to_string(frame.timestamp) + ".jpg", output_image); cvWaitKey(30); -- GitLab