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

编写本笔记原因:
源码编译没问题,但是在运行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

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值