فهرست منبع

添加过滤NAN点的操作

fujiankuan 3 سال پیش
والد
کامیت
63b9d36d57
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      src/ros/open_source_code/rslidar_sdk/src/msg/proto_msg_translator.h

+ 2 - 1
src/ros/open_source_code/rslidar_sdk/src/msg/proto_msg_translator.h

@@ -80,7 +80,8 @@ inline LidarPointCloudMsg toRsMsg(const proto_msg::LidarPointCloud& proto_msg)
     point.y = proto_msg.data(i + 1);
     point.z = proto_msg.data(i + 2);
     point.intensity = proto_msg.data(i + 3);
-    ptr_tmp->push_back(point);
+    if ((!std::isnan(point.x)) && (!std::isnan(point.y)) && (!std::isnan(point.z)))  // 20220221
+    	ptr_tmp->push_back(point);
   }
   ptr_tmp->height = proto_msg.height();
   ptr_tmp->width = proto_msg.width();