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

Convert Rosbag file into pointcloud file #11154

Closed
TheNemo05 opened this issue Nov 28, 2022 · 5 comments
Closed

Convert Rosbag file into pointcloud file #11154

TheNemo05 opened this issue Nov 28, 2022 · 5 comments
Labels

Comments

@TheNemo05
Copy link

I ve recorded the video sequence using realsense SDK and it is stored in the .bag format. The RS convert tool didnt help as after conversion the file location is unknown. Can someone get me a valid solution.

@MartyG-RealSense
Copy link
Collaborator

Hi @TheNemo05 Any script originally designed for use with a live camera can use a bag file as its data source instead by inserting an enable_device_from_file instruction before the pipeline start line. For example, to use a bag file called 'test.bag' as the data source using C++ code:

rs2::config cfg;
cfg.enable_device_from_file("test.bag");
pipeline.start(cfg);

An example of a Python equivalent would be:

cfg = rs.config()
rs.cfg.enable_device_from_file(cfg,'test.bag')
pipeline.start(cfg)

Once you know how to adapt a live-camera script to a bag-reading script using the above method then you can easily adapt existing pointcloud generation scripts.

If you wish to obtain a .ply pointcloud data file then adapting a ply export script will likely be the best course of action.

The RealSense SDK has a ply export example program called export_ply_example

https://github.com/IntelRealSense/librealsense/blob/master/wrappers/python/examples/export_ply_example.py

A C++ example of a ply export script is at #6677 (comment)

@TheNemo05
Copy link
Author

hello how do we use the export_ply_example with realsense SDK, So I could receive exported file in .ply format.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Nov 29, 2022

To use the SDK's Python example scripts it is necessary to install the SDK's pyrealsense2 Python compatibility wrapper.

https://github.com/IntelRealSense/librealsense/tree/master/wrappers/python

If you have a desktop or laptop PC computer then the easiest method for installing the wrapper is with pip packages using the instruction pip install pyrealsense2 though this method cannot be used with computers with an Arm architecture such as Raspberry Pi and Nvidia Jetson.

The other way to install the wrapper is to build it from source code with CMake. You can either build it from source after the librealsense SDK has already been installed, or build librealsense and the wrapper at the same time.

@MartyG-RealSense
Copy link
Collaborator

Hi @TheNemo05 Do you require further assistance with this case, please? Thanks!

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants