From 030f785e0a9f63b99e684b5ea9ecd0706e6873c9 Mon Sep 17 00:00:00 2001 From: Rein Appeldoorn Date: Mon, 25 Nov 2024 14:51:52 +0100 Subject: [PATCH] fix(pointcloud2): do not crash on empty pointcloud Fixes #85 --- rosboard/serialization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rosboard/serialization.py b/rosboard/serialization.py index 80294e66..54d7f0ec 100644 --- a/rosboard/serialization.py +++ b/rosboard/serialization.py @@ -62,7 +62,7 @@ def ros2dict(msg): # PointCloud2: extract only necessary fields, reduce precision if (msg.__module__ == "sensor_msgs.msg._PointCloud2" or \ msg.__module__ == "sensor_msgs.msg._point_cloud2") \ - and field == "data": + and field == "data" and msg.data: rosboard.compression.compress_point_cloud2(msg, output) continue