【笔记】ubuntu18.04 ros melodic turtlebot3 源码下,导航gmapping仿真

2023-05-16

编写本笔记原因:
源码编译没问题,但是在运行roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=cartgrapher时出现下面这个错误:

RLException: [turtlebot3_slam] is neither a launch file in package [turtlebot3_slam] nor is [turtlebot3_slam] a launch file name The traceback for the exception was written to the log file

去掉slam_methods:=cartgrapher后,运行成功

工作空间中下载turtlebot3源码:

git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
git clone https://github.com/ROBOTIS-GIT/turtlebot3.git
git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git

catkin_make 编译后
环境变量设置到.bashrc文件中,该变量会在不少launch文件中调用,且在仿真过程中会开几个终端,因此设置

echo "export TURTLEBOT3_MODEL=burger" >> ~/.bashrc

1、建图
运行

roslaunch turtlebot3_gazebo turtlebot3_world.launch

启动gmapping仿真,我是在这里出现问题的,slam_methods默认好像就是gmapping,最后赋值语句貌似可以不用

roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping

启动键盘控制节点

rosrun teleop_twist_keyboard teleop_twist_keyboard.py

控制小车将地图浏览个遍,然后执行下面的命令存图,后面~/map为保存的地图路径

rosrun map_server map_saver -f ~/map

2、运行
其中map_file:=$HOME/map.yaml为设置地图路径

roslaunch turtlebot3_gazebo turtlebot3_world.launch

roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/map.yaml

3、附加:
将turtlebot3_world.launch改为turtlebot3_house.launch再仿真一次

通过RVIZ 的 2D Nav Goal 设置目标点以及方向,这里等待十来秒,小车自行运动。

https://blog.csdn.net/qq_41821678/article/details/125763992
https://blog.csdn.net/qq_41821678/article/details/125711393
https://blog.csdn.net/gezongbo/article/details/123388655

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

【笔记】ubuntu18.04 ros melodic turtlebot3 源码下,导航gmapping仿真 的相关文章

随机推荐