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

using a.bag frames #6811

Closed
arothenberg opened this issue Jul 12, 2020 · 7 comments
Closed

using a.bag frames #6811

arothenberg opened this issue Jul 12, 2020 · 7 comments

Comments

@arothenberg
Copy link

arothenberg commented Jul 12, 2020


Required Info
Camera Model D435
Firmware Version 05.12.02.100
Operating System & Version Win (10)
Platform PC
SDK Version 2.32
Language C++
Segment desktop app

Issue Description

I am trying to analyze depth frames on prerecorded data.

To test it I'm using the rs-align-advanced code and changing the source to the "a.bag" file created using rs-record-playback .
I tried to port this code:
cfg.enable_device_from_file("a.bag");

into rs-align-advanced like this

rs2::pipeline pipe;
rs2::config cfg;
cfg.enable_device_from_file("a.bag");
rs2::pipeline_profile profile = pipe.start(cfg);

get an error saying failed to create a ros reader.

The difference i see is that rs-record-playback uses a shared pointer

pipe = std::make_sharedrs2::pipeline();
...
pipe->start(cfg);

I'm probably missing something obvious.

Thanks in advance. Also, is the bag file degraded or does it store the same frames that the camera sends?

@kograins
Copy link

kograins commented Jul 13, 2020

To arothenberg:

I am using python API, The method "config.enable_stream_from_file("filename")" didn't worked well with the loaded .bag filename named with prefix like "test....", "2020....".

Try another file name with prefix like "sun...".

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Jul 13, 2020

Hi @arothenberg If you are working in the C++ language, the RealSense ROS-bag parser sample program created by a RealSense community member may be a useful reference. It also requires OpenCV as a dependency though.

The finished code for the project is at the bottom of the opening comment, in a file called RealSenseHelper.zip.

#2215

@arothenberg
Copy link
Author

Thanks Marty.
I downloaded the zip and will see what it's all about. I didn't want to add the dependency but I guess Opencv is necessary for certain tasks.

Thanks. I'll open another issue or comment on the marcovs thread if(when!) I have a problem. Thanks.

@MartyG-RealSense
Copy link
Collaborator

@arothenberg Thanks very much for the update. Good luck!

@arothenberg
Copy link
Author

Thanks. One other thing. Realsense should consider adding the parser or similar to the sdk examples because testing with prerecorded data is necessary for most projects.

@MartyG-RealSense
Copy link
Collaborator

The rosbag parser program is at the base of the SDK examples page, filed under the Community Projects section of example programs contributed by RealSense community members.

https://github.com/IntelRealSense/librealsense/tree/master/examples#community-projects

@arothenberg
Copy link
Author

I got it thanks. I'll set it up today. I never thought of checking the community projects. I'll be more aware of that now. It probably makes things easier.

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

No branches or pull requests

3 participants