mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-06 13:07:47 +08:00
fix intra-process QoS crash in device status publisher
This commit is contained in:
@@ -258,16 +258,17 @@ void OBCameraNodeDriver::init() {
|
||||
check_connect_timer_ =
|
||||
this->create_wall_timer(std::chrono::milliseconds(1000), [this]() { checkConnectTimer(); });
|
||||
CHECK_NOTNULL(check_connect_timer_);
|
||||
query_thread_ = std::make_shared<std::thread>([this]() { queryDevice(); });
|
||||
reset_device_thread_ = std::make_shared<std::thread>([this]() { resetDevice(); });
|
||||
|
||||
device_status_timer_ =
|
||||
this->create_wall_timer(std::chrono::milliseconds(1000 / device_status_interval_hz),
|
||||
[this]() { deviceStatusTimer(); });
|
||||
|
||||
// Initialize device status publisher
|
||||
auto qos = rclcpp::QoS(1).transient_local();
|
||||
if (node_options_.use_intra_process_comms()) {
|
||||
qos = rclcpp::QoS(1);
|
||||
}
|
||||
device_status_pub_ = this->create_publisher<orbbec_camera_msgs::msg::DeviceStatus>(
|
||||
"device_status", rclcpp::QoS(1).transient_local());
|
||||
"device_status", qos);
|
||||
query_thread_ = std::make_shared<std::thread>([this]() { queryDevice(); });
|
||||
reset_device_thread_ = std::make_shared<std::thread>([this]() { resetDevice(); });
|
||||
}
|
||||
|
||||
void OBCameraNodeDriver::onDeviceConnected(const std::shared_ptr<ob::DeviceList> &device_list) {
|
||||
|
||||
Reference in New Issue
Block a user