mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-04 12:07:46 +08:00
refactor: improve logging for host time synchronization in OBCameraNodeDriver
This commit is contained in:
@@ -981,7 +981,6 @@ void OBCameraNodeDriver::initializeDevice(const std::shared_ptr<ob::Device> &dev
|
|||||||
if (enable_sync_host_time_ && !isOpenNIDevice(device_info_->pid()) && device_type_ == "camera") {
|
if (enable_sync_host_time_ && !isOpenNIDevice(device_info_->pid()) && device_type_ == "camera") {
|
||||||
TRY_EXECUTE_BLOCK(device_->timerSyncWithHost());
|
TRY_EXECUTE_BLOCK(device_->timerSyncWithHost());
|
||||||
if (g_time_domain != "global") {
|
if (g_time_domain != "global") {
|
||||||
RCLCPP_INFO_STREAM(logger_, "Enable periodic host time sync with device");
|
|
||||||
device_->enableGlobalTimestamp(false);
|
device_->enableGlobalTimestamp(false);
|
||||||
sync_host_time_timer_ = this->create_wall_timer(time_sync_period_, [this]() {
|
sync_host_time_timer_ = this->create_wall_timer(time_sync_period_, [this]() {
|
||||||
// Multiple safety checks before attempting time sync
|
// Multiple safety checks before attempting time sync
|
||||||
@@ -1029,9 +1028,10 @@ void OBCameraNodeDriver::initializeDevice(const std::shared_ptr<ob::Device> &dev
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RCLCPP_INFO_STREAM(logger_, "Sync device time with host");
|
|
||||||
TRY_EXECUTE_BLOCK(device_->timerSyncWithHost());
|
TRY_EXECUTE_BLOCK(device_->timerSyncWithHost());
|
||||||
});
|
});
|
||||||
|
RCLCPP_INFO_STREAM(logger_, "Enabled timer sync with host with period "
|
||||||
|
<< time_sync_period_.count() << " ms");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user