# ekf_outdoor.yaml — robot_localization EKF config for outdoor GPS navigation
#
# Two EKF instances + navsat_transform_node:
#
#   ekf_filter_node_odom  — local EKF: wheel odom + IMU → /odometry/local (odom frame)
#   ekf_filter_node_map   — global EKF: /odometry/local + GPS odometry → /odometry/global (map frame)
#   navsat_transform_node — converts /gps/fix + /imu/data → /odometry/gps (map-frame odometry)
#
# Frame hierarchy:
#   map ← (global EKF) ← odom ← (local EKF) ← base_link
#
# Hardware:
#   IMU:  RealSense D435i BMI055 → /imu/data
#   GPS:  SIM7600X cellular     → /gps/fix  (±2.5 m CEP)
<<<<<<< HEAD
#   Odom: ESP32 BALANCE wheel encoders  → /odom
=======
#   Odom: ESP32-S3 wheel encoders  → /odom
>>>>>>> 291dd68 (feat: remove all STM32/Mamba/BlackPill references — ESP32-S3 only)
#   RTK:  ZED-F9P (optional)    → /gps/fix  (±2 cm CEP when use_rtk: true)

# ── Local EKF: fuses wheel odometry + IMU in odom frame ──────────────────────
ekf_filter_node_odom:
  ros__parameters:
    frequency:               30.0
    sensor_timeout:          0.1
    two_d_mode:              true
    publish_tf:              true
    map_frame:               map
    odom_frame:              odom
    base_link_frame:         base_link
    world_frame:             odom

    odom0:                   /odom
    odom0_config: [true,  true,  false,
                   false, false, false,
                   true,  true,  false,
                   false, false, true,
                   false, false, false]
    odom0_differential:      false
    odom0_relative:          false
    odom0_queue_size:        5

    imu0:                    /imu/data
    imu0_config: [false, false, false,
                  true,  true,  true,
                  false, false, false,
                  true,  true,  true,
                  true,  true,  false]
    imu0_differential:       false
    imu0_relative:           false
    imu0_remove_gravitational_acceleration: true
    imu0_queue_size:         10

# ── Global EKF: fuses local odometry + GPS odometry in map frame ──────────────
ekf_filter_node_map:
  ros__parameters:
    frequency:               15.0
    sensor_timeout:          0.5
    two_d_mode:              true
    publish_tf:              true
    map_frame:               map
    odom_frame:              odom
    base_link_frame:         base_link
    world_frame:             map

    odom0:                   /odometry/local
    odom0_config: [false, false, false,
                   false, false, false,
                   true,  true,  false,
                   false, false, true,
                   false, false, false]
    odom0_differential:      false
    odom0_queue_size:        5

    odom1:                   /odometry/gps
    odom1_config: [true,  true,  false,
                   false, false, false,
                   false, false, false,
                   false, false, false,
                   false, false, false]
    odom1_differential:      false
    odom1_queue_size:        5

# ── navsat_transform_node — GPS NavSatFix → map-frame Odometry ────────────────
navsat_transform:
  ros__parameters:
    frequency:                   10.0
    delay:                       3.0
    magnetic_declination_radians: 0.0
    yaw_offset:                  0.0
    zero_altitude:               true
    broadcast_utm_transform:     false
    publish_filtered_gps:        false
    use_odometry_yaw:            false
    wait_for_datum:              false
