You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have recorded some point clouds with Draco compression as point_cloud_interfaces/CompressedPointCloud2 in ROS2 bags. Our goal is to decode these into regular sensor_msgs/PointCloud2 messages by directly reading the compressed point clouds from the bag file using Python.
We figured the decode method from the point_cloud_transport_py package would handle this, but the returned pointcloud2_buffer is empty after decoding.
Here is a snippet from our current approach:
import point_cloud_transport_py as pct
from point_cloud_interfaces.msg import CompressedPointCloud2
from rclpy.serialization import serialize_message
...
pct_codec = pct.PointCloudCodec()
pct_vec_str = pct.VectorString()
pct_names_vec_str = pct.VectorString()
codec.getLoadableTransports(self._pct_vec_str, self._pct_names_vec_str)
# Verified: Draco Transport is available
...
# load compressed_pointcloud2_msg from bag
# Verified: compressed_pointcloud2_msg properly loaded
compressed_pointcloud2_buffer = serialize_message(compressed_pointcloud2_msg)
pointcloud2_buffer = pct_codec.decode(compressed_pointcloud2_msg.format, bytes(compressed_pointcloud2_buffer))
Are there specific steps we might be missing when using the decode method?
Are there any example scripts or documentation available that show how to decode CompressedPointCloud2 messages in Python?
Thank you in advance for your help!
The text was updated successfully, but these errors were encountered:
Hello,
thanks for developing this useful package!
We have recorded some point clouds with Draco compression as
point_cloud_interfaces/CompressedPointCloud2
in ROS2 bags. Our goal is to decode these into regularsensor_msgs/PointCloud2
messages by directly reading the compressed point clouds from the bag file using Python.We figured the
decode
method from thepoint_cloud_transport_py
package would handle this, but the returned pointcloud2_buffer is empty after decoding.Here is a snippet from our current approach:
Are there specific steps we might be missing when using the decode method?
Are there any example scripts or documentation available that show how to decode CompressedPointCloud2 messages in Python?
Thank you in advance for your help!
The text was updated successfully, but these errors were encountered: