Skip to content

Commit

Permalink
Added ds5-wide-fov class to create the profile tags related to fov de…
Browse files Browse the repository at this point in the history
…vices.
  • Loading branch information
aangerma committed Dec 1, 2019
1 parent 5d2ec9a commit 6246970
Show file tree
Hide file tree
Showing 12 changed files with 156 additions and 161 deletions.
2 changes: 1 addition & 1 deletion common/model-views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ namespace rs2
auto sensor_profiles = s->get_stream_profiles();
reverse(begin(sensor_profiles), end(sensor_profiles));
rs2_format def_format{ RS2_FORMAT_ANY };
std::pair<int, int> default_resolution;
auto default_resolution = std::make_pair(1280, 720);
for (auto&& profile : sensor_profiles)
{
std::stringstream res;
Expand Down
2 changes: 1 addition & 1 deletion include/librealsense2/h/rs_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ void rs2_enter_update_state(const rs2_device* device, rs2_error** error);
[0.15, 0.25) - Can be Improved
[0.25, ) - Requires Calibration
* \param[in] callback Callback to get progress notifications
* \return Nnew calibration table
* \return New calibration table
*/
const rs2_raw_data_buffer* rs2_run_on_chip_calibration_cpp(rs2_device* device, int timeout_ms, const void* json_content, int content_size, float* health, rs2_update_progress_callback* progress_callback, rs2_error** error);

Expand Down
4 changes: 2 additions & 2 deletions include/librealsense2/hpp/rs_device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ return results;
[0.15, 0.25) - Can be Improved
[0.25, ) - Requires Calibration
* \param[in] callback Callback to get progress notifications
* \return Nnew calibration table
* \return New calibration table
*/
template<class T>
std::vector<uint8_t> run_on_chip_calibration(int timeout_ms, std::string json_content, float* health, T callback) const
Expand Down Expand Up @@ -346,7 +346,7 @@ return results;
[0, 0.15) - Good
[0.15, 0.25) - Can be Improved
[0.25, ) - Requires Calibration
* \return Nnew calibration table
* \return New calibration table
*/
std::vector<uint8_t> run_on_chip_calibration(int timeout_ms, std::string json_content, float* health) const
{
Expand Down
2 changes: 2 additions & 0 deletions src/ds5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ target_sources(${LRS_TARGET}
"${CMAKE_CURRENT_LIST_DIR}/advanced_mode/presets.cpp"
"${CMAKE_CURRENT_LIST_DIR}/advanced_mode/advanced_mode.cpp"
"${CMAKE_CURRENT_LIST_DIR}/ds5-auto-calibration.cpp"
"${CMAKE_CURRENT_LIST_DIR}/ds5-wide-fov.cpp"
"${CMAKE_CURRENT_LIST_DIR}/ds5-factory.h"
"${CMAKE_CURRENT_LIST_DIR}/ds5-device.h"
"${CMAKE_CURRENT_LIST_DIR}/ds5-options.h"
Expand All @@ -28,4 +29,5 @@ target_sources(${LRS_TARGET}
"${CMAKE_CURRENT_LIST_DIR}/ds5-fw-update-device.h"
"${CMAKE_CURRENT_LIST_DIR}/advanced_mode/json_loader.hpp"
"${CMAKE_CURRENT_LIST_DIR}/ds5-auto-calibration.h"
"${CMAKE_CURRENT_LIST_DIR}/ds5-wide-fov.h"
)
2 changes: 1 addition & 1 deletion src/ds5/ds5-auto-calibration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ namespace librealsense
return recover_preset;
}

void auto_calibrated::check_params()
void auto_calibrated::check_params() const
{
if (_speed < speed_very_fast || _speed > speed_white_wall)
throw invalid_value_exception(to_string() << "Auto calibration failed! Given value of 'speed' " << _speed << " is out of range (0 - 4).");
Expand Down
20 changes: 10 additions & 10 deletions src/ds5/ds5-auto-calibration.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
#include "auto-calibrated-device.h"
#include "../core/advanced_mode.h"

const int DEFUALT_AVERAGE_STEP_COUNT = 20;
const int DEFUALT_STEP_COUNT = 10;
const int DEFUALT_ACCURACY = 2;
const int DEFUALT_SPEED = 3;
const int DEFAULT_AVERAGE_STEP_COUNT = 20;
const int DEFAULT_STEP_COUNT = 10;
const int DEFAULT_ACCURACY = 2;
const int DEFAULT_SPEED = 3;


namespace librealsense
Expand Down Expand Up @@ -57,7 +57,7 @@ namespace librealsense
RS2_DSC_STATUS_NO_DEPTH_AVERAGE = 7
};

enum speed
enum auto_calib_speed
{
speed_very_fast = 0,
speed_fast = 1,
Expand Down Expand Up @@ -104,15 +104,15 @@ namespace librealsense
void handle_calibration_error(rs2_dsc_status status) const;
std::map<std::string, int> parse_json(std::string json);
std::shared_ptr< ds5_advanced_mode_base> change_preset();
void check_params();
void check_params() const;

std::vector<uint8_t> _curr_calibration;
std::shared_ptr<hw_monitor>& _hw_monitor;

int _average_step_count = DEFUALT_AVERAGE_STEP_COUNT;
int _step_count = DEFUALT_STEP_COUNT;
int _accuracy = DEFUALT_ACCURACY;
int _speed = DEFUALT_SPEED;
int _average_step_count = DEFAULT_AVERAGE_STEP_COUNT;
int _step_count = DEFAULT_STEP_COUNT;
int _accuracy = DEFAULT_ACCURACY;
int _speed = DEFAULT_SPEED;
};

}
15 changes: 15 additions & 0 deletions src/ds5/ds5-color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,21 @@ namespace librealsense
auto color_ep = create_color_device(ctx, color_devs_info);
}

std::vector<tagged_profile> ds5_color::get_profiles_tags() const
{
std::vector<tagged_profile> tags;
auto usb_spec = get_usb_spec();
if (usb_spec >= platform::usb3_type || usb_spec == platform::usb_undefined)
{
tags.push_back({ RS2_STREAM_COLOR, -1, 640, 480, RS2_FORMAT_RGB8, 30, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT });
}
else
{
tags.push_back({ RS2_STREAM_COLOR, -1, 640, 480, RS2_FORMAT_RGB8, 15, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT });
}
return tags;
}

std::shared_ptr<synthetic_sensor> ds5_color::create_color_device(std::shared_ptr<context> ctx,
const std::vector<platform::uvc_device_info>& color_devices_info)
{
Expand Down
1 change: 1 addition & 0 deletions src/ds5/ds5-color.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace librealsense
protected:
std::shared_ptr<stream_interface> _color_stream;

std::vector<tagged_profile> get_profiles_tags() const override;
private:
friend class ds5_color_sensor;
friend class rs435i_device;
Expand Down
Loading

0 comments on commit 6246970

Please sign in to comment.