Skip to content

add roslibrust ros1 message support#24

Draft
lucasw wants to merge 7 commits intouos:mainfrom
lucasw:roslibrust
Draft

add roslibrust ros1 message support#24
lucasw wants to merge 7 commits intouos:mainfrom
lucasw:roslibrust

Conversation

@lucasw
Copy link

@lucasw lucasw commented Jul 31, 2024

It's a copy paste of the rosrust code but with Time secs/nsecs changed to fit Time in roslibrust.

But I can't get it to work in an example here: https://github.com/lucasw/transform_point_cloud/blob/96595aa00a58b882a40f4cba7d2d33e278a17bb2/src/bin/transform_point_cloud2.rs

But then I get

error[E0277]: the trait bound `PointCloud2Msg: From<sensor_msgs::PointCloud2>` is not satisfied
   --> src/bin/transform_point_cloud2.rs:124:75
    |
124 |                         let pc: ros_pointcloud2::PointCloud2Msg = pc2_msg.into();  // .try_into_iter().unwrap();
    |                                                                           ^^^^ the trait `From<sensor_msgs::PointCloud2>` is not implemented for `PointCloud2Msg`
    |
    = help: the trait `From<ros_pointcloud2::prelude::sensor_msgs::PointCloud2>` is implemented for `PointCloud2Msg`
    = help: for that trait implementation, expected `ros_pointcloud2::prelude::sensor_msgs::PointCloud2`, found `sensor_msgs::PointCloud2`
    = note: required for `sensor_msgs::PointCloud2` to implement `Into<PointCloud2Msg>`

The roslibrust codegen macro created messages for rpcl2, and then again for transform_point_cloud- I've done something similar with roslibrust and https://github.com/lucasw/rustros_tf/tree/roslibrust and https://github.com/lucasw/tf_demo/blob/old_tf_to_new_tf/src/bin/tf2tf.rs and didn't encounter anything like this.

If I don't do any codegen in my code and try to use ros_pointcloud2::prelude::sensor_msgs::PointCloud2 then I get

error[E0277]: the trait bound `ros_pointcloud2::prelude::sensor_msgs::PointCloud2: roslibrust_codegen::RosMessageType` is not satisfied

@lucasw
Copy link
Author

lucasw commented Jul 31, 2024

I did get it to work by copying the From code directly into my application and adapting it to useros_pointcloud2::... instead of crate::: lucasw/transform_point_cloud@813792c

@stelzo
Copy link
Member

stelzo commented Dec 30, 2025

@lucasw I invite you to test out the new version 1.0.0-rc.1 with roslibrust support for your existing work with point clouds. I think this PR could be closed with the new version.

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

Successfully merging this pull request may close these issues.

2 participants