mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-04 20:17:47 +08:00
feat: add delay before stopping streams
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user