Browse Source

添加过滤NAN点的操作

fujiankuan 3 years ago
parent
commit
63b9d36d57

+ 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();