From 37b98e0d33c8fb4dde7f4d8fc503e9d7a35d57e9 Mon Sep 17 00:00:00 2001 From: Osenberg Date: Wed, 7 Aug 2019 18:42:37 +0800 Subject: [PATCH] feat(src): added S200B device support --- include/mynteye/types.h | 5 ++ samples/tutorials/control/auto_exposure.cc | 5 +- samples/tutorials/control/framerate.cc | 5 +- .../tutorials/control/imu_low_pass_filter.cc | 5 +- samples/tutorials/control/imu_range.cc | 5 +- samples/tutorials/control/infrared.cc | 9 ++-- samples/tutorials/control/manual_exposure.cc | 5 +- src/mynteye/api/api.cc | 10 ---- src/mynteye/device/channel/channels.cc | 44 +++++++++++++++ src/mynteye/device/channel/channels.h | 2 + src/mynteye/device/config.cc | 28 ++++++++-- src/mynteye/device/device.cc | 21 ++++++-- src/mynteye/device/standard2/device_s2.cc | 3 +- .../device/standard2/streams_adapter_s2.cc | 1 + src/mynteye/types.cc | 2 + test/types_test.cc | 1 + .../src/main/cpp/mynteye/cpp/model.hpp | 2 + .../src/main/cpp/mynteye/cpp/option.hpp | 2 + .../main/cpp/mynteye/impl/type_conversion.hpp | 2 + .../java/com/slightech/mynteye/Model.java | 2 + .../mynteye/scripts/mynteye_types.djinni | 2 + .../config/device/standard2.yaml | 44 ++++++++++++++- .../config/sub/device_1/standard2.yaml | 54 ++++++++++++++++--- .../config/sub/device_2/standard2.yaml | 54 ++++++++++++++++--- .../src/wrapper_nodelet.cc | 28 ++++++++-- 25 files changed, 289 insertions(+), 52 deletions(-) diff --git a/include/mynteye/types.h b/include/mynteye/types.h index f4448a4..e22b838 100644 --- a/include/mynteye/types.h +++ b/include/mynteye/types.h @@ -44,6 +44,8 @@ enum class Model : std::uint8_t { STANDARD2, /** Standard 210a */ STANDARD210A, + /** Standard 200b */ + STANDARD200B, /** Last guard */ LAST }; @@ -273,6 +275,9 @@ enum class Option : std::uint8_t { /** Erase chip */ ERASE_CHIP, + /** Sync timestamp */ + SYNC_TIMESTAMP, + /** Last guard */ LAST }; diff --git a/samples/tutorials/control/auto_exposure.cc b/samples/tutorials/control/auto_exposure.cc index cabe6ad..4e23030 100644 --- a/samples/tutorials/control/auto_exposure.cc +++ b/samples/tutorials/control/auto_exposure.cc @@ -58,8 +58,9 @@ int main(int argc, char *argv[]) { << api->GetOptionValue(Option::DESIRED_BRIGHTNESS); } - // Set auto exposure options fo S2000/S2100/S210A - if (model == Model::STANDARD2 || model == Model::STANDARD210A) { + // Set auto exposure options fo S2000/S2100/S210A/S200B + if (model == Model::STANDARD2 || + model == Model::STANDARD210A || model == Model::STANDARD200B) { // auto-exposure: 0 api->SetOptionValue(Option::EXPOSURE_MODE, 0); diff --git a/samples/tutorials/control/framerate.cc b/samples/tutorials/control/framerate.cc index 41f1e5d..39106ab 100644 --- a/samples/tutorials/control/framerate.cc +++ b/samples/tutorials/control/framerate.cc @@ -45,8 +45,9 @@ int main(int argc, char *argv[]) { << api->GetOptionValue(Option::IMU_FREQUENCY); } - // You should set frame rate for S2000/S2100/S210A by 'SelectStreamRequest()' - if (model == Model::STANDARD2 || model == Model::STANDARD210A) { + // You should set frame rate for S2000/S2100/S210A/S200B by 'SelectStreamRequest()' + if (model == Model::STANDARD2 || + model == Model::STANDARD210A || model == Model::STANDARD200B) { LOG(INFO) << "Please set frame rate by 'SelectStreamRequest()'"; } diff --git a/samples/tutorials/control/imu_low_pass_filter.cc b/samples/tutorials/control/imu_low_pass_filter.cc index 88e71b8..b9c2463 100644 --- a/samples/tutorials/control/imu_low_pass_filter.cc +++ b/samples/tutorials/control/imu_low_pass_filter.cc @@ -38,8 +38,9 @@ int main(int argc, char *argv[]) { return 0; } - // Set imu low pass filter for S2000/S2100/S210A - if (model == Model::STANDARD2 || model == Model::STANDARD210A) { + // Set imu low pass filter for S2000/S2100/S210A/S200B + if (model == Model::STANDARD2 || + model == Model::STANDARD210A || model == Model::STANDARD200B) { // ACCELEROMETER_RANGE values: 0, 1, 2 api->SetOptionValue(Option::ACCELEROMETER_LOW_PASS_FILTER, 2); // GYROSCOPE_RANGE values: 23, 64 diff --git a/samples/tutorials/control/imu_range.cc b/samples/tutorials/control/imu_range.cc index 7fe6783..1a0292c 100644 --- a/samples/tutorials/control/imu_range.cc +++ b/samples/tutorials/control/imu_range.cc @@ -40,8 +40,9 @@ int main(int argc, char *argv[]) { api->SetOptionValue(Option::GYROSCOPE_RANGE, 1000); } - // Set imu range for S2000/S2100/S210A - if (model == Model::STANDARD2 || model == Model::STANDARD210A) { + // Set imu range for S2000/S2100/S210A/S200B + if (model == Model::STANDARD2 || + model == Model::STANDARD210A || model == Model::STANDARD200B) { // ACCELEROMETER_RANGE values: 6, 12, 24, 48 api->SetOptionValue(Option::ACCELEROMETER_RANGE, 6); // GYROSCOPE_RANGE values: 250, 500, 1000, 2000, 4000 diff --git a/samples/tutorials/control/infrared.cc b/samples/tutorials/control/infrared.cc index c261e7a..99489f3 100644 --- a/samples/tutorials/control/infrared.cc +++ b/samples/tutorials/control/infrared.cc @@ -29,7 +29,7 @@ int main(int argc, char *argv[]) { Model model = api->GetModel(); - if (model == Model::STANDARD || model == Model::STANDARD2) { + if (model == Model::STANDARD) { // ir control: range [0,160], default 0 api->SetOptionValue(Option::IR_CONTROL, 80); @@ -37,9 +37,10 @@ int main(int argc, char *argv[]) { << api->GetOptionValue(Option::IR_CONTROL); } - // MYNTEYE-S210A don't support this option - if (model == Model::STANDARD210A) { - LOG(INFO) << "Sorry,MYNTEYE-S210A don't support ir control"; + // MYNTEYE-S210A S2000 S200B don't support this option + if (model == Model::STANDARD210A || + model == Model::STANDARD2 || model == Model::STANDARD200B) { + LOG(INFO) << "Sorry, MYNTEYE-S210A S2000 S200B don't support ir control"; return 0; } diff --git a/samples/tutorials/control/manual_exposure.cc b/samples/tutorials/control/manual_exposure.cc index e6e352c..d196719 100644 --- a/samples/tutorials/control/manual_exposure.cc +++ b/samples/tutorials/control/manual_exposure.cc @@ -54,8 +54,9 @@ int main(int argc, char *argv[]) { LOG(INFO) << "Set CONTRAST to " << api->GetOptionValue(Option::CONTRAST); } - // Set manual exposure options fo S2000/S2100/S210A - if (model == Model::STANDARD2 || model == Model::STANDARD210A) { + // Set manual exposure options fo S2000/S2100/S210A/S200B + if (model == Model::STANDARD2 || + model == Model::STANDARD210A || model == Model::STANDARD200B) { // manual-exposure: 1 api->SetOptionValue(Option::EXPOSURE_MODE, 1); diff --git a/src/mynteye/api/api.cc b/src/mynteye/api/api.cc index 5ff6dec..e69dec9 100644 --- a/src/mynteye/api/api.cc +++ b/src/mynteye/api/api.cc @@ -592,16 +592,6 @@ bool API::ConfigDisparityFromFile(const std::string& config_file) { bool API::IsDefaultIntrinsics() { if (device_ != nullptr) { return device_->CheckImageParams(); - if (device_->CheckImageParams()) { - LOG(WARNING) << "Default intrinsics are currently being used."; - LOG(FATAL) << "Image params not found, but we need it to process the " - "images. Please `make tools` and use `img_params_writer` " - "to write the image params. If you update the SDK from " - "1.x, the `SN*.conf` is the file contains them. Besides, " - "you could also calibrate them by yourself. Read the guide " - "doc (https://github.com/slightech/MYNT-EYE-SDK-2-Guide) " - "to learn more."; - } } return false; diff --git a/src/mynteye/device/channel/channels.cc b/src/mynteye/device/channel/channels.cc index 2dc47da..09cccc4 100644 --- a/src/mynteye/device/channel/channels.cc +++ b/src/mynteye/device/channel/channels.cc @@ -96,6 +96,9 @@ int XuHalfDuplexId(Option option) { case Option::ERASE_CHIP: return 1; break; + case Option::SYNC_TIMESTAMP: + return 2; + break; default: LOG(FATAL) << "No half duplex id for " << option; } @@ -206,6 +209,9 @@ std::int32_t Channels::GetControlValue(const Option &option) const { case Option::ERASE_CHIP: LOG(WARNING) << option << " get value useless"; return -1; + case Option::SYNC_TIMESTAMP: + LOG(WARNING) << option << " get value useless"; + return -1; default: LOG(ERROR) << "Unsupported option " << option; } @@ -292,11 +298,49 @@ void Channels::SetControlValue(const Option &option, std::int32_t value) { case Option::ERASE_CHIP: LOG(WARNING) << option << " set value useless"; break; + case Option::SYNC_TIMESTAMP: + XuCamCtrlSet(option, value); + break; default: LOG(ERROR) << "Unsupported option " << option; } } +bool Channels::SetControlValue(const Option &option, std::uint64_t value) { + switch (option) { + case Option::GAIN: + case Option::BRIGHTNESS: + case Option::CONTRAST: + case Option::FRAME_RATE: + case Option::IMU_FREQUENCY: + case Option::ACCELEROMETER_RANGE: + case Option::GYROSCOPE_RANGE: + case Option::ACCELEROMETER_LOW_PASS_FILTER: + case Option::GYROSCOPE_LOW_PASS_FILTER: + case Option::EXPOSURE_MODE: + case Option::MAX_GAIN: + case Option::MAX_EXPOSURE_TIME: + case Option::DESIRED_BRIGHTNESS: + case Option::IR_CONTROL: + case Option::HDR_MODE: + case Option::MIN_EXPOSURE_TIME: + case Option::IIC_ADDRESS_SETTING: + case Option::ZERO_DRIFT_CALIBRATION: + LOG(WARNING) << option << " refer to function SetControlValue(const Option &option, std::int32_t value)"; + break; + case Option::ERASE_CHIP: + LOG(WARNING) << option << " set value useless"; + break; + case Option::SYNC_TIMESTAMP: + return XuHalfDuplexSet(option, XU_SYNC_TIMESTAMP); + break; + default: + LOG(ERROR) << "Unsupported option " << option; + } + + return false; +} + bool Channels::RunControlAction(const Option &option) const { switch (option) { case Option::ZERO_DRIFT_CALIBRATION: diff --git a/src/mynteye/device/channel/channels.h b/src/mynteye/device/channel/channels.h index 9393f1a..bbe5acb 100644 --- a/src/mynteye/device/channel/channels.h +++ b/src/mynteye/device/channel/channels.h @@ -50,6 +50,7 @@ class MYNTEYE_API Channels { typedef enum XuCmd { XU_CMD_ZDC = 0xE6, // zero drift calibration XU_CMD_ERASE = 0xDE, // erase chip + XU_SYNC_TIMESTAMP = 0x200, // sync timestamp XU_CMD_LAST } xu_cmd_t; @@ -72,6 +73,7 @@ class MYNTEYE_API Channels { std::int32_t GetControlValue(const Option &option) const; void SetControlValue(const Option &option, std::int32_t value); + bool SetControlValue(const Option &option, std::uint64_t value); bool RunControlAction(const Option &option) const; diff --git a/src/mynteye/device/config.cc b/src/mynteye/device/config.cc index c92cf8b..9ccc8aa 100644 --- a/src/mynteye/device/config.cc +++ b/src/mynteye/device/config.cc @@ -18,13 +18,15 @@ MYNTEYE_BEGIN_NAMESPACE const std::map stream_supports_map = { {Model::STANDARD, {Stream::LEFT, Stream::RIGHT}}, {Model::STANDARD2, {Stream::LEFT, Stream::RIGHT}}, - {Model::STANDARD210A, {Stream::LEFT, Stream::RIGHT}} + {Model::STANDARD210A, {Stream::LEFT, Stream::RIGHT}}, + {Model::STANDARD200B, {Stream::LEFT, Stream::RIGHT}}, }; const std::map capabilities_supports_map = { {Model::STANDARD, {Capabilities::STEREO, Capabilities::IMU}}, {Model::STANDARD2, {Capabilities::STEREO_COLOR, Capabilities::IMU}}, - {Model::STANDARD210A, {Capabilities::STEREO_COLOR, Capabilities::IMU}} + {Model::STANDARD210A, {Capabilities::STEREO_COLOR, Capabilities::IMU}}, + {Model::STANDARD200B, {Capabilities::STEREO_COLOR, Capabilities::IMU}} }; const std::map option_supports_map = { @@ -54,7 +56,14 @@ const std::map option_supports_map = { Option::ACCELEROMETER_RANGE, Option::GYROSCOPE_RANGE, Option::ACCELEROMETER_LOW_PASS_FILTER, Option::GYROSCOPE_LOW_PASS_FILTER, Option::IIC_ADDRESS_SETTING, Option::ERASE_CHIP} - } + }, + {Model::STANDARD200B, { + Option::BRIGHTNESS, + Option::EXPOSURE_MODE, Option::MAX_GAIN, Option::MAX_EXPOSURE_TIME, + Option::MIN_EXPOSURE_TIME, Option::DESIRED_BRIGHTNESS, Option::ACCELEROMETER_RANGE, + Option::GYROSCOPE_RANGE, Option::ACCELEROMETER_LOW_PASS_FILTER, + Option::GYROSCOPE_LOW_PASS_FILTER, Option::ERASE_CHIP, Option::SYNC_TIMESTAMP} + }, }; const std::map> @@ -86,7 +95,18 @@ stream_requests_map = { {2560, 800, Format::BGR888, 20}, {2560, 800, Format::BGR888, 30}} }} - } + }, + {Model::STANDARD200B, + {{Capabilities::STEREO_COLOR, { + {1280, 400, Format::YUYV, 10}, + {1280, 400, Format::YUYV, 20}, + {1280, 400, Format::YUYV, 30}, + {1280, 400, Format::YUYV, 60}, + {2560, 800, Format::YUYV, 10}, + {2560, 800, Format::YUYV, 20}, + {2560, 800, Format::YUYV, 30}} + }} + }, }; /** diff --git a/src/mynteye/device/device.cc b/src/mynteye/device/device.cc index fba88ef..73cb39d 100644 --- a/src/mynteye/device/device.cc +++ b/src/mynteye/device/device.cc @@ -111,12 +111,23 @@ std::shared_ptr Device::Create( if (model.generation == '1') { return std::make_shared(device); } else if (model.generation == '2') { - if (model.custom_code == '0') { - return std::make_shared(Model::STANDARD2, device); - } else if (model.custom_code == 'A') { - return std::make_shared(Model::STANDARD210A, device); + if (model.baseline_code == '1') { + if (model.custom_code == '0') { + return std::make_shared(Model::STANDARD2, device); + } else if (model.custom_code == 'A') { + return std::make_shared( + Model::STANDARD210A, device); + } else { + LOG(FATAL) << "No such custom code now"; + } + } else if (model.baseline_code == '0') { + if (model.custom_code == 'B') { + return std::make_shared(Model::STANDARD200B, device); + } else { + LOG(FATAL) << "No such custom code now"; + } } else { - LOG(FATAL) << "No such custom code now"; + LOG(FATAL) << "No such baseline now"; } } else { LOG(FATAL) << "No such generation now"; diff --git a/src/mynteye/device/standard2/device_s2.cc b/src/mynteye/device/standard2/device_s2.cc index 050cd4c..19463d1 100644 --- a/src/mynteye/device/standard2/device_s2.cc +++ b/src/mynteye/device/standard2/device_s2.cc @@ -26,7 +26,8 @@ Standard2Device::Standard2Device(const Model &model, std::make_shared(model), std::make_shared(model)) { VLOG(2) << __func__; - CHECK(model == Model::STANDARD2 || model == Model::STANDARD210A); + CHECK(model == Model::STANDARD2 || model == Model::STANDARD210A || + model == Model::STANDARD200B); } Standard2Device::~Standard2Device() { diff --git a/src/mynteye/device/standard2/streams_adapter_s2.cc b/src/mynteye/device/standard2/streams_adapter_s2.cc index c33b179..69ccc63 100644 --- a/src/mynteye/device/standard2/streams_adapter_s2.cc +++ b/src/mynteye/device/standard2/streams_adapter_s2.cc @@ -227,6 +227,7 @@ Standard2StreamsAdapter::GetUnpackImgPixelsMap() { {Stream::RIGHT, s210a::unpack_right_img_pixels} }; case Model::STANDARD2: + case Model::STANDARD200B: default: return { {Stream::LEFT, unpack_left_img_pixels}, diff --git a/src/mynteye/types.cc b/src/mynteye/types.cc index 9493373..1d82b02 100644 --- a/src/mynteye/types.cc +++ b/src/mynteye/types.cc @@ -31,6 +31,7 @@ const char *to_string(const Model &value) { CASE(STANDARD) CASE(STANDARD2) CASE(STANDARD210A) + CASE(STANDARD200B) default: CHECK(is_valid(value)); return "Model::UNKNOWN"; @@ -125,6 +126,7 @@ const char *to_string(const Option &value) { CASE(IIC_ADDRESS_SETTING) CASE(ZERO_DRIFT_CALIBRATION) CASE(ERASE_CHIP) + CASE(SYNC_TIMESTAMP) default: CHECK(is_valid(value)); return "Option::UNKNOWN"; diff --git a/test/types_test.cc b/test/types_test.cc index 28a292c..bf822ed 100644 --- a/test/types_test.cc +++ b/test/types_test.cc @@ -75,6 +75,7 @@ TEST(Option, VerifyToString) { "Option::ZERO_DRIFT_CALIBRATION", to_string(Option::ZERO_DRIFT_CALIBRATION)); EXPECT_STREQ("Option::ERASE_CHIP", to_string(Option::ERASE_CHIP)); + EXPECT_STREQ("Option::SYNC_TIMESTAMP", to_string(Option::SYNC_TIMESTAMP)); } TEST(Source, VerifyToString) { diff --git a/wrappers/android/mynteye/libmynteye/src/main/cpp/mynteye/cpp/model.hpp b/wrappers/android/mynteye/libmynteye/src/main/cpp/mynteye/cpp/model.hpp index 6404632..994fe17 100644 --- a/wrappers/android/mynteye/libmynteye/src/main/cpp/mynteye/cpp/model.hpp +++ b/wrappers/android/mynteye/libmynteye/src/main/cpp/mynteye/cpp/model.hpp @@ -14,6 +14,8 @@ enum class Model : int { STANDARD2, /** Standard 210a */ STANDARD210A, + /** Standard 200b */ + STANDARD200B, }; } // namespace mynteye_jni diff --git a/wrappers/android/mynteye/libmynteye/src/main/cpp/mynteye/cpp/option.hpp b/wrappers/android/mynteye/libmynteye/src/main/cpp/mynteye/cpp/option.hpp index 413ac8a..f21a87a 100644 --- a/wrappers/android/mynteye/libmynteye/src/main/cpp/mynteye/cpp/option.hpp +++ b/wrappers/android/mynteye/libmynteye/src/main/cpp/mynteye/cpp/option.hpp @@ -104,6 +104,8 @@ enum class Option : int { ZERO_DRIFT_CALIBRATION, /** Erase chip */ ERASE_CHIP, + /** Sync timestamp */ + SYNC_TIMESTAMP, }; } // namespace mynteye_jni diff --git a/wrappers/android/mynteye/libmynteye/src/main/cpp/mynteye/impl/type_conversion.hpp b/wrappers/android/mynteye/libmynteye/src/main/cpp/mynteye/impl/type_conversion.hpp index 37a8891..9aa9286 100644 --- a/wrappers/android/mynteye/libmynteye/src/main/cpp/mynteye/impl/type_conversion.hpp +++ b/wrappers/android/mynteye/libmynteye/src/main/cpp/mynteye/impl/type_conversion.hpp @@ -64,6 +64,7 @@ RawModel from_jni(const JniModel& model) { case JniModel::STANDARD: return RawModel::STANDARD; case JniModel::STANDARD2: return RawModel::STANDARD2; case JniModel::STANDARD210A: return RawModel::STANDARD210A; + case JniModel::STANDARD200B: return RawModel::STANDARD200B; default: LOG(FATAL) << "Model is unknown"; } @@ -75,6 +76,7 @@ JniModel to_jni(const RawModel& model) { case RawModel::STANDARD: return JniModel::STANDARD; case RawModel::STANDARD2: return JniModel::STANDARD2; case RawModel::STANDARD210A: return JniModel::STANDARD210A; + case RawModel::STANDARD200B: return JniModel::STANDARD200B; default: LOG(FATAL) << "Model is unknown"; } diff --git a/wrappers/android/mynteye/libmynteye/src/main/java/com/slightech/mynteye/Model.java b/wrappers/android/mynteye/libmynteye/src/main/java/com/slightech/mynteye/Model.java index 2124342..deca45d 100644 --- a/wrappers/android/mynteye/libmynteye/src/main/java/com/slightech/mynteye/Model.java +++ b/wrappers/android/mynteye/libmynteye/src/main/java/com/slightech/mynteye/Model.java @@ -14,5 +14,7 @@ public enum Model { STANDARD2, /** Standard 210a */ STANDARD210A, + /** Standard 200b */ + STANDARD200B, ; } diff --git a/wrappers/android/mynteye/scripts/mynteye_types.djinni b/wrappers/android/mynteye/scripts/mynteye_types.djinni index ed30395..9fc3d34 100644 --- a/wrappers/android/mynteye/scripts/mynteye_types.djinni +++ b/wrappers/android/mynteye/scripts/mynteye_types.djinni @@ -27,6 +27,8 @@ model = enum { standard2; # Standard 210a standard210a; + # Standard 200b + standard200B; } # Formats define how each stream can be encoded diff --git a/wrappers/ros/src/mynt_eye_ros_wrapper/config/device/standard2.yaml b/wrappers/ros/src/mynt_eye_ros_wrapper/config/device/standard2.yaml index e4b23b9..e21bf7a 100644 --- a/wrappers/ros/src/mynt_eye_ros_wrapper/config/device/standard2.yaml +++ b/wrappers/ros/src/mynt_eye_ros_wrapper/config/device/standard2.yaml @@ -19,7 +19,7 @@ standard2/request_index: 2 -# MYNTEYE-S2100/S2000/S210A/imu_process_mode range: [0,3] +# MYNTEYE-S2100/S2000/S210A/S200B imu_process_mode range: [0,3] # 0 - none process, 1 - temperature process, 2 - scale and assembly process, 3 - both standard2/imu_process_mode: 2 @@ -110,3 +110,45 @@ standard210a/gyro_low_filter: -1 # standard210a/iic_address_setting range: [0,127] standard210a/iic_address_setting: -1 # standard210a/iic_address_setting: 0x01 + +# device options of standard200b, -1 will not set the value + +# standard200b/brightness range: [1,255] +standard200b/brightness: -1 +# standard200b/brightness: 70 + +# standard200b/exposure_mode, 0: auto-exposure, 1: manual-exposure +standard200b/exposure_mode: -1 +# standard200b/exposure_mode: 0 + +# standard200b/max_gain range: [0,255] +standard200b/max_gain: -1 +# standard200b/max_gain: 8 + +# standard200b/max_exposure_time range: [0,1000] +standard200b/max_exposure_time: -1 +# standard200b/max_exposure_time: 333 + +# standard200b/desired_brightness range: [1,255] +standard200b/desired_brightness: -1 +# standard200b/desired_brightness: 122 + +# standard200b/min_exposure_time range: [0,1000] +standard200b/min_exposure_time: -1 +# standard200b/min_exposure_time: 0 + +# standard200b/accel_range range: [6,48] +standard200b/accel_range: -1 +# standard200b/accel_range: 6 + +# standard200b/gyro_range range: [250,4000] +standard200b/gyro_range: -1 +# standard200b/gyro_range: 1000 + +# standard200b/accel_low_filter range: [0,2] +standard200b/accel_low_filter: -1 +# standard200b/accel_low_filter: 2 + +# standard200b/gyro_low_filter range: [23,64] +standard200b/gyro_low_filter: -1 +# standard200b/gyro_low_filter: 64 \ No newline at end of file diff --git a/wrappers/ros/src/mynt_eye_ros_wrapper/config/sub/device_1/standard2.yaml b/wrappers/ros/src/mynt_eye_ros_wrapper/config/sub/device_1/standard2.yaml index 41f2ab1..e21bf7a 100644 --- a/wrappers/ros/src/mynt_eye_ros_wrapper/config/sub/device_1/standard2.yaml +++ b/wrappers/ros/src/mynt_eye_ros_wrapper/config/sub/device_1/standard2.yaml @@ -19,15 +19,15 @@ standard2/request_index: 2 -# MYNTEYE-S2100/S2000/S210A/imu_process_mode range: [0,3] +# MYNTEYE-S2100/S2000/S210A/S200B imu_process_mode range: [0,3] # 0 - none process, 1 - temperature process, 2 - scale and assembly process, 3 - both -standard2/imu_process_mode: 0 +standard2/imu_process_mode: 2 # device options of standard2, -1 will not set the value -# standard2/brightness range: [0,240] +# standard2/brightness range: [1,255] standard2/brightness: -1 -# standard2/brightness: 120 +# standard2/brightness: 70 # standard2/exposure_mode, 0: auto-exposure, 1: manual-exposure standard2/exposure_mode: -1 @@ -67,9 +67,9 @@ standard2/gyro_low_filter: -1 # device options of standard210a, -1 will not set the value -# standard210a/brightness range: [0,240] +# standard210a/brightness range: [1,255] standard210a/brightness: -1 -# standard210a/brightness: 120 +# standard210a/brightness: 70 # standard210a/exposure_mode, 0: auto-exposure, 1: manual-exposure standard210a/exposure_mode: -1 @@ -110,3 +110,45 @@ standard210a/gyro_low_filter: -1 # standard210a/iic_address_setting range: [0,127] standard210a/iic_address_setting: -1 # standard210a/iic_address_setting: 0x01 + +# device options of standard200b, -1 will not set the value + +# standard200b/brightness range: [1,255] +standard200b/brightness: -1 +# standard200b/brightness: 70 + +# standard200b/exposure_mode, 0: auto-exposure, 1: manual-exposure +standard200b/exposure_mode: -1 +# standard200b/exposure_mode: 0 + +# standard200b/max_gain range: [0,255] +standard200b/max_gain: -1 +# standard200b/max_gain: 8 + +# standard200b/max_exposure_time range: [0,1000] +standard200b/max_exposure_time: -1 +# standard200b/max_exposure_time: 333 + +# standard200b/desired_brightness range: [1,255] +standard200b/desired_brightness: -1 +# standard200b/desired_brightness: 122 + +# standard200b/min_exposure_time range: [0,1000] +standard200b/min_exposure_time: -1 +# standard200b/min_exposure_time: 0 + +# standard200b/accel_range range: [6,48] +standard200b/accel_range: -1 +# standard200b/accel_range: 6 + +# standard200b/gyro_range range: [250,4000] +standard200b/gyro_range: -1 +# standard200b/gyro_range: 1000 + +# standard200b/accel_low_filter range: [0,2] +standard200b/accel_low_filter: -1 +# standard200b/accel_low_filter: 2 + +# standard200b/gyro_low_filter range: [23,64] +standard200b/gyro_low_filter: -1 +# standard200b/gyro_low_filter: 64 \ No newline at end of file diff --git a/wrappers/ros/src/mynt_eye_ros_wrapper/config/sub/device_2/standard2.yaml b/wrappers/ros/src/mynt_eye_ros_wrapper/config/sub/device_2/standard2.yaml index 41f2ab1..e21bf7a 100644 --- a/wrappers/ros/src/mynt_eye_ros_wrapper/config/sub/device_2/standard2.yaml +++ b/wrappers/ros/src/mynt_eye_ros_wrapper/config/sub/device_2/standard2.yaml @@ -19,15 +19,15 @@ standard2/request_index: 2 -# MYNTEYE-S2100/S2000/S210A/imu_process_mode range: [0,3] +# MYNTEYE-S2100/S2000/S210A/S200B imu_process_mode range: [0,3] # 0 - none process, 1 - temperature process, 2 - scale and assembly process, 3 - both -standard2/imu_process_mode: 0 +standard2/imu_process_mode: 2 # device options of standard2, -1 will not set the value -# standard2/brightness range: [0,240] +# standard2/brightness range: [1,255] standard2/brightness: -1 -# standard2/brightness: 120 +# standard2/brightness: 70 # standard2/exposure_mode, 0: auto-exposure, 1: manual-exposure standard2/exposure_mode: -1 @@ -67,9 +67,9 @@ standard2/gyro_low_filter: -1 # device options of standard210a, -1 will not set the value -# standard210a/brightness range: [0,240] +# standard210a/brightness range: [1,255] standard210a/brightness: -1 -# standard210a/brightness: 120 +# standard210a/brightness: 70 # standard210a/exposure_mode, 0: auto-exposure, 1: manual-exposure standard210a/exposure_mode: -1 @@ -110,3 +110,45 @@ standard210a/gyro_low_filter: -1 # standard210a/iic_address_setting range: [0,127] standard210a/iic_address_setting: -1 # standard210a/iic_address_setting: 0x01 + +# device options of standard200b, -1 will not set the value + +# standard200b/brightness range: [1,255] +standard200b/brightness: -1 +# standard200b/brightness: 70 + +# standard200b/exposure_mode, 0: auto-exposure, 1: manual-exposure +standard200b/exposure_mode: -1 +# standard200b/exposure_mode: 0 + +# standard200b/max_gain range: [0,255] +standard200b/max_gain: -1 +# standard200b/max_gain: 8 + +# standard200b/max_exposure_time range: [0,1000] +standard200b/max_exposure_time: -1 +# standard200b/max_exposure_time: 333 + +# standard200b/desired_brightness range: [1,255] +standard200b/desired_brightness: -1 +# standard200b/desired_brightness: 122 + +# standard200b/min_exposure_time range: [0,1000] +standard200b/min_exposure_time: -1 +# standard200b/min_exposure_time: 0 + +# standard200b/accel_range range: [6,48] +standard200b/accel_range: -1 +# standard200b/accel_range: 6 + +# standard200b/gyro_range range: [250,4000] +standard200b/gyro_range: -1 +# standard200b/gyro_range: 1000 + +# standard200b/accel_low_filter range: [0,2] +standard200b/accel_low_filter: -1 +# standard200b/accel_low_filter: 2 + +# standard200b/gyro_low_filter range: [23,64] +standard200b/gyro_low_filter: -1 +# standard200b/gyro_low_filter: 64 \ No newline at end of file diff --git a/wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_nodelet.cc b/wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_nodelet.cc index 059811b..2d93f59 100644 --- a/wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_nodelet.cc +++ b/wrappers/ros/src/mynt_eye_ros_wrapper/src/wrapper_nodelet.cc @@ -305,6 +305,7 @@ class ROSWrapperNodelet : public nodelet::Nodelet { {Option::ACCELEROMETER_LOW_PASS_FILTER, "standard2/accel_low_filter"}, {Option::GYROSCOPE_LOW_PASS_FILTER, "standard2/gyro_low_filter"}}; } + // device options of standard if (model_ == Model::STANDARD) { option_names_ = { @@ -323,6 +324,20 @@ class ROSWrapperNodelet : public nodelet::Nodelet { {Option::GYROSCOPE_RANGE, "standard/gyro_range"}}; } + // device options of standard200b + if (model_ == Model::STANDARD200B) { + option_names_ = { + {Option::BRIGHTNESS, "standard200b/brightness"}, + {Option::EXPOSURE_MODE, "standard200b/exposure_mode"}, + {Option::MAX_GAIN, "standard200b/max_gain"}, + {Option::MAX_EXPOSURE_TIME, "standard200b/max_exposure_time"}, + {Option::DESIRED_BRIGHTNESS, "standard200b/desired_brightness"}, + {Option::MIN_EXPOSURE_TIME, "standard200b/min_exposure_time"}, + {Option::ACCELEROMETER_RANGE, "standard200b/accel_range"}, + {Option::GYROSCOPE_RANGE, "standard200b/gyro_range"}, + {Option::ACCELEROMETER_LOW_PASS_FILTER, "standard200b/accel_low_filter"}, + {Option::GYROSCOPE_LOW_PASS_FILTER, "standard200b/gyro_low_filter"}}; + } for (auto &&it = option_names_.begin(); it != option_names_.end(); ++it) { if (!api_->Supports(it->first)) continue; @@ -349,8 +364,9 @@ class ROSWrapperNodelet : public nodelet::Nodelet { NODELET_INFO_STREAM("Advertized on topic " << topic); } - // Only STANDARD2/STANDARD210A need publish mono_topics - if (model_ == Model::STANDARD2 || model_ == Model::STANDARD210A) { + // Only STANDARD2/STANDARD210A/STANDARD200B need publish mono_topics + if (model_ == Model::STANDARD2 || + model_ == Model::STANDARD210A || model_ == Model::STANDARD200B) { for (auto &&it = mono_topics.begin(); it != mono_topics.end(); ++it) { auto &&topic = mono_topics[it->first]; if (it->first == Stream::LEFT || @@ -365,7 +381,8 @@ class ROSWrapperNodelet : public nodelet::Nodelet { int depth_type = 0; private_nh_.getParamCached("depth_type", depth_type); - if (model_ == Model::STANDARD2 || model_ == Model::STANDARD210A) { + if (model_ == Model::STANDARD2 || + model_ == Model::STANDARD210A || model_ == Model::STANDARD200B) { camera_encodings_ = {{Stream::LEFT, enc::BGR8}, {Stream::RIGHT, enc::BGR8}, {Stream::LEFT_RECTIFIED, enc::BGR8}, @@ -1095,7 +1112,8 @@ class ROSWrapperNodelet : public nodelet::Nodelet { int request_index = 0; model_ = api_->GetModel(); - if (model_ == Model::STANDARD2 || model_ == Model::STANDARD210A) { + if (model_ == Model::STANDARD2 || + model_ == Model::STANDARD210A || model_ == Model::STANDARD200B) { private_nh_.getParamCached("standard2/request_index", request_index); switch (request_index) { case 0: @@ -1122,7 +1140,7 @@ class ROSWrapperNodelet : public nodelet::Nodelet { std::int32_t process_mode = 0; if (model_ == Model::STANDARD2 || - model_ == Model::STANDARD210A) { + model_ == Model::STANDARD210A || model_ == Model::STANDARD200B) { private_nh_.getParamCached("standard2/imu_process_mode", process_mode); api_->EnableProcessMode(process_mode); }