|
| 1 | +# ----------------------------------------------------------------------------- |
| 2 | +# DEMO: LiDAR odometry + ROS2 wheel odometry fused in the Smoother |
| 3 | +# |
| 4 | +# This mola-cli launch file runs: |
| 5 | +# 1. mola::BridgeROS2 - subscribes to LiDAR PointCloud2 + wheel Odometry + IMU |
| 6 | +# 2. mola::LidarOdometry - computes LiDAR-based odometry from point clouds |
| 7 | +# 3. mola::StateEstimationSmoother - fuses LiDAR odom + wheel odom + IMU |
| 8 | +# 4. BridgeROS2 publishes fused result back to ROS2 as nav_msgs/Odometry + /tf |
| 9 | +# |
| 10 | +# Data flow: |
| 11 | +# ROS2 /lidar_points --> BridgeROS2 --> LidarOdometry ---+ |
| 12 | +# ROS2 /wheel_odom --> BridgeROS2 ----+ | |
| 13 | +# ROS2 /imu --> BridgeROS2 ----+--> StateEstimationSmoother |
| 14 | +# | |
| 15 | +# advertiseUpdatedLocalization() |
| 16 | +# | |
| 17 | +# BridgeROS2 --> ROS2 /state_estimation/pose |
| 18 | +# --> ROS2 /tf (map->base_link) |
| 19 | +# |
| 20 | +# Usage: |
| 21 | +# mola-cli demo_lidar_odom_plus_wheel_odom_fusion.yaml |
| 22 | +# |
| 23 | +# Key environment variables: |
| 24 | +# MOLA_LIDAR_TOPIC - LiDAR PointCloud2 topic (default: /ouster/points) |
| 25 | +# WHEEL_ODOM_TOPIC - wheel odometry topic (default: /wheel_odom) |
| 26 | +# IMU_TOPIC - IMU topic (default: /imu) |
| 27 | +# ----------------------------------------------------------------------------- |
| 28 | + |
| 29 | +modules: |
| 30 | + # ===================== |
| 31 | + # MolaViz (optional) |
| 32 | + # ===================== |
| 33 | + - name: viz |
| 34 | + type: mola::MolaViz |
| 35 | + enabled: ${MOLA_WITH_GUI|true} |
| 36 | + verbosity_level: INFO |
| 37 | + params: ~ |
| 38 | + |
| 39 | + # ===================== |
| 40 | + # LiDAR Odometry Front-End |
| 41 | + # ===================== |
| 42 | + - name: lidar_odom |
| 43 | + type: mola::LidarOdometry |
| 44 | + verbosity_level: ${MOLA_VERBOSITY_MOLA_LO|INFO} |
| 45 | + raw_data_source: "ros2_bridge" |
| 46 | + params: "${MOLA_ODOMETRY_PIPELINE_YAML|../../mola_lidar_odometry/pipelines/lidar3d-default.yaml}" |
| 47 | + |
| 48 | + # ===================== |
| 49 | + # State Estimation Smoother |
| 50 | + # ===================== |
| 51 | + - name: state_estimation |
| 52 | + type: mola::mola_state_estimation_smoother::StateEstimationSmoother |
| 53 | + verbosity_level: ${MOLA_VERBOSITY_STATE_ESTIMATOR|INFO} |
| 54 | + raw_data_source: "ros2_bridge" |
| 55 | + |
| 56 | + execution_rate: ${MOLA_STATE_ESTIMATOR_PUBLISH_RATE|20} # Hz |
| 57 | + |
| 58 | + params: |
| 59 | + vehicle_frame_name: "${MOLA_TF_BASE_LINK|base_link}" |
| 60 | + reference_frame_name: "${MOLA_TF_MAP|map}" |
| 61 | + |
| 62 | + kinematic_model: "${MOLA_NAVSTATE_KINEMATIC_MODEL|KinematicModel::ConstantVelocity}" |
| 63 | + sliding_window_length: ${MOLA_NAVSTATE_SLIDING_WINDOW_SEC|2.5} |
| 64 | + min_time_difference_to_create_new_frame: 0.01 |
| 65 | + max_time_to_use_velocity_model: 0.75 |
| 66 | + |
| 67 | + sigma_random_walk_acceleration_linear: ${MOLA_NAVSTATE_SIGMA_RANDOM_WALK_LINACC|1.0} |
| 68 | + sigma_random_walk_acceleration_angular: ${MOLA_NAVSTATE_SIGMA_RANDOM_WALK_ANGACC|10.0} |
| 69 | + sigma_integrator_position: 0.1 |
| 70 | + sigma_integrator_orientation: 1.0 |
| 71 | + |
| 72 | + # Accept all odometry labels (wheel_odom will arrive via onNewObservation, |
| 73 | + # lidar_odom arrives directly via fuse_pose from LidarOdometry module): |
| 74 | + do_process_odometry_labels_re: ".*" |
| 75 | + do_process_imu_labels_re: ".*" |
| 76 | + do_process_gnss_labels_re: ".*" |
| 77 | + |
| 78 | + estimate_geo_reference: false |
| 79 | + additional_isam2_update_steps: 3 |
| 80 | + |
| 81 | + # ===================== |
| 82 | + # ROS2 <-> MOLA Bridge |
| 83 | + # ===================== |
| 84 | + - name: ros2_bridge |
| 85 | + type: mola::BridgeROS2 |
| 86 | + verbosity_level: ${MOLA_VERBOSITY_BRIDGE_ROS2|INFO} |
| 87 | + execution_rate: 20 # Hz |
| 88 | + |
| 89 | + gui_preview_sensors: |
| 90 | + - raw_sensor_label: ${MOLA_LIDAR_NAME|lidar} |
| 91 | + decimation: 1 |
| 92 | + enabled: ${MOLA_WITH_GUI|true} |
| 93 | + win_pos: 5 5 400 400 |
| 94 | + |
| 95 | + params: |
| 96 | + base_link_frame: "${MOLA_TF_BASE_LINK|base_link}" |
| 97 | + base_footprint_frame: "" |
| 98 | + odom_frame: "${MOLA_TF_ESTIMATED_ODOMETRY|odom}" |
| 99 | + reference_frame: "${MOLA_TF_MAP|map}" |
| 100 | + |
| 101 | + # The smoother publishes fused results; direct mode: |
| 102 | + publish_localization_following_rep105: false |
| 103 | + |
| 104 | + # Only forward the smoother's fused output (not the raw lidar_odom): |
| 105 | + publish_odometry_msgs_from_slam: true |
| 106 | + publish_odometry_msgs_from_slam_source: "state_estimation" |
| 107 | + publish_tf_from_slam: true |
| 108 | + publish_tf_from_slam_source: "state_estimation" |
| 109 | + |
| 110 | + publish_in_sim_time: ${MOLA_ROS2_PUBLISH_IN_SIM_TIME|false} |
| 111 | + period_publish_new_map: 1.0 |
| 112 | + |
| 113 | + ros_args: '${ROS_ARGS|"[]"}' |
| 114 | + |
| 115 | + subscribe: |
| 116 | + # LiDAR point cloud (processed by LidarOdometry front-end) |
| 117 | + - topic: ${MOLA_LIDAR_TOPIC|/ouster/points} |
| 118 | + msg_type: ${MOLA_LIDAR_TOPIC_TYPE|PointCloud2} |
| 119 | + output_sensor_label: ${MOLA_LIDAR_NAME|lidar} |
| 120 | + fixed_sensor_pose: "${LIDAR_POSE_X|0} ${LIDAR_POSE_Y|0} ${LIDAR_POSE_Z|0} ${LIDAR_POSE_YAW|0} ${LIDAR_POSE_PITCH|0} ${LIDAR_POSE_ROLL|0}" |
| 121 | + use_fixed_sensor_pose: ${MOLA_USE_FIXED_LIDAR_POSE|false} |
| 122 | + |
| 123 | + # External wheel odometry (directly consumed by smoother via onNewObservation) |
| 124 | + - topic: ${WHEEL_ODOM_TOPIC|/wheel_odom} |
| 125 | + msg_type: Odometry |
| 126 | + output_sensor_label: "wheel_odom" |
| 127 | + |
| 128 | + # IMU for gravity alignment |
| 129 | + - topic: ${IMU_TOPIC|/imu} |
| 130 | + msg_type: Imu |
| 131 | + output_sensor_label: "imu" |
| 132 | + fixed_sensor_pose: "${IMU_POSE_X|0} ${IMU_POSE_Y|0} ${IMU_POSE_Z|0} ${IMU_POSE_YAW|0} ${IMU_POSE_PITCH|0} ${IMU_POSE_ROLL|0}" |
| 133 | + use_fixed_sensor_pose: ${MOLA_USE_FIXED_IMU_POSE|false} |
| 134 | + |
| 135 | + # Optional GNSS |
| 136 | + - topic: ${GNSS_TOPIC|/gps} |
| 137 | + msg_type: NavSatFix |
| 138 | + output_sensor_label: "gps" |
| 139 | + fixed_sensor_pose: "0 0 0 0 0 0" |
| 140 | + use_fixed_sensor_pose: ${MOLA_USE_FIXED_GNSS_POSE|false} |
0 commit comments