RTABMAP outputs the pointcloud map on the wrong axis

asked 2021-11-30 11:57:02 -0500

luccagioia gravatar image

RTABMAP seems to be working fine, it's receiving data from the camera topics and odom topic, but the pointcloud map is being displayed on the wrong axis in relation to gazebo. What should be the front of the robot points to the Z axis.

I'm using gazebo11 and ros2 galactic with the turtlebot2i robot.

Here's some screenshots:

https://imgur.com/a/N6Eax9a

https://imgur.com/a/BVnyX1t

I also receive this warning at rtabmap terminal

Warning: Invalid frame ID "base_link" passed to canTransform argument source_frame - frame does not exist

But i can't seem to find where this base_link is coming from, i'm using the base_footprint for the robot frame.

Here's the config for the camera:

<gazebo reference="camera_link">
    <sensor name="camera" type="depth">
        <always_on>true</always_on>
        <update_rate>30.0</update_rate>
        <camera>
            <!-- <horizontal_fov>1.0472</horizontal_fov> -->
            <horizontal_fov>1.11701</horizontal_fov>
            <aspect_ratio>1.333333333333333</aspect_ratio>  
            <image>
                <format>B8G8R8</format>
                <width>640</width>
                <height>480</height>
            </image>
            <clip>
                <near>0.4</near>
                <far>8.0</far>
            </clip>
        </camera>
        <plugin name="camera_controller" filename="libgazebo_ros_camera.so">
            <ros>
                <!--<namespace></namespace>-->

                <!-- topics need to be prefixed with camera_name for remapping -->
                <argument>camera/image_raw:=camera/rgb/image_raw</argument>
                <argument>camera/depth/image_raw:=camera/depth/image_raw</argument>
                <argument>camera/camera_info:=camera/cam_info_raw</argument>
                <argument>camera/depth/camera_info:=camera/depth/cam_info_raw</argument>
                <argument>camera/points:=camera/points_raw</argument>
            </ros>

            <!-- omit camera_name to default to sensor name -->
            <!--<camera_name>astra</camera_name>-->

            <frame_name>base_footprint</frame_name>

            <min_depth>0.1</min_depth>
            <max_depth>500</max_depth>

            <baseline>0.1</baseline>
            <distortion_k1>-8.23811762e-01</distortion_k1>
            <distortion_k2>5.27469947e+00</distortion_k2>
            <distortion_k3>-6.06324274e-03</distortion_k3>
            <distortion_t1>-3.25047090e-02</distortion_t1>
            <distortion_t2>-1.35477771e+01</distortion_t2>
            <pointCloudCutoff>0.4</pointCloudCutoff>
        </plugin>
    </sensor>
</gazebo>

And the rtabmap launch config:

    # Arguments
    DeclareLaunchArgument('stereo', default_value='false', description='Use stereo input instead of RGB-D.'),

    DeclareLaunchArgument('localization', default_value='false', description='Launch in localization mode.'),
    DeclareLaunchArgument('rtabmapviz',   default_value='false',  description='Launch RTAB-Map UI (optional).'),
    DeclareLaunchArgument('rviz',         default_value='true', description='Launch RVIZ (optional).'),

    DeclareLaunchArgument('use_sim_time', default_value='true', description='Use simulation (Gazebo) clock if true'),

    # Config files
    DeclareLaunchArgument('cfg',      default_value='',                        description='To change RTAB-Map\'s parameters, set the path of config file (*.ini) generated by the standalone app.'),
    DeclareLaunchArgument('gui_cfg',  default_value='~/.ros/rtabmap_gui.ini',  description='Configuration path of rtabmapviz.'),
    DeclareLaunchArgument('rviz_cfg', default_value=config_rviz,               description='Configuration path of rviz2.'),

    DeclareLaunchArgument('frame_id',       default_value='base_footprint',          description='Fixed frame id of the robot (base frame), you may set "base_link" or "base_footprint" if they are published. For camera-only config, this could be "camera_link".'),
    DeclareLaunchArgument('odom_frame_id',  default_value='odom',                   description='If set, TF is used to get odometry instead of the topic.'),
    DeclareLaunchArgument('map_frame_id',   default_value='map',                description='Output map frame id (TF).'),
    DeclareLaunchArgument('publish_tf_map', default_value='true',               description='Publish TF between map and odomerty.'),
    DeclareLaunchArgument('namespace',      default_value='rtabmap',            description=''),
    DeclareLaunchArgument('database_path',  default_value='~/.ros/rtabmap.db',  description='Where is the map saved/loaded.'),
    DeclareLaunchArgument('queue_size',     default_value='50',                 description=''),
    DeclareLaunchArgument('wait_for_transform', default_value='0.2',            description=''),
    DeclareLaunchArgument('rtabmap_args',   default_value='',                   description='Backward compatibility, use "args" instead.'),
    DeclareLaunchArgument('launch_prefix',  default_value='',                   description='For debugging purpose, it fills prefix tag of the nodes, e.g., "xterm -e gdb -ex run ...
(more)
edit retag flag offensive close merge delete

Comments

matlabbe gravatar image matlabbe  ( 2021-12-05 17:23:31 -0500 )edit