Skip to content

Commit ac5c65a

Browse files
committed
fix(multi_object_tracker): make sure there are enough points to calc iou
Signed-off-by: Mehmet Emin BAŞOĞLU <mehmeteminbasoglu@hotmail.com>
1 parent 46ac827 commit ac5c65a

File tree

1 file changed

+6
-0
lines changed
  • common/object_recognition_utils/include/object_recognition_utils

1 file changed

+6
-0
lines changed

common/object_recognition_utils/include/object_recognition_utils/matching.hpp

+6
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ inline double getUnionArea(const Polygon2d & source_polygon, const Polygon2d & t
6565
template <class T1, class T2>
6666
double get2dIoU(const T1 source_object, const T2 target_object, const double min_union_area = 0.01)
6767
{
68+
if (
69+
source_object.shape.type == autoware_auto_perception_msgs::msg::Shape::POLYGON &&
70+
source_object.shape.footprint.points.size() < 3) {
71+
return 0.0;
72+
}
73+
6874
const auto source_polygon = tier4_autoware_utils::toPolygon2d(source_object);
6975
const auto target_polygon = tier4_autoware_utils::toPolygon2d(target_object);
7076

0 commit comments

Comments
 (0)