ros_pointcloud2
ros_pointcloud2 copied to clipboard
add roslibrust ros1 message support
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