Something wrong wih the visual odom

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Something wrong wih the visual odom

cattt
This post was updated on .

HI!

Im developing a Tracked chassis based on two-wheel differential,using a RGBD camera (orbbic gemini series).
And Im trying to use RTABMAP to set up the whole map and using the localization mode of RTABMAP instead of the AMCL in NAV2.

Im using the RGBD depth camera as the visual odomestry, however I found that when my robot moving on X axis, the data on Y and Z also change.
They are roughly proportional to the movement along the x-axis.
When running the RGBD mapping, the trajectory in the 3D map will frequently jump along the Z-axis.

I tried forced 2D, but the trajectory in the 3D map appears as a diagonal line in the visualization window (rtabmap viz).

I'm fairly certain my camera's internal settings are fine, as this issue has never occurred before. However, when I revert to a previous version, the problem persists.

I'm sure that my camera is facing the front of my car, that is RPY (0 0 0 1)
my camera'rgb image size is 640*480; the depth size is 640*400.
Will that be the problem, because there are some warns in the log like this:

[rtabmap-7] [ WARN] (2025-11-13 22:31:56.595) Memory.cpp:5064::createSignature()
Mem/DepthAsMask is true, but RGB size (640x480) modulo depth size (640x400) is not 0.
Ignoring depth mask for feature detection (Mem/ImagePreDecimation=1).

Im sorry that my English is not that good, If there's anything I haven't explained clearly, please tell me.
About the trajectory in the 3D map, Since I'm not in the lab right now, I can provide photos showing the details in about half a day.

I wonder how to fix this problem

here is my rtabmap_vo.launch.py
from launch import LaunchDescription
from launch_ros.actions import Node

def generate_launch_description():
    return LaunchDescription([
        Node(
            package='tf2_ros',
            executable='static_transform_publisher',
            name='base_to_camera',
            arguments=['0', '0', '0', '0', '0', '0', 'base_link', 'camera_link']
        ),
        Node(
            package='rtabmap_odom',
            executable='rgbd_odometry',
            name='rtabmap_odom',
            output='screen',
            parameters=[{
                'frame_id': 'base_link',
                'odom_frame_id': 'odom',
                'publish_tf': True,
                'subscribe_depth': True,
                'subscribe_rgb': True,
                'subscribe_scan': False,
                'Vis/DepthAsMask': 'false',
                'queue_size': 30,
                'always_process_most_recent_frame': False,
            }],
            remappings=[
                ('rgb/image', '/camera/color/image_raw'),
                ('depth/image', '/camera/depth/image_raw'),
                ('rgb/camera_info', '/camera/color/camera_info'),
                ('odom', '/odom'),
            ],
        ),
    ])
HERE is my RTABMAP.YAML
rtabmap:
    ros__parameters:
        frame_id: 'base_link'
        subscribe_depth: True
        subscribe_rgb: True
        subscribe_scan: True
        queue_size: 100
        map_negative_poses_ignored: True
        map_negative_scan_matching_ignored: True
        map_always_update: True
        map_empty_ray_tracing: True
        scan_normal_k: 0
        Grid/RangeMax: 0
        Grid/RangeMin: 0
        Grid/CellSize: 0.05
        Grid/ClusterRadius: 1
        Grid/GroundIsObstacle: True
        Grid/MapFrameProjection: False
        Grid/MaxObstacleHeight: 2
        Grid/MinClusterSize: 3
        Grid/MinGroundHeight: 0
        Grid/NoiseFilteringMinNeighbors: 5
        Grid/NoiseFilteringRadius: 0.1
        Grid/NormalsSegmentation: True
        Grid/RayTracing: True
        Grid/3D: False
        Grid/FlatObstacleDetected: True
        Reg/Force3DoF: False
        Reg/Strategy: 1
        Vis/MinInliers: 5
        Vis/InlierDistance: 0.05
        Vis/MaxFeatures: 1000
        Vis/EstimationType: 1
        Vis/CorFlowMaxLevel: 5
        Vis/CorType: 1
        Vis/CorNNType: 4
        Vis/CorNNDR: 0.8
        Vis/MinDepth: 0.5
        Vis/MaxDepth: 3.5
        Vis/RoiRatios: '.03 .03 .04 .04'
        Vis/FeatureType: 6
        Vis/OdomFixedFrame: False
        Vis/OdomGuessSmoothing: True
        Vis/OdomHolonomic: False
        Vis/PnPReprojError: 2
        Vis/PnPFlags: 1
        Vis/CorGuessWinSize: 20
        Vis/CorMaxFeatures: 1000
        Vis/CorMinInliers: 10
        Vis/CorMaxCorr: 200
        Vis/CorFlowWinSize: 16
        Vis/CorEps: 0.02
        Vis/BundleAdjustment: 1
        Vis/MaxSelfSimilarFeatures: 0
        Vis/MinWords: 0
        Vis/MaxWords: 0
        Vis/MinGoodMatches: 0
