LiDAR scan visible in base_link frame but not in odom and map frame integrated into map/odom in SLAM Toolbox (PX4 SITL + ROS2 Rolling + MAVROS)

Hi everyone,

I’m running a PX4 SITL simulation with ROS2 Noble and trying to perform 2D mapping using SLAM Toolbox. Most components seem to work, but the LiDAR scan is not being integrated into the map or odometry.

System Setup

  • Ubuntu 24.04

  • ROS2 Rolling

  • PX4 SITL (Gazebo Harmonic, drone with 2D LiDAR)

  • MAVROS (ROS2 version)

  • SLAM Toolbox

  • ros_gz_bridge and relay providing /scan

Current Behavior

  • /scan topic is active and visible in RViz.

  • LiDAR data displays correctly in:

    base_link frame
    link (lidar_link) frame
    
  • MAVROS publishes:

    /mavros/local_position/odom
    

However:

  • The map does not update in map or odom, only update in link and base_link.

  • No LiDAR scan data appears in the map or odom frame

There are 3 topics that have odom:

/mavros/odometry/in

/mavros/odometry/out (echo received nothing)

/mavros/local_position/odom (Publish frame_id “map” instead of “odom”)

Even when I try to change the yaml file for the /mavros/local_position/odom to publish tf to odom, there is no laser scan appare. The only case where the laser scan appear in odom is using the static transform directly on odom - base_link.

Here are some more images

each time i change fix frame to odom this show up in the rviz terminal

[INFO] [1770651767.190772708] [rviz]: Message Filter dropping message: frame ‘link’ at time 1111.804 for reason ‘the timestamp on the message is earlier than all the data in the transform cache’

and laser disapear

Frames:
Frame: base_link_frd, published by , Average Delay: 173.361, Max Delay: 173.361
Frame: link, published by , Average Delay: 1.77065e+09, Max Delay: 1.77065e+09
Frame: map_ned, published by , Average Delay: 173.361, Max Delay: 173.361
Frame: odom_ned, published by , Average Delay: 173.361, Max Delay: 173.361

173 is the sim time and the link is publishing something from the past