turtlebot学习笔记(二)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/FLORIDA_tang/article/details/79880308

修改world
进入turtlebot_gazebo包

roscd turtlebot_gazebo

/opt/ros/kinetic/share/turtlebot_gazebo

tree
.
├── cmake
│   ├── turtlebot_gazeboConfig.cmake
│   └── turtlebot_gazeboConfig-version.cmake
├── launch
│   ├── amcl_demo.launch
│   ├── gmapping_demo.launch
│   ├── includes
│   │   ├── create.launch.xml
│   │   ├── kobuki.launch.xml
│   │   └── roomba.launch.xml
│   └── turtlebot_world.launch
├── maps
│   ├── playground.pgm
│   └── playground.yaml
├── package.xml
└── worlds
    ├── corridor.world
    ├── empty.world
    └── playground.world

在* turtlebot_world.launch*文件中, 通过加载gazebo_ros包中的empty.launch启动Gazebo, 通过名为world_name 的参数可以修改仿真的Gazebo环境.

sudo vim turtlebot_world.launch 

<arg name="world_name" value="$(arg world_file)"/>

修改为自己的环境

<arg name="world_name" value="$(find turtlebot_gazebo)/worlds/you_world_name.world"/>

建图
启动建图功能.必须启动该功能,机器人才能建图.

roslaunch turtlebot_gazebo gmapping_demo.launch

启动Rviz查看建图过程.最好用下面的方式来启动Rviz,使用rosrun rviz rviz命令来启动会出问题.

roslaunch turtlebot_rviz_launchers view_navigation.launch

当然,为了建图,需要移动Turtlebot.所以我们需要启动键盘控制.

roslaunch turtlebot_teleop keyboard_teleop.launch

这里写图片描述

猜你喜欢

转载自blog.csdn.net/FLORIDA_tang/article/details/79880308