ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

SLAM with ROS2

asked 2022-03-02 08:08:32 -0600

Martin_H gravatar image

Dear Community!! I am currently working on a project with a RPI4 and a LIDAR Scanner RPLidar A1M8-R5. The operating system is Ubuntu Mate and I currently use ROS2 Foxy. At this point, I can display the data from the LIDAR in RVIZ2 under the topic /scan with the type sensor_msgs/msg/LaserScan. Now my question is how can I create a map from this data with NAV2 or SLAM_toolbox and what steps I need to do to create this map. Unfortunately at the moment I can't find any tutorial which I can use.

Thanks in advance for your answers!!

edit retag flag offensive close merge delete

Comments

You can learn a lot by reading code and packages from others - this one https://github.com/Adlink-ROS/neuronbot2 is a nice example of using SLAM (with: Gmapping, Slam_toolbox, Cartographer used)

ljaniec gravatar image ljaniec  ( 2022-03-03 05:19:58 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2022-03-02 18:21:47 -0600

I guess the best way to start would be to follow Nav2 tutorials or see how it is done on other robots. In short, you need to provide odometry, tf transformations, and then launch the navigation stack (see Nav2 bringup directory).

edit flag offensive delete link more

Comments

Thanks for the reply, I will check the things you send over! Thanks and have a nice day!

Martin_H gravatar image Martin_H  ( 2022-03-03 01:13:02 -0600 )edit
0

answered 2023-04-21 02:25:55 -0600

kathan gravatar image

Hello, I was also facing a similar problem. Then I decided to use turtlebot 4 package SLAM and I am giving you the commands that helped me solve this problem. I hope this helps you: The first step was to Install the odometry package which isrf2o_laser_odometry The second step was to start the Lidar node using: ros2 launch rplidar_ros rplidar.launch.py The third step is to start odometry from ros2 workspace:ros2 launch rf2o_laser_odometry rf2o_laser_odometry.launch.py laser_scan_topic:=scan The fourth step is to do static transformation:

ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 base_link laser

ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 base_link odom

The fifth step was to start the SLAM algorithm:

ros2 launch turtlebot4_navigation slam.launch.py params:=/full/path/to/slam.yaml

The final step is to Bring up the robot:

ros2 launch turtlebot4_viz view_robot.launch.py
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-03-02 07:49:52 -0600

Seen: 1,926 times

Last updated: Apr 21 '23