# RtabMap SLAM in Gazebo harmonic

**URL:** <https://discuss.px4.io/t/rtabmap-slam-in-gazebo-harmonic/47156>\
**Category:** ROS 1 / ROS 2\
**Created:** [August 24, 2025, 2:39pm UTC](https://discuss.px4.io/t/rtabmap-slam-in-gazebo-harmonic/47156 "2025-08-24T14:39:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pratik\_Wagh](https://discuss.px4.io/user_avatar/discuss.px4.io/pratik_wagh/32/18869_2.png) [@Pratik\_Wagh](https://discuss.px4.io/u/Pratik_Wagh)\
**Post date:** [August 24, 2025, 2:39pm UTC](https://discuss.px4.io/t/rtabmap-slam-in-gazebo-harmonic/47156/1 "2025-08-24T14:39:11Z")

</div>

i am trying to simulate the depth camera in gazebo harmonic i.e, gazebo 8.9

the rtabmap slam needs this four topics

```
      ('imu', '/camera/camera/imu'),

      ('rgb/image', '/camera/camera/infra1/image_rect_raw'),

      ('rgb/camera_info', '/camera/camera/infra1/camera_info'),

      ('depth/image', '/camera/camera/depth/image_rect_raw')\]

```

so i simulated all of them from simulation

when i ran the launch file of rtabmap it gave me this warnings and errors

[rtabmap-2] [WARN] [1755969827.752845137] [rtabmap]: rtabmap: Did not receive data since 5 seconds! Make sure the input topics are published (“$ ros2 topic hz my\_topic”) and the timestamps in their header are set. If topics are coming from different computers, make sure the clocks of the computers are synchronized (“ntpdate”). Ajusting topic\_queue\_size (10) and sync\_queue\_size (10) can also help for better synchronization if framerates and/or delays are different. If topics are not published at the same rate, you could increase “sync\_queue\_size” and/or “topic\_queue\_size” parameters (current=10 and 10 respectively).  
[rtabmap-2] rtabmap subscribed to (approx sync):  
[rtabmap-2] /odom  
[rtabmap-2] /camera/camera/infra1/image\_rect\_raw  
[rtabmap-2] /camera/camera/depth/image\_rect\_raw  
[rtabmap-2] /camera/camera/infra1/camera\_info  
[rgbd\_odometry-1] [WARN] (2025-08-23 22:53:47.139) MsgConversion.cpp:2010::getTransform() (getting transform depth\_camera/link/depth\_camera1 → depth\_camera/link/ir\_camera) “depth\_camera/link/depth\_camera1” passed to lookupTransform argument target\_frame does not exist. (wait\_for\_transform=0.100000)

it looks like the /odom isnt published by node rgb\_odometry but why ??

all other topics are giving the data except /odom

**Launch File**

```python
# Requirements:
# A realsense D435i
# Install realsense2 ros2 package (ros-$ROS_DISTRO-realsense2-camera)
# Example:
# $ ros2 launch rtabmap_examples realsense_d435i_infra.launch.py

import os

from ament_index_python.packages import get_package_share_directory

from launch import LaunchDescription
from launch_ros.actions import Node, SetParameter
from launch.actions import IncludeLaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration

def generate_launch_description():
    parameters=[{
          'frame_id':'depth_camera/link/depth_camera1',
          'subscribe_depth':True,
          'subscribe_odom_info':False,
          'approx_sync':True,
          'wait_imu_to_init':False}]

    remappings=[
          ('imu', '/camera/camera/imu'),
          ('rgb/image', '/camera/camera/infra1/image_rect_raw'),
          ('rgb/camera_info', '/camera/camera/infra1/camera_info'),
          ('depth/image', '/camera/camera/depth/image_rect_raw')]

    return LaunchDescription([

        # Launch arguments
        DeclareLaunchArgument(
            'unite_imu_method', default_value='2',
            description='0-None, 1-copy, 2-linear_interpolation. Use unite_imu_method:="1" if imu topics stop being published.'),

        #Hack to disable IR emitter
        SetParameter(name='depth_module.emitter_enabled', value=0),

        # Launch camera driver
        

        Node(
            package='rtabmap_odom', executable='rgbd_odometry', output='screen',
            parameters=parameters,
            remappings=remappings),

        Node(
            package='rtabmap_slam', executable='rtabmap', output='screen',
            parameters=parameters,
            remappings=remappings,
            arguments=['-d']),

        Node(
            package='rtabmap_viz', executable='rtabmap_viz', output='screen',
            parameters=parameters,
            remappings=remappings),
                
        # Compute quaternion of the IMU
        Node(
            package='imu_filter_madgwick', executable='imu_filter_madgwick_node', output='screen',
            parameters=[{'use_mag': False, 
                         'world_frame':'enu', 
                         'publish_tf':False}],
            remappings=[('imu/data_raw', '/camera/camera/imu')]),
    ])

```

**Simulation sdf**

```auto

```
