-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support L535 options #8952
Support L535 options #8952
Conversation
aangerma
commented
May 4, 2021
•
edited by maloel
Loading
edited by maloel
- Created l535_hw_options class for l535 options.
- removed option RS2_OPTION_DIGITAL_GAIN not applicable for l535
- added option RS2_OPTION_RX_SENSITIVITY
- removed all preset values (except custom) for now - until we will have declaration of presets for L535
- removed options RS2_OPTION_ENABLE_MAX_USABLE_RANGE and RS2_OPTION_ENABLE_IR_REFLECTIVITY -for now until we will have declaration of them for L535
src/l500/l535-options.h
Outdated
l535_get_default = 4 | ||
}; | ||
|
||
typedef uvc_xu_option< int > super; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/l500/l535-options.h
Outdated
|
||
typedef uvc_xu_option< int > super; | ||
|
||
class l535_hw_options : public option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be in this header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amc_option
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/l500/l535-options.h
Outdated
|
||
namespace librealsense | ||
{ | ||
enum l535_control |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add l535 namespace inside ivcam2 namespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name something like amc_control
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/l500/l535-options.h
Outdated
l535_alternate_ir = 8 | ||
}; | ||
|
||
enum l535_command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amc_command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/l500/l535-options.h
Outdated
std::string _description; | ||
}; | ||
|
||
class l535_preset_option : public float_option_with_description< rs2_l500_visual_preset > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be in this header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dene
src/l500/l535-options.cpp
Outdated
#include "l500-private.h" | ||
#include "l500-depth.h" | ||
|
||
const std::string MIN_CONTROLS_FW_VERSION("1.3.9.0"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These still applicable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/l500/l535-options.cpp
Outdated
|
||
namespace librealsense | ||
{ | ||
using namespace ivcam2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
include/librealsense2/h/rs_option.h
Outdated
@@ -109,6 +109,7 @@ extern "C" { | |||
RS2_OPTION_ENABLE_IR_REFLECTIVITY, /**< Enables data collection for calculating IR pixel reflectivity */ | |||
RS2_OPTION_AUTO_EXPOSURE_LIMIT, /**< Set and get auto exposure limit in microseconds. Default is 0 which means full exposure range. If the requested exposure limit is greater than frame time, it will be set to frame time at runtime. Setting will not take effect until next streaming session. */ | |||
RS2_OPTION_AUTO_GAIN_LIMIT, /**< Set and get auto gain limits ranging from 16 to 248. Default is 0 which means full gain. If the requested gain limit is less than 16, it will be set to 16. If the requested gain limit is greater than 248, it will be set to 248. Setting will not take effect until next streaming session. */ | |||
RS2_OPTION_RX_SENSITIVITY, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm waiting for description from Aviad
src/l500/l535-options.cpp
Outdated
#include "l500-private.h" | ||
#include "l500-depth.h" | ||
|
||
namespace librealsense |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the .cpp files indenting like this.
Won't a single using librealsense::ivcam2::l535::device_options;
do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/l500/l535-options.h
Outdated
{ | ||
namespace l535 | ||
{ | ||
class l535_options : public virtual l500_device |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename device_options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/l500/l535-preset-option.cpp
Outdated
#include "l500-private.h" | ||
#include "l500-depth.h" | ||
|
||
namespace librealsense |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/l500/l535-preset-option.cpp
Outdated
void l535_preset_option::set(float value) | ||
{ | ||
if (static_cast<rs2_l500_visual_preset>(int(value)) | ||
== RS2_L500_VISUAL_PRESET_DEFAULT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this happen?? We should throw for anything not custom...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/l500/l535-preset-option.h
Outdated
{ | ||
class l535_preset_option : public float_option_with_description< rs2_l500_visual_preset > | ||
{ | ||
public: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use super
because it repeats in the .cpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/l500/l535-preset-option.h
Outdated
class l535_preset_option : public float_option_with_description< rs2_l500_visual_preset > | ||
{ | ||
public: | ||
l535_preset_option(option_range range, std::string description); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const &
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/types.cpp
Outdated
@@ -455,6 +455,7 @@ namespace librealsense | |||
case RS2_OPTION_ENABLE_IR_REFLECTIVITY: return "Enable IR Reflectivity"; | |||
CASE(AUTO_EXPOSURE_LIMIT) | |||
CASE(AUTO_GAIN_LIMIT) | |||
CASE(RX_SENSITIVITY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want this displayed as "Rx Sensitivity"?
wrappers/python/pybackend.cpp
Outdated
@@ -187,6 +187,7 @@ PYBIND11_MODULE(NAME, m) { | |||
.value("enable_ir_reflectivity", RS2_OPTION_ENABLE_IR_REFLECTIVITY) | |||
.value("auto_exposure_limit", RS2_OPTION_AUTO_EXPOSURE_LIMIT) | |||
.value("auto_gain_limit", RS2_OPTION_AUTO_GAIN_LIMIT) | |||
.value("rx_sensitivity", RS2_OPTION_RX_SENSITIVITY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're missing the C# and other wrappers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do when I will have the exact name of the control.
src/l500/l535-preset-option.h
Outdated
{ | ||
namespace l535 | ||
{ | ||
class l535_preset_option : public float_option_with_description< rs2_l500_visual_preset > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need the l535
in the name, do we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/l500/l535-options.cpp
Outdated
RS2_L500_VISUAL_PRESET_CUSTOM, | ||
1, | ||
RS2_L500_VISUAL_PRESET_CUSTOM }, | ||
"Preset to calibrate the camera to environment ambient, no ambient or low " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/l500/l535-amc-option.h
Outdated
namespace l535 | ||
{ | ||
|
||
enum amc_control |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we list only the controls that are applicable to the L535 here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its all of them + rx_sensitivity
src/l500/l535-amc-option.cpp
Outdated
#include "l500-private.h" | ||
#include "l500-depth.h" | ||
|
||
const std::string MIN_CONTROLS_FW_VERSION("1.3.9.0"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relevant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
src/l500/l535-amc-option.cpp
Outdated
void amc_option::enable_recording(std::function<void(const option&)> recording_action) | ||
{} | ||
|
||
float amc_option::query_current(rs2_sensor_mode mode) const //todo: remove sensor mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed query_current
src/l500/l535-amc-option.cpp
Outdated
return float(val); | ||
} | ||
|
||
amc_option::amc_option(l500_device* l500_dev, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put ctor first in file please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/l500/l535-amc-option.h
Outdated
private: | ||
float query_default() const; | ||
|
||
amc_control _type; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename _control
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/l500/l535-amc-option.h
Outdated
float query_default() const; | ||
|
||
amc_control _type; | ||
l500_device* _l500_dev; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove l500
from the name, _device
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking much better already!
Please rebase |
src/l500/CMakeLists.txt
Outdated
@@ -21,6 +24,9 @@ target_sources(${LRS_TARGET} | |||
"${CMAKE_CURRENT_LIST_DIR}/l500-fw-update-device.h" | |||
"${CMAKE_CURRENT_LIST_DIR}/l500-serializable.h" | |||
"${CMAKE_CURRENT_LIST_DIR}/l500-options.h" | |||
"${CMAKE_CURRENT_LIST_DIR}/l535-options.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be l535-device-options.h
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/l500/l535-amc-option.cpp
Outdated
|
||
|
||
using namespace librealsense; | ||
using namespace librealsense::ivcam2::l535; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not l535::amc_option
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/l500/l535-amc-option.cpp
Outdated
|
||
float amc_option::query() const | ||
{ | ||
auto res = _hw_monitor->send( command{ AMCGET, _control, get_current, RS2_SENSOR_MODE_VGA } ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please comment why we're sending the sensor mode when it shouldn't be needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
src/l500/l535-amc-option.cpp
Outdated
float amc_option::query_default() const | ||
{ | ||
auto res = _hw_monitor->send( | ||
command{ AMCGET, _control, l500_command::get_default, RS2_SENSOR_MODE_VGA } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, too....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/l500/l535-options.cpp
Outdated
#include "l500-depth.h" | ||
|
||
using namespace librealsense; | ||
using namespace librealsense::ivcam2::l535; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not l535::device_options
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/l500/l535-options.cpp
Outdated
{ min_distance, "Minimal distance to the target (in mm)" } }, | ||
{ RS2_OPTION_INVALIDATION_BYPASS, | ||
{ invalidation_bypass, "Enable/disable pixel invalidation" } }, | ||
{ RS2_OPTION_INVALIDATION_BYPASS, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two invalidation bypass?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
src/l500/l535-preset-option.cpp
Outdated
#include "l500-depth.h" | ||
|
||
using namespace librealsense; | ||
using namespace librealsense::ivcam2::l535; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not l535::preset_option
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
and added to wrappers.