-
Notifications
You must be signed in to change notification settings - Fork 441
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
Extract lidar_packets from ROS2 bag file to dataframe in Python #524
Comments
You could replay the bag file using the replay command of the ROS driver, during replay the driver publishes PointCloud2 messages on the |
@Samahu Thanks for your reply. This is exactly how we do it at the moment :) There are though multiple problems with this. For one its an extra step that has to be done every time a file is recorded. In general playing and recording again adds another unnecessary step of complexity and potential way to loose some data. |
I need to take a closer look at the two issues you linked but it is worth noting that I am adding the ability to utilize |
I need to take a closer look at the two issues you linked but it is worth noting that I am adding the ability to utilize |
Did not see this PR yet, looks like a very promising update! |
You will still have the ability to record the raw packets. So you can select the |
I understand that, but could you point me into the right direction considering my initial question? In theory all the functionality to convert raw packets to arrays of x,y,z should be available in the ouster-sdk, I reckon. |
You need to pass the LidarPacket to a ScanBatcher object from which you can obtain the LidarScan. Consider this piece of code: https://github.com/ouster-lidar/ouster_example/blob/ff46c961b690daae3e18e39999ef8651081cbc66/python/src/ouster/client/core.py#L418-L421 The ScanBatcher ( |
(Also, regarding your question re |
Thank you for your tips. Using ScanBatcher I got something out of the raw data, but I need to look into this in more detail. If I make some progress I will report it here. |
Grisly00 I too am interested in doing exactly what you are doing. Have you made any progress with this? It would be great to have this provided directly from Ouster, I doubt we're the only ones interested in this. |
@engnfrc I made some progress, but did not have any success yet. I created a repo with a minimal example script here including a test bag file. Feel free to check it out. @Samahu Perhaps you can also take a look at my repo. I manage to create scans in the form of numpy arrays from a bag file containing lidar_packets, but they don't seem to be batched properly. |
When working with PointCloud2 data there exists a nice tool to import pointclouds from bag files to a dataset of Pandas dataframes. How could this work with a bag file of lidar_packets?
Topic in bag file:
I played around with the
ouster-sdk
androsbags
, but could not figure out how to get from the high frequency stream of lidar_packets to single scans. Here is some code that leads me toOutput:
Does anyone have a tip on how to move forward from here?
Also, if I do not set the _raise_on_id_check flag to false I get the following error:
ouster.client.data.PacketIdError: Metadata init_id/sn does not match: expected by metadata - 9342166/992201000519, but got from packet buffer - 16641/26289897728
Platform (please complete the following information):
The text was updated successfully, but these errors were encountered: