mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-10 22:49:51 +08:00
fix: remove redundant diagnostic cleanup from stopStreams()
Diagnostic timer/updater lifecycle is now managed exclusively by clean(),
This commit is contained in:
@@ -910,7 +910,7 @@ class OBCameraNode {
|
|||||||
nlohmann::json filter_status_;
|
nlohmann::json filter_status_;
|
||||||
std::string align_mode_ = "HW";
|
std::string align_mode_ = "HW";
|
||||||
std::unique_ptr<diagnostic_updater::Updater> diagnostic_updater_ = nullptr;
|
std::unique_ptr<diagnostic_updater::Updater> diagnostic_updater_ = nullptr;
|
||||||
double diagnostic_period_ = 1.0;
|
double diagnostic_period_ = 0.0;
|
||||||
bool enable_laser_ = false;
|
bool enable_laser_ = false;
|
||||||
std::unique_ptr<ob::Align> align_filter_ = nullptr;
|
std::unique_ptr<ob::Align> align_filter_ = nullptr;
|
||||||
OBStreamType align_target_stream_ = OB_STREAM_COLOR;
|
OBStreamType align_target_stream_ = OB_STREAM_COLOR;
|
||||||
|
|||||||
@@ -3774,19 +3774,6 @@ void OBCameraNode::stopStreams() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop diagnostic timer first to prevent crashes during shutdown
|
|
||||||
try {
|
|
||||||
if (diagnostic_timer_) {
|
|
||||||
diagnostic_timer_->cancel();
|
|
||||||
diagnostic_timer_.reset();
|
|
||||||
}
|
|
||||||
if (diagnostic_updater_) {
|
|
||||||
diagnostic_updater_.reset();
|
|
||||||
}
|
|
||||||
} catch (...) {
|
|
||||||
// Ignore exceptions during diagnostic cleanup
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mark pipeline as stopping to prevent new operations
|
// Mark pipeline as stopping to prevent new operations
|
||||||
pipeline_started_.store(false);
|
pipeline_started_.store(false);
|
||||||
|
|
||||||
@@ -4207,7 +4194,7 @@ void OBCameraNode::getParameters() {
|
|||||||
setAndGetNodeParameter<std::string>(align_mode_, "align_mode", "HW");
|
setAndGetNodeParameter<std::string>(align_mode_, "align_mode", "HW");
|
||||||
align_mode_ =
|
align_mode_ =
|
||||||
normalizeClosedSetParameterValue(logger_, "align_mode", align_mode_, {"HW", "SW"}, "HW");
|
normalizeClosedSetParameterValue(logger_, "align_mode", align_mode_, {"HW", "SW"}, "HW");
|
||||||
setAndGetNodeParameter<double>(diagnostic_period_, "diagnostic_period", 1.0);
|
setAndGetNodeParameter<double>(diagnostic_period_, "diagnostic_period", 0.0);
|
||||||
setAndGetNodeParameter<bool>(enable_laser_, "enable_laser", true);
|
setAndGetNodeParameter<bool>(enable_laser_, "enable_laser", true);
|
||||||
std::string align_target_stream_str_;
|
std::string align_target_stream_str_;
|
||||||
setAndGetNodeParameter<std::string>(align_target_stream_str_, "align_target_stream", "COLOR");
|
setAndGetNodeParameter<std::string>(align_target_stream_str_, "align_target_stream", "COLOR");
|
||||||
|
|||||||
Reference in New Issue
Block a user