Fixing the command to control the data stream crash issue.

This commit is contained in:
lixiaobin
2023-12-27 14:53:26 +08:00
parent b25c390cd5
commit df21b7d46e
+2 -4
View File
@@ -305,10 +305,8 @@ void OBCameraNode::startStreams() {
RCLCPP_ERROR_STREAM(logger_, "Failed to start pipeline");
throw std::runtime_error("Failed to start pipeline");
}
if (enable_stream_[COLOR]) {
if (colorFrameThread_) {
colorFrameThread_ = std::make_shared<std::thread>([this]() { onNewColorFrameCallback(); });
}
if (enable_stream_[COLOR] && !colorFrameThread_) {
colorFrameThread_ = std::make_shared<std::thread>([this]() { onNewColorFrameCallback(); });
}
if (enable_frame_sync_) {
pipeline_->enableFrameSync();