## For instruction on writing tutorials
## http://www.ros.org/wiki/WritingTutorials
####################################
##FILL ME IN
####################################
## for a custom note with links:
## note = 这个教程假设你已经完成了[[cn/ROS/Tutorials | ROS教程]],并且掌握了一些[[gazebo]]使用方法。 对于堆栈代码可以在[[cn/roch_simulator | roch_simulator]]找到。
## for the canned note of "This tutorial assumes that you have completed the previous tutorials:" just add the links
## note.0= 
## descriptive title for the tutorial
## title = 使用roch_gazebo包
## multi-line description to be displayed in search
## description = 这个教程提供了一个如何使用[[roch_gazebo|roch_gazebo]]包的指南。
## the next tutorial description (optional)
## next =
## links to next tutorial (optional)
## next.0.link= 
## next.1.link=
## what level user is this tutorial for
## level= BeginnerCategory
## keywords = [[gazebo]]
####################################

<<IncludeCSTemplate(TutorialCSHeaderTemplate)>>

<<TableOfContents(2)>>
这个教程假设你已经完成了[[cn/roch/Tutorials/Changing env of roch|改变Roch环境变量教程]]和[[cn/ROS/Tutorials | ROS教程]]。如果你还没有完成主要的[[cn/roch/Tutorials/Changing env of roch|改变Roch环境变量教程]],你应该首先查看。

对于现在我们开始使用[[roch_gazebo]]包,这里我们有一些例程如下。

== 例程 ==
在[[roch_gazebo]]包中,我们可以找到主要的''launch''文件,例如:'''''roch_playpen.launch'''''、'''''amcl_demo.launch'''''、'''''gmapping_demo.launch'''''。
=== Playpen ===
对于如何使用playpen launch文件,这有一些步骤:
{{{
  roslaunch roch_gazebo roch_playpen.launch
}}}
这个launch文件将运行[[gazebo|Gazebo]]、Roch模型和一些其他节点。
=== 控制Roch ===
基于Playpen,你可以通过键盘或操作杆来控制你的Roch,命令如下:
 * 键盘
  * {{{
  roslaunch roch_teleop keyboard_teleop.launch
}}}
 * 操作杆
  * {{{
  roslaunch roch_teleop logitech.launch
}}}
=== Gmapping ===
基于以上两个例程,现在你可以测试SLAM,例如Gmapping、hector等等。
{{{
  roslaunch roch_gazebo gmapping_demo.launch
}}}
在地图创建完成后,你可以运行以下命令用于保存我们之前控制Roch移动产生的地图,过程和[[cn/roch/Tutorials/Using package of roch_navigation|SLAM和roch_navigation]]一致。
{{{
  rosrun map_server map_saver -f <your_map_name>
}}}
=== AMCL ===
你Gazebo模拟器中,你可以基于你创建的地图进行导航,设置环境变量值'''''ROCH_GAZEBO_MAP_FILE '''''用于指向你创建的地图。
然后输入以下命令:
{{{
  roslaunch roch_gazebo amcl_demo.launch
}}}
如果你想要在Rviz查看更多信息,你可以输入以下命令。
{{{
  roslaunch roch_viz view_navigation.launch
}}}
步骤和[[cn/roch/Tutorials/Using package of roch_navigation|导航教程]]一致。
## AUTOGENERATED DO NOT DELETE
## TutorialCategory
## FILL IN THE STACK TUTORIAL CATEGORY HERE