소스 검색

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