ROS melodic turtlebot3建图导航仿真教程(精简版)

1. 安装ROS-Gazebo组件

sudo apt-get install ros-melodic-gazebo-ros-pkgs ros-melodic-gazebo-ros-control

2. 安装turtlebot

sudo apt-get install ros-melodic-turtlebot*

3. 配置文件

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

4. 启动仿真环境

roslaunch turtlebot3_gazebo turtlebot3_world.launch

5. 启动键盘控制节点

rosrun teleop_twist_keyboard teleop_twist_keyboard.py

6. 启动gmapping建图节点

roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping

7. 保存建立的静态地图

rosrun map_server map_saver -f ~/map

8. 启动navigation导航节点

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

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

如果想自己源码编译,怎么做呢?

1. 创建工作空间

mkdir -p turtlebot_ws/src
cd turtlebot_ws/src/
catkin_init_workspace 
cd ..
catkin_make

2. 下载源码包

cd src

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

3. 编译测试

cd ..
catkin_make
source devel/setup.bash

# 依次启动仿真、键盘控制、建图、保存地图、导航节点
roslaunch turtlebot3_gazebo turtlebot3_world.launch
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping
rosrun map_server map_saver -f ~/map
roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/map.yaml

如果想要自定义一些算法,修改参数测试,就可以从源码中turtlebot3修改,编译,测试验证。

  • 5
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值