here is my mapping.launch.py
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, TimerAction
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node
from launch.launch_description_sources import FrontendLaunchDescriptionSource
from launch.launch_description_sources import PythonLaunchDescriptionSource

def generate_launch_description():
    use_sim_time = LaunchConfiguration('use_sim_time', default='false')
    rtabmap_nav2_test_dir = get_package_share_directory('rtabmap_nav2_test')
    astra_camera_dir = get_package_share_directory('astra_camera')
    rtabmap_vo_dir = get_package_share_directory('rtabmap_vo_test')

    return LaunchDescription([
        # Declare launch arguments
        DeclareLaunchArgument(
            'use_sim_time',
            default_value='false',
            description='Use simulation (Gazebo) clock if true'),

        # Astra camera driver
        IncludeLaunchDescription(
            FrontendLaunchDescriptionSource(os.path.join(astra_camera_dir, 'launch', 'gemini.launch.xml'))
        ),

        # Visual Odometry
        IncludeLaunchDescription(
            PythonLaunchDescriptionSource(os.path.join(rtabmap_vo_dir, 'launch', 'rtabmap_vo.launch.py'))
        ),



        # RTAB-Map SLAM node with a startup delay
        TimerAction(
            period=3.0,
            actions=[
                Node(
                    package='rtabmap_slam',
                    executable='rtabmap',
                    name='rtabmap_slam',
                    output='screen',
                    parameters=[{
                        'frame_id': 'base_link',
                        'subscribe_depth': True,
                        'subscribe_rgb': True,
                        'subscribe_scan': False,
                        'subscribe_odom': True,
                        'approx_sync': True,
                        'queue_size': 10,
                        'Mem/IncrementalMemory': 'true',
                        'Mem/InitWMWithLoopClosure': 'true',
                        'odom_frame_id': 'odom',
                        'publish_tf': False,
                        'Reg/Strategy': '0', # Use visual registration only
                        'Vis/CorType': '0', # Use feature matching
                        'Mem/ImagePreDecimation': '1', # Use full resolution
                        'Mem/ImagePostDecimation': '1', # Use full resolution
                        'Vis/MaxFeatures': '1000', # Increase features
                        'Rtabmap/DetectionRate': '15',
                        'Grid/FromDepth': 'true', # Create 2D map from depth
                        'Reg/Force3DoF': 'true' # Assume 2D movement
                    }],
                    remappings=[
                        ('rgb/image', '/camera/color/image_raw'),
                        ('rgb/camera_info', '/camera/color/camera_info'),
                        ('depth/image', '/camera/depth/image_raw')
                    ]
                )
            ]
        ),

        # RTAB-Map GUI
        Node(
            package='rtabmap_viz',
            executable='rtabmap_viz',
            name='rtabmap_viz',
            output='screen',
            parameters=[{
                'frame_id': 'base_link',
                'subscribe_depth': True,
                'subscribe_rgb': True,
                'subscribe_scan': False,
                'subscribe_odom': True,
                'approx_sync': True,
            }],
            remappings=[
                ('rgb/image', '/camera/color/image_raw'),
                ('rgb/camera_info', '/camera/color/camera_info'),
                ('depth/image', '/camera/depth/image_raw'),
                ('odom', '/odom'),
            ]
        ),

        # RViz
        Node(
            package='rviz2',
            executable='rviz2',
            name='rviz2',
            arguments=['-d', os.path.join(rtabmap_nav2_test_dir, 'rviz', 'nav2_default_view.rviz')],
            parameters=[{'use_sim_time': use_sim_time}],
            output='screen')
    ])
I've attached the picture of the directory structure of my program package. Please let me know if you need any other source code files. I would be extremely grateful if you could help me. Thank you very much!!!
Reply | Threaded
Open this post in threaded view
|

Re: Something wrong wih the visual odom

cattt
THE programe is running on UBUNTU 22.04 ROS2 HUMBLE


$ dpkg -l | grep rtabmap
ii  ros-humble-rtabmap                                                0.22.1-1jammy.20251013.150443           amd64        RTAB-Map's standalone library.
ii  ros-humble-rtabmap-conversions                                    0.22.1-1jammy.20251017.023901           amd64        RTAB-Map's conversions package.
ii  ros-humble-rtabmap-msgs                                           0.22.1-1jammy.20251008.015521           amd64        RTAB-Map's msgs package.
ii  ros-humble-rtabmap-python                                         0.22.1-1jammy.20250718.231221           amd64        RTAB-Map's python package.
ii  ros-humble-rtabmap-rviz-plugins                                   0.22.1-1jammy.20251017.045014           amd64        RTAB-Map's rviz plugins.
ii  ros-humble-rtabmap-sync                                           0.22.1-1jammy.20251017.024639           amd64        RTAB-Map's synchronization package.
ii  ros-humble-rtabmap-viz                                            0.22.1-1jammy.20251017.034944           amd64        RTAB-Map's visualization package.