mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-08 22:07:46 +08:00
Merge branch 'fix/main-bug' into merge/sdk_1.10.36
This commit is contained in:
@@ -151,6 +151,8 @@ rmw_qos_profile_t getRMWQosProfileFromString(const std::string& str_qos);
|
||||
|
||||
bool isOpenNIDevice(int pid);
|
||||
|
||||
bool isHostTimeSyncSupported(int pid);
|
||||
|
||||
OB_DEPTH_PRECISION_LEVEL depthPrecisionLevelFromString(
|
||||
const std::string& depth_precision_level_str);
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ def generate_launch_description():
|
||||
DeclareLaunchArgument('ir_height', default_value='480'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='false'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
|
||||
@@ -435,7 +435,7 @@ void OBCameraNodeDriver::initializeDevice(const std::shared_ptr<ob::Device> &dev
|
||||
serial_number_ = device_info_->serialNumber();
|
||||
CHECK_NOTNULL(device_info_.get());
|
||||
device_unique_id_ = device_info_->uid();
|
||||
if (enable_sync_host_time_ && !isOpenNIDevice(device_info_->pid())) {
|
||||
if (enable_sync_host_time_ && isHostTimeSyncSupported(device_info_->pid())) {
|
||||
TRY_EXECUTE_BLOCK(device_->timerSyncWithHost());
|
||||
sync_host_time_timer_ = this->create_wall_timer(std::chrono::milliseconds(30000), [this]() {
|
||||
if (device_) {
|
||||
|
||||
@@ -471,6 +471,16 @@ bool isOpenNIDevice(int pid) {
|
||||
[pid](int pid_openni) { return pid == pid_openni; });
|
||||
}
|
||||
|
||||
bool isHostTimeSyncSupported(int pid) {
|
||||
static const std::vector<int> UNSUPPORTED_DEVICE_PIDS = {0x069d};
|
||||
|
||||
if (isOpenNIDevice(pid)) {
|
||||
return false;
|
||||
}
|
||||
return std::none_of(UNSUPPORTED_DEVICE_PIDS.begin(), UNSUPPORTED_DEVICE_PIDS.end(),
|
||||
[pid](int unsupported_pid) { return pid == unsupported_pid; });
|
||||
}
|
||||
|
||||
OB_DEPTH_PRECISION_LEVEL depthPrecisionLevelFromString(
|
||||
const std::string &depth_precision_level_str) {
|
||||
if (depth_precision_level_str == "1mm") {
|
||||
|
||||
Reference in New Issue
Block a user