浏览代码

添加过滤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();