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

add roslibrust ros1 message support #24

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

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

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.

1 participant