mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-04 12:07:46 +08:00
fixed stop cause crash
This commit is contained in:
@@ -92,6 +92,7 @@ void OBCameraNode::clean() {
|
||||
}
|
||||
RCLCPP_WARN_STREAM(logger_, "stop streams");
|
||||
stopStreams();
|
||||
stopIMU();
|
||||
RCLCPP_WARN_STREAM(logger_, "Destroy ~OBCameraNode DONE");
|
||||
if (rgb_buffer_) {
|
||||
delete[] rgb_buffer_;
|
||||
@@ -259,7 +260,6 @@ void OBCameraNode::startStreams() {
|
||||
pipeline_->enableFrameSync();
|
||||
}
|
||||
pipeline_started_.store(true);
|
||||
startIMU();
|
||||
}
|
||||
|
||||
void OBCameraNode::startIMU() {
|
||||
@@ -316,7 +316,6 @@ void OBCameraNode::stopStreams() {
|
||||
}
|
||||
try {
|
||||
pipeline_->stop();
|
||||
stopIMU();
|
||||
} catch (const ob::Error &e) {
|
||||
RCLCPP_ERROR_STREAM(logger_, "Failed to stop pipeline: " << e.getMessage());
|
||||
}
|
||||
|
||||
@@ -310,6 +310,7 @@ void OBCameraNodeDriver::initializeDevice(const std::shared_ptr<ob::Device> &dev
|
||||
}
|
||||
ob_camera_node_ = std::make_unique<OBCameraNode>(this, device_, parameters_);
|
||||
ob_camera_node_->startStreams();
|
||||
ob_camera_node_->startIMU();
|
||||
device_connected_ = true;
|
||||
device_info_ = device_->getDeviceInfo();
|
||||
CHECK_NOTNULL(device_info_.get());
|
||||
|
||||
Reference in New Issue
Block a user