You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using rs2::pipe().start(cfg, [](const rs2::frame & frame){ }), I am unable to get a proper depth_frame pointer when converting a frame to depth_frame. When using the rs2::pipe().wait_for_frames(), it works properly.
@MoBaT hello, the pipeline callbacks generally provide rs2::frameset objects types.
Therefore to extract the depth data use the following pattern
pipe.start(cfg, [&](const rs2::frame & frame) {
//if(frame.get_profile().stream_type() == RS2_STREAM_DEPTH) - This is not needed
{
if (rs2::frameset fs = frame.as<rs2::frameset>())
{
// With callbacks, all the synchronized streams arrive in a single framesetfor (rs2::frame& f : fs)
....
// Alternatively:if (auto depth_frame = fs.get_depth_frame())
.....
}
else// // In case the rs2::frame is not cast-able to rs2::frameset
{
...
}
}
Issue Description
When using
rs2::pipe().start(cfg, [](const rs2::frame & frame){ })
, I am unable to get a proper depth_frame pointer when converting a frame to depth_frame. When using thers2::pipe().wait_for_frames()
, it works properly.The text was updated successfully, but these errors were encountered: