introlab / rtabmap_ros

RTAB-Map's ROS package.
http://wiki.ros.org/rtabmap_ros
BSD 3-Clause "New" or "Revised" License
1.01k stars 559 forks source link

initial_pose not read by odometry node. #1079

Closed muttistefano closed 11 months ago

muttistefano commented 12 months ago

Hi all, i am running the odometry node in this way :

    odom = Node(
            package='rtabmap_odom', executable='rgbd_odometry', output='screen',
            parameters=[{'approx_sync':True},
                        {'subscribe_rgbd':True},
                        {'approx_sync_max_interval': 0.2},
                        {'rgbd_cameras':2},
                        {'frame_id': "base_link"},
                        {'initial_pose': "0.0 0.0 1.0 3.14 1.57 0.0"},
                        {'wait_imu_to_init': True},
                        {'wait_for_transform': 2.0},
                        {'qos': 1}],
            remappings=[('rgbd_image0',     '/camera1/rgbd_image'),
                        ('rgbd_image1',     '/camera2/rgbd_image'),
                        ('/imu',            '/imu/data')])

But when i run it , in the terminal is printed :

[rgbd_odometry-3] [INFO] [1701686695.319444966] [rgbd_odometry]: Odometry: frame_id               = base_link
[rgbd_odometry-3] [INFO] [1701686695.319522727] [rgbd_odometry]: Odometry: odom_frame_id          = odom
[rgbd_odometry-3] [INFO] [1701686695.319535400] [rgbd_odometry]: Odometry: publish_tf             = true
[rgbd_odometry-3] [INFO] [1701686695.319538537] [rgbd_odometry]: Odometry: wait_for_transform     = 2.000000
[rgbd_odometry-3] [INFO] [1701686695.319548054] [rgbd_odometry]: Odometry: log_to_rosout_level    = 4
[rgbd_odometry-3] [INFO] [1701686695.319562163] [rgbd_odometry]: Odometry: initial_pose           = xyz=0.000000,0.000000,0.000000 rpy=0.000000,-0.000000,0.000000

am i doing someting wrong ? I am using the package with a vertical robot, and i would like to initialize the odometry Thanks

matlabbe commented 11 months ago

Thx for reporting, there was indeed a small bug (fixed in commit above) not showing the actual initial_pose param while it was really set under the hood (just the info log was wrong, but the new pose is used).

cheers, Mathieu