-
Notifications
You must be signed in to change notification settings - Fork 154
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
How to replay lidar data recorded under ros1 with ros2 #270
Comments
@rdouguet I didn't try to convert from ROS1 to ROS2 but when doing the opposite I had to add and register the message definitions within rosbags then I was successful with the conversion. I believe you have to do the same thing. |
Thanks for your feedback @Samahu I've just seen the possibility of adding messages with the rosbags tool. I'll try that and see if it works then. |
Finally is not really simple as problem, I did not find easy way... Maybe we can use "rosbags tools" to add custom message and analyzing the rosbag with python scripts... but my goal is to use old rosbag(ros1) to test new fusion algorithm (develop under ros2) between some sensors such as Lidar, camera and radar. One solution that I haven't yet had time to finalize is to follow the steps explain at the start (convert ros1 to ros2 and next compile ros ouster package). Finally, you can change manually the type of message in new dB3 log... to replace the type "/ouster_ros/msg/PacketMsg" by "/ouster_sensor_msgs/msg/PacketMsg". In this way, you can publish raw lidar data. Now I must find how the new ros ouster node can subscribe to these topics to generate the point cloud ? |
To find how to read load and read the packets from a bag file you should checkout the file |
Thanks for your feedback. Indeed I see the replay.launch.xml but I 'm not sure to understand completely this replay mode... It is mandatory to fill the path of the rosbag ? I tested by providing the metadata et my rosbag but I did not see point cloud. I have this warning: But my need is to be able to replay rosbag (with several topic provided from different sensors) and for the ouster data, I just need to transform the raw lidar data ("/os_node/imu_packets" and /os_node/lidar_packets") to point cloud... I don't want to run the rosbag command from this script. I must admit that in previous versions, I was able to do this quite easily, but no matter how much I read the readme documentation, it's hard to understand without going into the code... Is there a solution for replaying the data without passing it the rosbag but only indicating the input topics? Thanks in advance |
@rdouguet I only suggested that you examine If you examine the file closely (using ROS2 version here): ouster-ros/ouster-ros/launch/replay.composite.launch.xml Lines 65 to 81 in 66d6b9f
You can see that along with the os_replay node, we construct an os_cloud and os_image nodes (components). These two nodes process the raw lidar/imu packets when published on the default If you need to have more than one senosr then you would need to a pair of os_cloud and os_image nodes for each sensor that you intend to replay and utilize topic remapping to set each pair differently for each sensor. |
Thanks for your help, I can finally replay the data provided by an old rosbag :) To make it work, I removed the part that launches the ros2 bag from the launch file and deleted the "bag_file" arg. I directly renamed my topics from the *.db3 log file ("/os_node/lidar_packets" to "/ouster/lidar_packets" and /os_node/imu_packets" to "/ouster/imu_packets"). But I suppose it would also work if I remapped these topics with the remapping function. |
The topic prefix |
Is there a converter now for playing bags created with a device running Ros1 Noetic that needs to be played back on a different machine with Ros2 Humble? The machine with Ros2 does not have Ros1 on it. |
@Rotoslider please checkout these two helper scripts that allows you to switch between ROS1/ROS2 using rosbags library ouster-lidar/ouster-ros-extras#2. Note that I have developed these scripts for my own use and they are not production ready. Hope this helps! |
Describe your question
I'm trying to replay lidar data recorded under ros1 (melodic) in the ros2 (Humble) environment with the Ouster driver for ROS2. So far, I still haven't succeeded but I don't know if I'm going in the right direction.
Here are the step for replaying a recording :
First, I convert my ROS1 recording file to ROS2 using the rosbags tool (https://pypi.org/project/rosbags/)
Next, I compile the ros ouster package so that normally ROS is able to recognize lidar custom messages.
But when I start the replay of this new file, the ouster topics are not recognized and I have the following error :
Screenshots
![Capture d’écran du 2023-11-27 11-41-13](https://private-user-images.githubusercontent.com/83842475/285806882-4ae64eec-4956-47f0-829f-645b9be77d91.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMjI2MDgsIm5iZiI6MTczOTAyMjMwOCwicGF0aCI6Ii84Mzg0MjQ3NS8yODU4MDY4ODItNGFlNjRlZWMtNDk1Ni00N2YwLTgyOWYtNjQ1YjliZTc3ZDkxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDEzNDUwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTllNzBiZjc0ZjgyZWM1MTRhM2UxOGFiZjZmMjUwMGIyNGJjM2NkNzA5YjE2NTk3NjlmNTMwOWM5OGVmYTlkN2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.I30XkoJAWUajEHP6WpkttqJfEe99MklyYXdMwVmx2Sc)
I work the same way with other sensors and have never had this problem.
Platform
The text was updated successfully, but these errors were encountered: