Merge branch 'fix/sync_host_time' into merge/sdk_2.8.1

This commit is contained in:
ob-yalian
2026-04-02 16:16:16 +08:00
+3 -1
View File
@@ -981,6 +981,7 @@ void OBCameraNodeDriver::initializeDevice(const std::shared_ptr<ob::Device> &dev
if (enable_sync_host_time_ && !isOpenNIDevice(device_info_->pid()) && device_type_ == "camera") {
TRY_EXECUTE_BLOCK(device_->timerSyncWithHost());
if (g_time_domain != "global") {
device_->enableGlobalTimestamp(false);
sync_host_time_timer_ = this->create_wall_timer(time_sync_period_, [this]() {
// Multiple safety checks before attempting time sync
if (!device_) {
@@ -1027,9 +1028,10 @@ void OBCameraNodeDriver::initializeDevice(const std::shared_ptr<ob::Device> &dev
return;
}
RCLCPP_INFO_STREAM(logger_, "Sync device time with host");
TRY_EXECUTE_BLOCK(device_->timerSyncWithHost());
});
RCLCPP_INFO_STREAM(logger_, "Enabled timer sync with host with period "
<< time_sync_period_.count() << " ms");
}
}