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

pipe.stop() after set_real_time(False) freezes the program when capturing from a rosbag file #3126

Closed
mcasl opened this issue Jan 23, 2019 · 11 comments
Labels

Comments

@mcasl
Copy link

mcasl commented Jan 23, 2019


Required Info
Camera Model rosbag source from D435
Firmware Version (Open RealSense Viewer --> Click info)
Operating System & Version {Win 10
Kernel Version (Linux Only)
Platform PC
SDK Version 2.17.1.457
Language python
Segment {Robot/Smartphone/VR/AR/others }

Issue Description

After opening a Rosbag file with real_time = False, stopping the pipe using pipe.stop() freezes the program.
Same code with real_time = True works flawlessly and stops the pipe.

This code freezes the program:

import pyrealsense2 as rs

filename = 'D:\\video.bag'
real_time = False

pipe = rs.pipeline()
cfg  = rs.config()
cfg.enable_device_from_file(filename)
profile  = pipe.start(cfg)
device   = profile.get_device()
playback = rs.playback(device)
playback.set_real_time(real_time)

pipe.stop()

This code works well, the only difference is the value of real_time:

filename = 'D:\\video.bag'
real_time = True

pipe = rs.pipeline()
cfg  = rs.config()
cfg.enable_device_from_file(filename)
profile  = pipe.start(cfg)
device   = profile.get_device()
playback = rs.playback(device)
playback.set_real_time(real_time)

pipe.stop()

This code also freezes the program, the only difference is setting real_time a second time:

filename = 'D:\\video.bag'
real_time = False

pipe = rs.pipeline()
cfg  = rs.config()
cfg.enable_device_from_file(filename)
profile  = pipe.start(cfg)
device   = profile.get_device()
playback = rs.playback(device)
playback.set_real_time(real_time)

playback.set_real_time(True)

pipe.stop()
@lramati
Copy link
Contributor

lramati commented Jan 30, 2019

Is this behavior consistent for you? I ran the second snippet in a loop and couldn't get the program to freeze

@mcasl
Copy link
Author

mcasl commented Feb 5, 2019

@lramati It's actually the first snippet the one that freezes, not the second. In the second I just change the real time option to True to point out that it works then.

@mcasl
Copy link
Author

mcasl commented Feb 7, 2019

Possibly related to: #2472

@dorodnic dorodnic added the bug label Feb 24, 2019
@dorodnic
Copy link
Contributor

@mcasl - I can confirm this is a bug.
For now I work-around #2472, since we need to think how to handle this properly.

@dmandrioli
Copy link

The problem occurs erratically in 2.18.1, it's really annoying for production code, I need to kill the process from outside and setting real_time to True is not a workaround since you can loose frames to process. @dorodnic Do you have an actual workaround for this? Thanks.

@dmandrioli
Copy link

Well, a working approach is to postpone the processing after caching all frames in memory in real_time mode. Not so annoying :)

@soarwing52
Copy link

using the lastest 2.21 version and still getting the freeze situation.

@krejov100
Copy link
Contributor

I am also facing this issue in 2.21

@upxela
Copy link

upxela commented Jun 17, 2019

facing this in 2.23 with both python and matlab.

@kevindehecker
Copy link
Contributor

kevindehecker commented Jul 27, 2019

Me too 2.24. (C++ in my case)

@kevindehecker
Copy link
Contributor

I just updated everything, now running kernel 5.0.0-29-generic with realsense api v 2.29, and this problems seems to be fixed!

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

8 participants