View my account

Disable laser via API

Comments

1 comment

  • Official comment
    Jesus Garcia

    Hello Adam,

    It is possible to turn off the laser completely by setting the option RS2_OPTION_LASER_POWER to 0. Refer to this list of options for RealSense cameras. The L515 does not support all options but you can see the supported options in RealSense Viewer.

    rs2::pipeline pipe; 
    rs2::pipeline_profile selection = pipe.start();
    rs2::device selected_device = selection.get_device();
    auto depth_sensor = selected_device.first<rs2::depth_sensor>();
    
    if (depth_sensor.supports(RS2_OPTION_LASER_POWER))
    {
        // Query min and max values:
        auto range = depth_sensor.get_option_range(RS2_OPTION_LASER_POWER);
        depth_sensor.set_option(RS2_OPTION_LASER_POWER, range.max); // Set max power
        depth_sensor.set_option(RS2_OPTION_LASER_POWER, 0.f); // Disable laser
    }

    Sincerely,
    Jesus G.
    Intel Customer Support

    Comment actions Permalink

Please sign in to leave a comment.