PointCloudLibrary/pcl

[io] Check for IR stream capability before creating it in `real_sense_2_grabber` for D415

Open

#3.809 geöffnet am 26. März 2020

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)C++ (4.506 Forks)batch import
good first issuekind: bugkind: todomodule: iostatus: triage

Repository-Metriken

Stars
 (9.023 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 8T 7h) (3 gemergte PRs in 30 T)

Beschreibung

Describe the bug

When trying to obtain point clouds from the Intel RealSense D415, in RealSense2Grabber::start(), I get an exception that "Stream is not supported." This comes from the check here. Specifically, when checking the RS2_STREAM_INFRARED stream, realsense throws a runtime error (rs_pipeline.hpp L69), since the D415 has no infrared stream.

Environment

  • OS: Windows 10
  • Compiler: cl 19.24.28314
  • PCL Version: 1.10.0

I am able to circumvent the issue by simply taking out the RS2_STREAM_INFRARED line, and everything works successfully (this is obviously not a general enough solution:

if ( prof.get_stream ( RS2_STREAM_COLOR ).format ( ) != RS2_FORMAT_RGB8 ||
      prof.get_stream ( RS2_STREAM_DEPTH ).format ( ) != RS2_FORMAT_Z16)
      THROW_IO_EXCEPTION ( "This stream type or format not supported." );

Contributor Guide