Skip to content
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

Merged
merged 9 commits into from
May 10, 2021
Merged

Conversation

aangerma
Copy link
Contributor

@aangerma aangerma commented May 4, 2021

  • 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

l535_get_default = 4
};

typedef uvc_xu_option< int > super;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


typedef uvc_xu_option< int > super;

class l535_hw_options : public option
Copy link
Collaborator

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amc_option?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


namespace librealsense
{
enum l535_control
Copy link
Collaborator

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

Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

l535_alternate_ir = 8
};

enum l535_command
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amc_command

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

std::string _description;
};

class l535_preset_option : public float_option_with_description< rs2_l500_visual_preset >
Copy link
Collaborator

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

Copy link
Contributor Author

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 Show resolved Hide resolved
#include "l500-private.h"
#include "l500-depth.h"

const std::string MIN_CONTROLS_FW_VERSION("1.3.9.0");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These still applicable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


namespace librealsense
{
using namespace ivcam2;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -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,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description?

Copy link
Contributor Author

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

#include "l500-private.h"
#include "l500-depth.h"

namespace librealsense
Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

{
namespace l535
{
class l535_options : public virtual l500_device
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename device_options

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

#include "l500-private.h"
#include "l500-depth.h"

namespace librealsense
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

void l535_preset_option::set(float value)
{
if (static_cast<rs2_l500_visual_preset>(int(value))
== RS2_L500_VISUAL_PRESET_DEFAULT)
Copy link
Collaborator

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...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

{
class l535_preset_option : public float_option_with_description< rs2_l500_visual_preset >
{
public:
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

class l535_preset_option : public float_option_with_description< rs2_l500_visual_preset >
{
public:
l535_preset_option(option_range range, std::string description);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const &

Copy link
Contributor Author

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)
Copy link
Collaborator

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"?

@@ -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)
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

{
namespace l535
{
class l535_preset_option : public float_option_with_description< rs2_l500_visual_preset >
Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

RS2_L500_VISUAL_PRESET_CUSTOM,
1,
RS2_L500_VISUAL_PRESET_CUSTOM },
"Preset to calibrate the camera to environment ambient, no ambient or low "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

namespace l535
{

enum amc_control
Copy link
Collaborator

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?

Copy link
Contributor Author

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

#include "l500-private.h"
#include "l500-depth.h"

const std::string MIN_CONTROLS_FW_VERSION("1.3.9.0");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relevant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed query_current

return float(val);
}

amc_option::amc_option(l500_device* l500_dev,
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

private:
float query_default() const;

amc_control _type;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename _control

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

float query_default() const;

amc_control _type;
l500_device* _l500_dev;
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Collaborator

@maloel maloel left a 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!

@maloel
Copy link
Collaborator

maloel commented May 6, 2021

Please rebase

@@ -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"
Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done



using namespace librealsense;
using namespace librealsense::ivcam2::l535;
Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


float amc_option::query() const
{
auto res = _hw_monitor->send( command{ AMCGET, _control, get_current, RS2_SENSOR_MODE_VGA } );
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

float amc_option::query_default() const
{
auto res = _hw_monitor->send(
command{ AMCGET, _control, l500_command::get_default, RS2_SENSOR_MODE_VGA }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, too....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

#include "l500-depth.h"

using namespace librealsense;
using namespace librealsense::ivcam2::l535;
Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

{ min_distance, "Minimal distance to the target (in mm)" } },
{ RS2_OPTION_INVALIDATION_BYPASS,
{ invalidation_bypass, "Enable/disable pixel invalidation" } },
{ RS2_OPTION_INVALIDATION_BYPASS,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two invalidation bypass?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

#include "l500-depth.h"

using namespace librealsense;
using namespace librealsense::ivcam2::l535;
Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@maloel maloel merged commit b8ec3b5 into IntelRealSense:development May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants