Skip to content

Commit ca1a474

Browse files
committed
fix missing line
Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
1 parent 1bac72a commit ca1a474

File tree

1 file changed

+39
-37
lines changed
  • perception/autoware_image_projection_based_fusion/src/pointpainting_fusion

1 file changed

+39
-37
lines changed

perception/autoware_image_projection_based_fusion/src/pointpainting_fusion/node.cpp

+39-37
Original file line numberDiff line numberDiff line change
@@ -333,51 +333,53 @@ dc | dc dc dc dc ||zc|
333333
p_y = point_camera.y();
334334
p_z = point_camera.z();
335335

336-
if (det2d.camera_projector_ptr->isOutsideHorizontalView(p_x, p_z)) {
337-
continue;
338-
}
336+
if (det2d.camera_projector_ptr->isOutsideHorizontalView(p_x, p_z)) {
337+
continue;
338+
}
339339

340-
// project
341-
Eigen::Vector2d projected_point;
342-
if (det2d.camera_projector_ptr->calcImageProjectedPoint(
343-
cv::Point3d(p_x, p_y, p_z), projected_point)) {
344-
// iterate 2d bbox
345-
for (const auto & feature_object : objects) {
346-
sensor_msgs::msg::RegionOfInterest roi = feature_object.feature.roi;
347-
// paint current point if it is inside bbox
348-
int label2d = feature_object.object.classification.front().label;
349-
if (
350-
!isUnknown(label2d) && isInsideBbox(projected_point.x(), projected_point.y(), roi, 1.0)) {
351-
// cppcheck-suppress invalidPointerCast
352-
auto p_class = reinterpret_cast<float *>(&output[stride + class_offset]);
353-
for (const auto & cls : isClassTable_) {
354-
// add up the class values if the point belongs to multiple classes
355-
*p_class = cls.second(label2d) ? (class_index_[cls.first] + *p_class) : *p_class;
340+
// project
341+
Eigen::Vector2d projected_point;
342+
if (det2d.camera_projector_ptr->calcImageProjectedPoint(
343+
cv::Point3d(p_x, p_y, p_z), projected_point)) {
344+
// iterate 2d bbox
345+
for (const auto & feature_object : objects) {
346+
sensor_msgs::msg::RegionOfInterest roi = feature_object.feature.roi;
347+
// paint current point if it is inside bbox
348+
int label2d = feature_object.object.classification.front().label;
349+
if (
350+
!isUnknown(label2d) &&
351+
isInsideBbox(projected_point.x(), projected_point.y(), roi, 1.0)) {
352+
// cppcheck-suppress invalidPointerCast
353+
auto p_class = reinterpret_cast<float *>(&output[stride + class_offset]);
354+
for (const auto & cls : isClassTable_) {
355+
// add up the class values if the point belongs to multiple classes
356+
*p_class = cls.second(label2d) ? (class_index_[cls.first] + *p_class) : *p_class;
357+
}
358+
}
359+
if (debugger_) {
360+
int thread_id = omp_get_thread_num();
361+
local_vectors[thread_id].push_back(projected_point);
356362
}
357-
}
358-
if (debugger_) {
359-
int thread_id = omp_get_thread_num();
360-
local_vectors[thread_id].push_back(projected_point);
361363
}
362364
}
363365
}
364-
}
365-
if (debugger_) {
366-
std::unique_ptr<ScopedTimeTrack> inner_st_ptr;
367-
if (time_keeper_)
368-
inner_st_ptr = std::make_unique<ScopedTimeTrack>("publish debug message", *time_keeper_);
366+
if (debugger_) {
367+
std::unique_ptr<ScopedTimeTrack> inner_st_ptr;
368+
if (time_keeper_)
369+
inner_st_ptr = std::make_unique<ScopedTimeTrack>("publish debug message", *time_keeper_);
369370

370-
for (const auto & feature_object : input_roi_msg.feature_objects) {
371-
debug_image_rois.push_back(feature_object.feature.roi);
372-
}
371+
for (const auto & feature_object : input_roi_msg.feature_objects) {
372+
debug_image_rois.push_back(feature_object.feature.roi);
373+
}
373374

374-
for (const auto & local_vec : local_vectors) {
375-
debug_image_points.insert(debug_image_points.end(), local_vec.begin(), local_vec.end());
376-
}
375+
for (const auto & local_vec : local_vectors) {
376+
debug_image_points.insert(debug_image_points.end(), local_vec.begin(), local_vec.end());
377+
}
377378

378-
debugger_->image_rois_ = debug_image_rois;
379-
debugger_->obstacle_points_ = debug_image_points;
380-
debugger_->publishImage(det2d.id, input_roi_msg.header.stamp);
379+
debugger_->image_rois_ = debug_image_rois;
380+
debugger_->obstacle_points_ = debug_image_points;
381+
debugger_->publishImage(det2d.id, input_roi_msg.header.stamp);
382+
}
381383
}
382384
}
383385

0 commit comments

Comments
 (0)