how do I set rs2_options in the python examples?
Lets say I am trying to use the t265_example.py script to get my position information, but I want to enable the RS2_OPTION_ENABLE_RELOCALIZATION rs2_option. Where would I go about setting that option?
-
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.
https://forums.intel.com/s/question/0D50P00004EgktPSAR/enable-autoexposure-using-python-code
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!
-
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: https://intelrealsense.github.io/librealsense/doxygen/rs__option_8h.html.
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)
Please sign in to leave a comment.
Comments
3 comments