-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
error in reading bag files #2693
Comments
Just to clarify: run_test is a bunch of repeated commands running over the same sequence of bag files. I did this because the error occurs randomly (sometime it does not happen, sometime it happens, but not necessarily on the same bag file.) |
I believe that it is the two calls to "try_wait_for_frames()" causing the error, since if I comment out these two lines, no error would occur. I also tried to use "wait_for_frames()" instead, as below: frameset = pipe.wait_for_frames(); but the same error occurred. |
I just installed the latest SDK, and after re-compiling my code, I got the following error message: /home/user/librealsense-master/src/media/playback/playback_device.cpp:495: librealsense::playback_device::do_loop(T)::<lambda(dispatcher::cancellable_timer)> [with T = librealsense::playback_device::try_looping()::<lambda()>]: Assertion `m_is_started == false' failed. All the bag files can be played in realsense-viewer without any issue. Thanks. |
A second run got the following error message: /home/user/librealsense-master/src/media/playback/playback_device.cpp:158: virtual librealsense::playback_device::~playback_device(): Assertion `0' failed. |
Using the latest development branch, the program hangs after running through a number of bag files. |
Actually, in another test with the latest release, the same issue of hanging occurs again. |
[Realsense Customer Engineering Team Comment] Wonder if there is any update? Some data point here: I used your code, but did a simply dumping some intrinsics info in the processing part. Also keep a loop of repeating the bag file operation for 100 times in a roll. This may help debug the issue, if still need to. Thanks! |
[Realsense Customer Engineering Team Comment] Thanks! |
Thanks, but I tested again (using firmware 05.10.13 ) and the issue is still there. Sometimes it worked fine. But if I run many times, sometimes I got "Segmentation fault (core dumped)", sometime I got "librealsense::playback_device::do_loop(T)::<lambda(dispatcher::cancellable_timer)> [with T = librealsense::playback_device::try_looping()::<lambda()>]: Assertion `m_is_started == false' failed. How many bag files did are there in each loop, and roughly how many frames in each bag file, please? |
Hi ywjia, I mimicked your case: bag file for 1 second streaming, and tested 100 times for each loop. Thanks, |
Hi ywjia, Wonder if there is any update? Thank you! |
I still have the issue. Is there any way I can sent the bag files to you to have a test, please? |
Hi ywjia, Please check back later with Realsense future releases and see it will help fix your issue. Thanks, |
Hello! Did you ever find a solution to this problem? I have the exact same. |
…msg format in Extrinsics.msg and README.md
I have a sequence of bag files captured from realsenseviewer, named as test_####.bag. Each of the bag files contains ~1s of data with color frames and depth frames, with frame rates at 30fps for both (therefore there should be ~30 frames of color and depth frames in each bag file). I use the following code to read the bag files.
int main(int argc, char * argv[])
{
int start_shot = atoi(argv[1]); // = 0
int end_shot = atoi(argv[2]); // = 22
for(int s=start_shot; s<=end_shot; s++)
{
char bag_file[256]; sprintf(bag_file, "test_%04d.bag", s);
if (!fileExists(bag_file)) continue;
rs2::config cfg;
cfg.enable_device_from_file(bag_file);
rs2::pipeline pipe;
rs2::pipeline_profile profile = pipe.start(cfg);
auto color_stream = profile.get_stream(RS2_STREAM_COLOR).asrs2::video_stream_profile();
auto depth_stream = profile.get_stream(RS2_STREAM_DEPTH).asrs2::video_stream_profile();
int color_width = color_stream.width();
int color_height = color_stream.height();
int depth_width = depth_stream.width();
int depth_height = depth_stream.height();
float depth_scale = get_depth_scale(profile.get_device());
rs2_intrinsics c_intrin = color_stream.get_intrinsics();
rs2::frameset frameset;
bool frameset_read = true;
for(int i=0; i<10; i++) { // ignore the first 10 frameset
if(pipe.try_wait_for_frames(&frameset, 5000)==false) {
std::cout << "try_wait_for_frames timeout" << std::endl;
frameset_read = false;
break;
}
}
if (!frameset_read) continue;
if(pipe.try_wait_for_frames(&frameset, 5000)==false) {
std::cout << "try_wait_for_frames timeout" << std::endl;
continue;
}
}
Sometime the program hangs in the middle of bags files (not always on the same one), and sometimes I encounter the following error:
"terminate called after throwing an instance of 'std::system_error'
what(): Invalid argument
./run_test: line 28: 10163 Aborted (core dumped) ./run_test 0 22"
I really cannot see how that can happen. Any advice is appreciated.
Particularly:
(1) Is the way of using "try_wait_for_frames()" in the above code correct?
(2) Is it necessary to call pipe.end(), corresponding to pipe.start(), at the end of each loop?
Thanks.
The text was updated successfully, but these errors were encountered: