본문 바로가기
카테고리 없음

ROS rtabmap tutorial

by 우직한 사람 2024. 2. 28.
반응형

Screenshot from 2024-03-04 21-05-01환경

ROS version : noetic

Ubuntu version : 20.04

RGB-D Camera : Realsense D455

Installation

//realsense2_camera: 
sudo apt-get install ros-$ROS_DISTRO-realsense2-camera

//imu_filter_madgwick: 
sudo apt-get install ros-noetic-imu-filter-madgwick

//rtabmap_ros: 
sudo apt-get install ros-noetic-rtabmap*

//robot_localization: 
sudo apt-get install ros-noetic-robot-localization

Rosbag

//Save all topic
rosbag record -O my_bagfile_1.bag /camera/aligned_depth_to_color/camera_info  camera/aligned_depth_to_color/image_raw /camera/color/camera_info /camera/color/image_raw /camera/imu /camera/imu_info /tf_static /rtabmap/cloud_map

Roslaunch

roslaunch realsense2_camera opensource_tracking.launch

Setting

The pointcloud and a bunch of arrows, or axes marks, will appear on screen. These axes represent all the different coordinate systems involved. For clarity you could remove most of them.

From the Displays Panel:
TF -> Frames, and then leave out as marked only map and camera_link. The first represents the world coordinate system and the second, the camera.

You may want to watch the on-line video as well:
From the Displays panel:
Image->Image Topic: rewrite to /camera/color/image_raw

 

 

Topic check

rtabmap에 intput으로 들어갈 rtabmap/cloud_map 토픽이 publish 되고 있는지 확인한다

rostpic echo /rtabmap/cloud_map

1. 카메라를 들고 맵핑하려는 장소로 이동한다

2. 맵핑이 어느정도 완료되면 rosbag record 를 하고 있는 터미널로 가서 Ctrl + C를 눌러 종료한다

 

 

 

PCL visualization 

1. PCL viewer

sudo apt-get install pcl-tools
rosrun pcl_ros pointcloud_to_pcd input:=/rtabmap/cloud_map

 

 

2. rtabmap viewer

roslaunch rtabmap_ros rtabmap.launch 
rosbag play hyeon.bag

 

Result

다음과 같이 .pcd 형태로 저장된 것을 알 수 있다

 

Visualization

pcl_viewer 1709049377663825.pcd

1709131374669503.pcd
7.61MB

 

[후기]

RGB-D 카메라 V-SLAM 튜토리얼이 있어 세팅해봤다

핸드헬드 타입을 만들어서 하려고 했으나, SBC 메모리 부족으로 SSD를 구매하기 전까지 당분간 데스크탑으로 연결해서

사용해봐야겠다

 

<Reference>

https://github.com/IntelRealSense/realsense-ros/tree/ros1-legacy

https://github.com/IntelRealSense/realsense-ros/wiki/SLAM-with-D435i

https://velog.io/@hanbyeolee/intel-Realsense-Depth-Camera-D455%EC%99%80-Rtabmap-%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC-vslam#pcl-viewer

반응형