View my account

D415 Get unrectified streams for custom calibration

Comments

8 comments

  • Thomas Specte

    The firmware version of my sensors is 05.13.00.50

    SDK is 2.50.0

    0
    Comment actions Permalink
  • Thomas Specte

    Hi MartyG !

    I swear I tried looking into every post about raw format and the code samples, but I can't get that simple function to work..

    Any idea?

    Thanks a lot!

    0
    Comment actions Permalink
  • MartyG

    If you are able to use the RealSense Viewer tool, please look at the camera name at the top of the options side-panel.  If the number beside the name is '2.1' then the camera is being detected as being on a USB 2 connection.  If the number is '3.2' then the camera is on a USB 3 connection.  Infrared 2 is only available on a USB 3 connection.

    0
    Comment actions Permalink
  • Thomas Specte

    Hi MartyX Grover, thanks for your answer!

    I checked that I was on a 3.2 USB connection, and I could stream both Y16 streams using the viewer, it works just fine: 

    0
    Comment actions Permalink
  • Thomas Specte

    If I run the following (which is the same than before without enabling the left stream):

    I can retrieve the right images without any problem.

    So I guess the problem is to start both streams at the same time (and I checked again, my connection is 3.2 USB)

    0
    Comment actions Permalink
  • MartyG

    What happens if the code is simplified to remove the If checks, and the '6000' is removed from waitforframes() like in the edited code below.

     

    rs2::context myContext;
    rs2::device_list devicesList = myContext.query_devices();

    rs2::device myDevice = devicesList[0];
    rs400::advanced_mode advancedModeDevice = myDevice.as<rs400::advanced_mode>();
    if (!advancedModeDevice.is_enabled())
    {
       advancedModeDevice.toggle_advanced_mode(true);
    }

    rs2::config deviceConfig;

    deviceConfig.enable_stream(RS2_STREAM_INFRARED, 1, 1920, 1080, RS2_FORMAT_Y16, 15);
    deviceConfig.enable_stream(RS2_STREAM_INFRARED, 2, 1920, 1080, RS2_FORMAT_Y16, 15);

    rs2::pipeline myPipe(myContext);
    rs2::pipeline_profile myPipeProfile = myPipe.start(deviceConfig);

    rs2::frameset fs = myPipe.wait_for_frames();

    rs2::video_frame raw_left_infrared_frame  = fs.get_infrared_frame(1);

    rs2::video_frame raw_right_infrared_frame  = fs.get_infrared_frame(2);

       const int leftWidth  = raw_left_infrared_frame.get_width();
       const int leftHeight = raw_left_infrared_frame.get_height();


       const int rightWidth  = raw_right_infrared_frame.get_width();
       const int rightHeight = raw_right_infrared_frame.get_height();

       std::cout << fmt::format("Frame from Left Sensor : w={}, h={}\n", leftWidth, leftHeight); 
       std::cout << fmt::format("Frame from right Sensor : w={}, h={}\n", rightWidth, rightHeight); 
    0
    Comment actions Permalink
  • Thomas Specte

    Yes it finally worked \o/

    Actually it works well with the "if checks" and the waiting time at 6000, I really don't know what changed except that I tried making it work with the right stream only before...

    So thanks for your help!

    I guess plugging it / unplugging it and messing around with the streams (with the viewer also) did the trick somehow

    0
    Comment actions Permalink
  • MartyG

    I'm pleased to hear that it's working for you now.  Thanks very much for the update!

    0
    Comment actions Permalink

Please sign in to leave a comment.