Skip to content

Commit 54f85c3

Browse files
committed
chore: pre-commit
Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
1 parent abad27f commit 54f85c3

File tree

3 files changed

+1
-48
lines changed

3 files changed

+1
-48
lines changed

perception/autoware_traffic_light_selector/package.xml

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
<depend>geometry_msgs</depend>
1919
<depend>libopencv-dev</depend>
2020
<depend>message_filters</depend>
21-
<depend>object_recognition_utils</depend>
2221
<depend>rclcpp</depend>
2322
<depend>rclcpp_components</depend>
2423
<depend>sensor_msgs</depend>

perception/autoware_traffic_light_selector/src/traffic_light_selector_node.cpp

+1-44
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#include "sensor_msgs/msg/region_of_interest.hpp"
2121

22+
#include <algorithm>
2223
#include <map>
2324
#include <memory>
2425
#include <string>
@@ -65,47 +66,6 @@ float calIou(
6566
return static_cast<float>(area1) / static_cast<float>(area2);
6667
}
6768

68-
// double getGenIoU(
69-
// const sensor_msgs::msg::RegionOfInterest & roi1, const sensor_msgs::msg::RegionOfInterest &
70-
// roi2)
71-
// {
72-
// int rect1_x_min = static_cast<int>(roi1.x_offset);
73-
// int rect1_x_max = static_cast<int>(roi1.x_offset + roi1.width);
74-
// int rect1_y_min = static_cast<int>(roi1.y_offset);
75-
// int rect1_y_max = static_cast<int>(roi1.y_offset + roi1.height);
76-
// int rect2_x_min = static_cast<int>(roi2.x_offset);
77-
// int rect2_x_max = static_cast<int>(roi2.x_offset + roi2.width);
78-
// int rect2_y_min = static_cast<int>(roi2.y_offset);
79-
// int rect2_y_max = static_cast<int>(roi2.y_offset + roi2.height);
80-
// int rect1_area = roi1.width * roi1.height;
81-
// int rect2_area = roi2.width * roi2.height;
82-
// int x_min = std::max(rect1_x_min, rect2_x_min);
83-
// int y_min = std::max(rect1_y_min, rect2_y_min);
84-
// int x_max = std::min(rect1_x_max, rect2_x_max);
85-
// int y_max = std::min(rect1_y_max, rect2_y_max);
86-
87-
// auto w = std::max(0, x_max - x_min);
88-
// auto h = std::max(0, y_max - y_min);
89-
// auto intersect = w * h;
90-
91-
// auto union_area = rect1_area + rect2_area - intersect;
92-
93-
// double iou = static_cast<double>(intersect) / static_cast<double>(union_area);
94-
95-
// // convex shape area
96-
97-
// auto con_x_min = std::min(rect1_x_min, rect2_x_min);
98-
// auto con_y_min = std::min(rect1_y_min, rect2_y_min);
99-
// auto con_x_max = std::max(rect1_x_max, rect2_x_max);
100-
// auto con_y_max = std::max(rect1_y_max, rect2_y_max);
101-
102-
// auto con_area = (con_x_max - con_x_min + 1) * (con_y_max - con_y_min + 1);
103-
104-
// // GIoU calc
105-
// double giou = iou - static_cast<double>(con_area - union_area) / static_cast<double>(con_area);
106-
107-
// return giou;
108-
// }
10969
// create and function of 2 binary image
11070
int andOf2Images(cv::Mat & img1, cv::Mat & img2)
11171
{
@@ -174,7 +134,6 @@ TrafficLightSelectorNode::TrafficLightSelectorNode(const rclcpp::NodeOptions & n
174134
{
175135
max_iou_threshold_ = declare_parameter<double>("max_iou_threshold", 0.0);
176136
RCLCPP_INFO(get_logger(), "max_iou_threshold: %f", max_iou_threshold_);
177-
debug_ = declare_parameter<bool>("debug");
178137
using std::placeholders::_1;
179138
using std::placeholders::_2;
180139
using std::placeholders::_3;
@@ -282,8 +241,6 @@ void TrafficLightSelectorNode::objectsCallback(
282241
}
283242
}
284243
pub_traffic_light_rois_->publish(output);
285-
if (debug_) {
286-
}
287244
return;
288245
}
289246
} // namespace autoware::traffic_light

perception/autoware_traffic_light_selector/src/traffic_light_selector_node.hpp

-3
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,10 @@ class TrafficLightSelectorNode : public rclcpp::Node
7272
rclcpp::Publisher<TrafficLightRoiArray>::SharedPtr pub_traffic_light_rois_;
7373
// Subscribe camera_info to get width and height of image
7474
rclcpp::Subscription<sensor_msgs::msg::CameraInfo>::SharedPtr camera_info_sub_;
75-
bool debug_{false};
7675
bool camera_info_subscribed_;
7776
uint32_t image_width_{1280};
7877
uint32_t image_height_{960};
7978
double max_iou_threshold_{0.0};
80-
// declare publisher for debug image
81-
// rclcpp::Publisher<sensor_msgs::msg::Image>::SharedPtr pub_debug_image_;
8279
};
8380

8481
} // namespace autoware::traffic_light

0 commit comments

Comments
 (0)