Change default enable_imu parameter to false

This commit is contained in:
xiexun
2025-09-23 09:57:21 +08:00
parent b5636f31d0
commit 4e49fca93d
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -188,7 +188,7 @@ def generate_launch_description():
), ),
DeclareLaunchArgument( DeclareLaunchArgument(
'enable_imu', 'enable_imu',
default_value='true', default_value='false',
description='Enable IMU (accelerometer and gyroscope) data publishing.' description='Enable IMU (accelerometer and gyroscope) data publishing.'
), ),
DeclareLaunchArgument( DeclareLaunchArgument(
+6 -1
View File
@@ -576,6 +576,11 @@ void OBLidarNode::onNewIMUFrameCallback(const std::shared_ptr<ob::Frame> &accelf
return; return;
} }
if (!tf_published_) {
publishStaticTransforms();
tf_published_ = true;
}
bool has_subscriber = imu_publisher_->get_subscription_count() > 0; bool has_subscriber = imu_publisher_->get_subscription_count() > 0;
if (!has_subscriber) { if (!has_subscriber) {
return; return;
@@ -621,7 +626,7 @@ void OBLidarNode::onNewFrameSetCallback(std::shared_ptr<ob::FrameSet> frame_set)
} }
try { try {
RCLCPP_INFO_ONCE(logger_, "New frame received"); RCLCPP_INFO_ONCE(logger_, "New frame received");
if (!tf_published_) { if (!tf_published_ && !enable_imu_) {
publishStaticTransforms(); publishStaticTransforms();
tf_published_ = true; tf_published_ = true;
} }