mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-09-10 10:20:19 +08:00
fix: lock LRM distance topic property reads
This commit is contained in:
@@ -1612,7 +1612,10 @@ void OBCameraNode::publishLrmObstacleDistance() {
|
||||
}
|
||||
try {
|
||||
std_msgs::msg::Int32 msg;
|
||||
msg.data = device_->getIntProperty(OB_PROP_LDP_MEASURE_DISTANCE_INT);
|
||||
{
|
||||
std::lock_guard<decltype(device_lock_)> lock(device_lock_);
|
||||
msg.data = device_->getIntProperty(OB_PROP_LDP_MEASURE_DISTANCE_INT);
|
||||
}
|
||||
lrm_obstacle_distance_pub_->publish(msg);
|
||||
} catch (const ob::Error &e) {
|
||||
RCLCPP_WARN_THROTTLE(logger_, *node_->get_clock(), 5000,
|
||||
|
||||
Reference in New Issue
Block a user