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

SR300 RGB auto exposure ROI #4472

Merged
merged 1 commit into from
Jul 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/ivcam/ivcam-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ namespace librealsense {
GetPowerGearState = 0xFF,
GLD = 0x35,
FlashRead = 0x23,
SetRgbAeRoi = 0xdb,
GetRgbAeRoi = 0xdc,
};

enum gvd_fields
Expand Down
3 changes: 3 additions & 0 deletions src/ivcam/sr300-fw-update-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ namespace librealsense
void sr300_update_device::update(const void* fw_image, int fw_image_size, update_progress_callback_ptr callback) const
{
update_device::update(fw_image, fw_image_size, callback);

// wait for the device to come back from recovery state, TODO: check cause
std::this_thread::sleep_for(std::chrono::seconds(10));
}
}
8 changes: 8 additions & 0 deletions src/ivcam/sr300.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "proc/spatial-filter.h"
#include "proc/temporal-filter.h"
#include "proc/hole-filling-filter.h"
#include "ds5/ds5-device.h"

namespace librealsense
{
Expand Down Expand Up @@ -310,6 +311,13 @@ namespace librealsense
return (c.Rmax / 1000 / 0xFFFF);
})));

if (firmware_version(fw_version) >= firmware_version("3.26.2.0"))
{
roi_sensor_interface* roi_sensor;
if ((roi_sensor = dynamic_cast<roi_sensor_interface*>(&get_sensor(_color_device_idx))))
roi_sensor->set_roi_method(std::make_shared<ds5_auto_exposure_roi_method>(*_hw_monitor,
(ds::fw_cmd)ivcam::fw_cmd::SetRgbAeRoi));
}
}
void sr300_camera::create_snapshot(std::shared_ptr<debug_interface>& snapshot) const
{
Expand Down
2 changes: 1 addition & 1 deletion src/ivcam/sr300.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ namespace librealsense
sr300_camera& _owner;
};

class sr300_color_sensor : public uvc_sensor, public video_sensor_interface
class sr300_color_sensor : public uvc_sensor, public video_sensor_interface, public roi_sensor_base
{
public:
explicit sr300_color_sensor(sr300_camera* owner, std::shared_ptr<platform::uvc_device> uvc_device,
Expand Down