Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interface realsense camera with rtabmap_ros package #1

Closed
tanmayyb opened this issue Oct 29, 2022 · 4 comments
Closed

interface realsense camera with rtabmap_ros package #1

tanmayyb opened this issue Oct 29, 2022 · 4 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@tanmayyb
Copy link
Member

For wireless SLAM to take place, the RGB-D data has to go through the ROS2 interface to the appropriate RTAB-map topics to be processed. Currently I am facing bugs at each step of the process.
Once the issue is resolved, we should be able to obtain RTABmaps through the ROS2 DDS (hence wirelessly).

@tanmayyb tanmayyb self-assigned this Oct 29, 2022
@tanmayyb tanmayyb added bug Something isn't working help wanted Extra attention is needed labels Oct 29, 2022
@tanmayyb tanmayyb pinned this issue Oct 29, 2022
@tanmayyb
Copy link
Member Author

Error:

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

link: ros-rtabmap-does-not-create-point-cloud
link: rtabmap_ros-with-realsense-odometry-could-not-get-transform-from-base_link-to-camera_color_optical_frame

@tanmayyb
Copy link
Member Author

update:
the rgbd_odometry node expects the tf frames of id base_link. but I was sending realsense_node_link.
When setting the params camera_name: base, and base_frame_id :link for the camera node, the tf frames arrives as base_link to the rgb_odometry node. Thus solving this issue.

@tanmayyb
Copy link
Member Author

code and commands for reference:
launch.py for realsense_camera_node:

import os
from ament_index_python import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.actions import IncludeLaunchDescription
from launch.actions import GroupAction
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration
from launch.substitutions import TextSubstitution
from launch_ros.actions import Node
from launch_ros.actions import PushRosNamespace

def generate_launch_description():
    # for run file
    realsense_camera_node = Node(
            package='realsense2_camera',
            executable='realsense2_camera_node',
            name='realsense2_camera_node', #name of the node
            remappings=[
                ('/color/image_raw', '/rgb/image'),
                ('/color/camera_info', '/rgb/camera_info'),
                ('/depth/image_rect_raw', '/depth/image'),
            ],
            parameters=[
                #{"base_frame_id": "link"}, (default)
                {"camera_name": "base"},
            ]
        )
    return LaunchDescription([
        realsense_camera_node
    ])

run as launch.py and with this in local dir:

ros2 launch launch.py

For rtabmap's rgbd_odometry node:

ros2 run rtabmap_ros rgbd_odometry

@tanmayyb
Copy link
Member Author

This issue existed due to incorrect usage of the namespace. The custom launchfile fixes this. <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant