Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decoding CompressedPointCloud2 using point_cloud_transport_py #102

Open
FranzAlbers opened this issue Nov 21, 2024 · 0 comments
Open

Decoding CompressedPointCloud2 using point_cloud_transport_py #102

FranzAlbers opened this issue Nov 21, 2024 · 0 comments

Comments

@FranzAlbers
Copy link

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 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant