introlab / rtabmap

RTAB-Map library and standalone application
https://introlab.github.io/rtabmap
Other
2.83k stars 787 forks source link

OAK-D-PRO shows wired #1323

Open Ragnar7982 opened 3 months ago

Ragnar7982 commented 3 months ago

Hello, I'm using OAK-D-PRO camera to run Rtab-map, OS is Ubuntu22.04 and ROS2 Humble, I got a not normal size of screen, Screenshot from 2024-08-07 15-18-02

The command I run is ros2 launch depthai_ros_driver rtabmap.launch.py, here is the file: import os

from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription from launch.actions import IncludeLaunchDescription from launch.launch_description_sources import PythonLaunchDescriptionSource from launch_ros.actions import Node, ComposableNodeContainer from launch_ros.descriptions import ComposableNode def generate_launch_description():

depthai_prefix = get_package_share_directory("depthai_ros_driver")
parameters = [
    {
        "frame_id": "camera_link",
        "subscribe_rgb": True,
        "subscribe_depth": True,
        "subscribe_odom_info": True,
        "approx_sync": True,
        "Rtabmap/DetectionRate": "2", 
    }
]
declared_arguments = [DeclareLaunchArgument("name", default_value="oak"),
    DeclareLaunchArgument("params_file", default_value=os.path.join(depthai_prefix, 'config', 'camera.yaml')), #Changed rgbd.yaml
    DeclareLaunchArgument("rectify_rgb", default_value="True"),
]
remappings = [
    ("rgb/image", "/oak/rgb/image_rect"),#/camera/color/image_raw
    ("rgb/camera_info", "/oak/rgb/camera_info"),#/camera/color/camera_info
    ("depth/image", "/oak/stereo/image_raw"),#/camera/depth/image_raw
    ]
return LaunchDescription(
    [
        Node(
            package="rtabmap_ros",
            executable="rgbd_odometry",
            output="screen",
            parameters=parameters,
            remappings=remappings,
        ),
        Node(
            package="rtabmap_ros",
            executable="rtabmap",
            output="screen",
            parameters=parameters,
            remappings=remappings,
            arguments=["-d"],
        ),
        Node(
            package="rtabmap_ros",
            executable="rtabmapviz",
           output="screen",
            parameters=parameters,
           remappings=remappings,
        ),
        IncludeLaunchDescription(
            PythonLaunchDescriptionSource(
                os.path.join(depthai_prefix, "launch", "description.launch.py")
            ),
            launch_arguments={"tf_prefix": "camera"}.items(),
        ),
        ComposableNodeContainer(
            name="container",
            namespace="",
            package="rclcpp_components",
            executable="component_container",
            composable_node_descriptions=[
                ComposableNode(
                    package="depthai_ros_driver",
                    plugin="depthai_ros_driver::RGBDCamera",
                    name="camera",
                    parameters=[{"i_rgb_fps": 60.0}],
                ),
            ],
            output="screen",
        ),
    ]
)

ros2 topic list(These are only connect to camera): /diagnostics /global_path /goal_node /goal_reached /info /joint_states /mapData /oak/imu/data /oak/rgb/camera_info /oak/rgb/image_raw /oak/rgb/image_raw/compressed /oak/rgb/image_raw/compressedDepth /oak/rgb/image_raw/theora /oak/rgb/image_rect /oak/rgb/image_rect/compressed /oak/rgb/image_rect/compressedDepth /oak/rgb/image_rect/theora /oak/stereo/camera_info /oak/stereo/image_raw /oak/stereo/image_raw/compressed /oak/stereo/image_raw/compressedDepth /oak/stereo/image_raw/theora /odom /odom_info /odom_info_lite /odom_last_frame /odom_local_map /odom_local_scan_map /odom_rgbd_image /odom_sensor_data/compressed /odom_sensor_data/features /odom_sensor_data/raw /parameter_events /robot_description /rosout /rtabmap/republish_node_data /tf /tf_static And rqt graph: rtab_wired_oak_1frame

Where might be the problem? Thank you.

matlabbe commented 3 months ago

Can you record/share a rosbag?

ros2 bag record /tf /tf_static /oak/rgb/image_rect /oak/rgb/camera_info /oak/stereo/image_raw