librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

can´t find librealsense2/rsutils.hpp

Open sglxh opened this issue 9 years ago • 5 comments

Required Info
Camera Model SR300
Firmware Version
Operating System & Version ubuntu14.04
Kernel Version (Linux Only) 4.4.0-97-generic

I want to Displaying Infrared Frame https://github.com/IntelRealSense/librealsense/blob/master/doc/stepbystep/getting_started_with_openCV.md . After I installed the Intel SR300 driver, I find it need a hpp file <librealsense2/rsutils.hpp>.I can find rs.hpp but I can´t find rsutils.hpp at /usr/local/include/librealsense2. Where is the rsutils.hpp?

sglxh avatar Oct 21 '17 05:10 sglxh

Hi @sglxh I see now that the documentation is somewhat out of date, it will be updated shortly.

dorodnic avatar Oct 21 '17 13:10 dorodnic

Hi @sglxh,

Until we update the sample, you can try the following snippet (which does not require rsutils.hpp:

    rs2::pipeline pipe;  //Contruct a pipeline which abstracts the device
    rs2::config cfg;   //Create a configuration for configuring the pipeline with a non default profile

    //Add desired streams to configuration
    cfg.enable_stream(RS2_STREAM_INFRARED, 640, 480, RS2_FORMAT_Y8, 30); 
    cfg.enable_stream(RS2_STREAM_DEPTH, 640, 480, RS2_FORMAT_Z16, 30);

    //Instruct pipeline to start streaming with the requested configuration:
    pipe.start(cfg);

    //Try to get an infrared frame
    rs2::frame ir_frame;
    while(!ir_frame)
    {
        ir_frame = pipe.wait_for_frames().first(RS2_STREAM_INFRARED);
    }
    
    //Use infrared frame...
    //Same code as the original example here...
    Mat ir(Size(640, 480), CV_8UC1, (void*)ir_frame.get_data(), Mat::AUTO_STEP);
    /....

zivsha avatar Oct 21 '17 19:10 zivsha

Thanks you!

sglxh avatar Oct 23 '17 01:10 sglxh

Hi zivsha, I have tried your snippet but getting following error:

terminate called after throwing an instance of 'rs2::error' what(): Frame of requested stream type was not found! Makefile:10: recipe for target 'run' failed make: *** [run] Aborted (core dumped)

System info:

Required Info  
Camera Model SR300
Firmware Version  
Operating System & Version ubuntu16.04
Kernel Version (Linux Only) 4.12.12-041212-generic

ankit-shinde avatar Oct 26 '17 06:10 ankit-shinde

Follow up on Issue #742

zivsha avatar Oct 26 '17 09:10 zivsha