librealsense: assert error in load offline *.bag file
Required Info | |
---|---|
Camera Model | { D400 } |
Firmware Version | (Open RealSense Viewer --> Click info) |
Operating System & Version | {Linux (Ubuntu 18.04) |
Kernel Version (Linux Only) | (e.g. 4.15.0) |
Platform | PC |
SDK Version | { legacy / 2.<45>.<0> } |
Language | {C++ } |
Segment | {Robot } |
Issue Description
<Describe your issue / question / feature request / etc…>
//////////////////////this is my code below
void test_playback_problem() {
string filename = "./20210602_rectmirror.bag";
rs2::pipeline pipe;
rs2::config cfg;
cfg.enable_device_from_file(filename);
auto profile = pipe.start(cfg); // Load from file
auto device = profile.get_device();
auto playback = device.as<rs2::playback>();
playback.set_real_time(false);
int captureTime = 10;
int cnt = 0;
while (cnt < captureTime)
{
rs2::frameset frames = pipe.wait_for_frames(); // Wait for next set of frames from the camera
cnt++;
}
pipe.stop();
}
int main (int argc, char** argv)
{
for(int i=0;i<8;i++)
{
cout<<"excute times: "<<i<<endl;
test_playback_problem();
}
return (0);
}
/////////this is error below,when code excute to stop()
MyRobotVision: /home/xzt/librealsense-master/src/media/playback/playback_device.cpp:499: librealsense::playback_device::do_loop(T)::<lambda(dispatcher::cancellable_timer)> [with T = librealsense::playback_device::try_looping()::<lambda()>]: Assertion `m_is_started == false’ failed.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16
@keithahern You have to just finish all frames。If counts of frames is larger than 1000, your must finish all frames,then stop. I wirte this code below in C++,just for finish all frames.
/this is my code/
bool ret=true; while(ret) { rs2::frameset frames; ret=pipe.try_wait_for_frames(&frames,500); } pipe.stop();