View my account

how do I set rs2_options in the python examples?



  • MartyG

    I do not have a code example for your specific problem with relocalization for Python unfortunately.  As a general guideline though, when RS2 option instructions are written in Python, rs.option is used instead of rs2.  The Python example in the link elow may be useful for seeing how to structure rs.option instructions in Pyrealsense2. 

    The best place to get a specific answer will likely be on the GitHub version of this question that you posted, once an Intel RealSense support representative responds.  Good luck!

    Comment actions Permalink
  • Mgnusk

    It's a year later but I think I've found a solution to this and I'm leaving it here so that other poor schmucks like myself don't have to work through and figure it out themselves, since this result is quite high on google. 


    sensor.set_option takes two parameters, the option you want to set from the enum pyrealsense2.option; and the setting you want to make it, whatever that may be. The different device lines' presets are in the rs_options.h reference on the API reference:


    I'm using an L515, not a T265, but I'm fairly sure it's a similar solution for other devices. 

    option = rs.option.visual_preset
    preset = rs.l500_visual_preset.short_range
    depth_sensor = depth_sensor.set_option(option, preset)
    Comment actions Permalink
  • Iviti

    you are a fancy person

    Comment actions Permalink

Please sign in to leave a comment.