From b4adaf355d5c8ac333cd14b1dcb1c4cec04c930a Mon Sep 17 00:00:00 2001 From: mt-lifan Date: Fri, 31 Oct 2025 15:06:47 +0800 Subject: [PATCH] 1. add config option in control_command.yaml to by-pass strict usb 3.0 check, allow connection even if it is slower than usb 3.0 2. add excute permission for build scripts by default --- README.md | 3 ++- config/control_command.yaml | 35 ++++++++++++++++++----------------- script/build_ros.sh | 0 script/build_ros2.sh | 0 src/host_sdk_sample.cpp | 12 +++++++++++- 5 files changed, 31 insertions(+), 19 deletions(-) mode change 100644 => 100755 script/build_ros.sh mode change 100644 => 100755 script/build_ros2.sh diff --git a/README.md b/README.md index 754d3c0..e9960c2 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ This driver package provides core functionality for point cloud SLAM application ## 1. Version -Current Version: v0.6.0 +Current Version: v0.6.1 ## 2. Preparation @@ -306,6 +306,7 @@ float32 rgb // RGB value |control_command.yaml | Detailed Description | |-----------------------|----------------------| +| strict_usb3.0_check | Strict USB3.0 check, if off, allow connection even if usb connection is below usb 3.0 | | recorddata | Record data in specific format that can be imported into MindCloud(TM) for post-processing. Please be aware that this will consume a lot of storage space. Testing shows 9.5G for 10mins of data. | | devstatuslog | Device status logging, currently save device status (soc temperature, cpu usage, ram usage, dtof sensor temp .etc) and data tx & rx rate to devstatus.csv under log folder. A new file will be created every time the driver is started. | | showcamerapose | Display Camera Pose and Field of View. | diff --git a/config/control_command.yaml b/config/control_command.yaml index 8fa0693..073ea6e 100644 --- a/config/control_command.yaml +++ b/config/control_command.yaml @@ -1,22 +1,23 @@ register_keys: - streamctrl: 1 # 0: off; 1: on - sendrgb: 1 # 0: off; 1: on - sendimu: 1 # 0: off; 1: on - sendodom: 1 # 0: off; 1: on - senddtof: 1 # 0: off; 1: on - sendcloudslam: 1 # 0: off; 1: on - sendcloudrender: 1 # 0: off; 1: on - sendrgbcompressed: 1 # 0: off; 1: on - senddepth: 0 # 0: off; 1: on - sendrgbundistort: 0 # 0: off; 1: on - recorddata: 0 # 0: off; 1: on - devstatuslog: 1 # 0: off; 1: on - pubintensitygray: 0 # 0: off; 1: on - showpath: 0 # 0: off; 1: on - showcamerapose: 0 # 0: off; 1: on + strict_usb3.0_check: 0 # 0: off: 1: on; if off, allow connection even if usb connection is below usb 3.0 + streamctrl: 1 # 0: off; 1: on + sendrgb: 1 # 0: off; 1: on + sendimu: 1 # 0: off; 1: on + sendodom: 1 # 0: off; 1: on + senddtof: 1 # 0: off; 1: on + sendcloudslam: 1 # 0: off; 1: on + sendcloudrender: 1 # 0: off; 1: on + sendrgbcompressed: 1 # 0: off; 1: on + senddepth: 0 # 0: off; 1: on + sendrgbundistort: 0 # 0: off; 1: on + recorddata: 0 # 0: off; 1: on + devstatuslog: 1 # 0: off; 1: on + pubintensitygray: 0 # 0: off; 1: on + showpath: 0 # 0: off; 1: on + showcamerapose: 0 # 0: off; 1: on custom_save_map: 0 - custom_map_mode: 0 # 0: Odometry mode 1: SLAM mode 2: Relocalization mode + custom_map_mode: 0 # 0: Odometry mode 1: SLAM mode 2: Relocalization mode custom_init_pos: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0] - relocalization_map_abs_path: "" # must be set or will fail + relocalization_map_abs_path: "" # must be set for Relocalization mode or will fail mapping_result_dest_dir: "" # "": use default value; other: use custom value mapping_result_file_name: "" # "": use default value; other: use custom value \ No newline at end of file diff --git a/script/build_ros.sh b/script/build_ros.sh old mode 100644 new mode 100755 diff --git a/script/build_ros2.sh b/script/build_ros2.sh old mode 100644 new mode 100755 diff --git a/src/host_sdk_sample.cpp b/src/host_sdk_sample.cpp index e745951..4c0b916 100644 --- a/src/host_sdk_sample.cpp +++ b/src/host_sdk_sample.cpp @@ -45,7 +45,7 @@ limitations under the License. #include #include #endif -#define ros_driver_version "0.6.0" +#define ros_driver_version "0.6.1" // Global variable declarations static device_handle odinDevice = nullptr; static std::atomic deviceConnected(false); @@ -97,6 +97,7 @@ int g_devstatus_log = 0; int g_pub_intensity_gray = 0; int g_show_path = 0; int g_show_camerapose = 0; +int g_strict_usb3_0_check = 0; std::filesystem::path log_root_dir_; int g_custom_map_mode = 0; @@ -502,6 +503,14 @@ bool isUsb3OrHigher(const std::string& vendorId, const std::string& productId) { #else ROS_INFO("Detected USB version: %.1f", version); #endif + if (!g_strict_usb3_0_check) { + #ifdef ROS2 + RCLCPP_INFO(rclcpp::get_logger("usb_check"), "Strict USB3.0 check disabled"); + #else + ROS_INFO("Strict USB3.0 check disabled"); + #endif + return true; + } return version >= 3.0; } @@ -1361,6 +1370,7 @@ int main(int argc, char *argv[]) g_show_path = get_key_value("showpath", 0); g_show_camerapose = get_key_value("showcamerapose", 0); g_log_level = get_key_value("log_devel", LOG_LEVEL_INFO); + g_strict_usb3_0_check = get_key_value("strict_usb3.0_check", 1); auto get_key_str_value = [&](const std::string& key, const std::string& default_value) -> std::string { auto it = keys_w_str_val.find(key);