mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-05 20:47:46 +08:00
fix: rename delay_stream_start_after_reboot to delay_stream_start_after_reconnect
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
std::string g_camera_name = "orbbec_camera"; // Assuming this is declared elsewhere
|
||||
std::string g_time_domain = "global"; // Assuming this is declared elsewhere
|
||||
namespace {
|
||||
constexpr auto kStreamStartDelayAfterReboot = std::chrono::seconds(5);
|
||||
constexpr auto kStreamStartDelayAfterReconnect = std::chrono::seconds(5);
|
||||
|
||||
std::string getLogDirectoryForCamera(const std::string &camera_name) {
|
||||
const char *log_dir_override = std::getenv("ORBBEC_LOG_DIR");
|
||||
@@ -477,6 +477,7 @@ void OBCameraNodeDriver::onDeviceDisconnected(const std::shared_ptr<ob::DeviceLi
|
||||
if (uid == device_unique_id_ || serial_number_ == serial_number) {
|
||||
RCLCPP_INFO_STREAM(logger_,
|
||||
"device with " << uid << " disconnected, notify reset device thread");
|
||||
delay_stream_start_after_reconnect_ = true;
|
||||
reset_device_flag_ = true;
|
||||
reset_device_cond_.notify_all();
|
||||
break;
|
||||
@@ -907,7 +908,7 @@ void OBCameraNodeDriver::rebootDeviceCallback(
|
||||
} else {
|
||||
std::string current_device_uid = device_unique_id_;
|
||||
RCLCPP_INFO_STREAM(logger_, "Rebooting device with UID: " << current_device_uid);
|
||||
delay_stream_start_after_reboot_ = true;
|
||||
delay_stream_start_after_reconnect_ = true;
|
||||
if (ob_lidar_node_) {
|
||||
ob_lidar_node_->rebootDevice();
|
||||
} else if (ob_camera_node_) {
|
||||
@@ -1332,10 +1333,10 @@ void OBCameraNodeDriver::initializeDevice(const std::shared_ptr<ob::Device> &dev
|
||||
}
|
||||
}
|
||||
|
||||
const bool should_delay_stream_start = delay_stream_start_after_reboot_.exchange(false) &&
|
||||
const bool should_delay_stream_start = delay_stream_start_after_reconnect_.exchange(false) &&
|
||||
isGemini305SeriesPID(device_info_->getPid());
|
||||
if (should_delay_stream_start) {
|
||||
std::this_thread::sleep_for(kStreamStartDelayAfterReboot);
|
||||
std::this_thread::sleep_for(kStreamStartDelayAfterReconnect);
|
||||
}
|
||||
|
||||
if (ob_camera_node_) {
|
||||
@@ -1748,7 +1749,7 @@ void OBCameraNodeDriver::firmwareUpdateCallback(OBFwUpdateState state, const cha
|
||||
RCLCPP_WARN_STREAM(logger_, "Exception during sync timer cleanup in firmware update");
|
||||
}
|
||||
}
|
||||
delay_stream_start_after_reboot_ = true;
|
||||
delay_stream_start_after_reconnect_ = true;
|
||||
device_->reboot();
|
||||
} else if (ob_lidar_node_) {
|
||||
ob_lidar_node_.reset();
|
||||
|
||||
Reference in New Issue
Block a user