feat: add delay before stopping streams

This commit is contained in:
slz
2026-08-20 16:35:33 +08:00
parent 6a44bb965e
commit e8bd3687ae
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -3746,6 +3746,8 @@ bool OBCameraNode::applyStreamProfiles(const std::vector<PendingStreamProfile> &
const bool interleave_frame_enable = interleave_frame_enable_;
if (restart_pipeline) {
stopStreams();
RCLCPP_DEBUG_STREAM(logger_, "Wait 1 second for streams to stop before applying profiles");
std::this_thread::sleep_for(std::chrono::seconds(1));
interleave_frame_enable_ = interleave_frame_enable;
}
stopColorFrameThreads();
+2
View File
@@ -1941,6 +1941,8 @@ bool OBCameraNode::toggleSensor(const stream_index_pair& stream_index, bool enab
std::lock_guard<decltype(device_lock_)> lock(device_lock_);
try {
pipeline_->stop();
RCLCPP_DEBUG_STREAM(logger_, "Wait 1 second for streams to stop before toggling sensor");
std::this_thread::sleep_for(std::chrono::seconds(1));
enable_stream_[stream_index] = enabled;
setupProfiles();
startStreams();