Size: 2333
Comment:
|
← Revision 48 as of 2014-11-11 19:16:11 ⇥
Size: 3490
Comment: The wiki location is an empty page, this is the new location of tutorials
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
## If this Tutorial is part of a multi-step tutorial, link to the other steps ## What does this tutorial teach? What Stacks/Packages/PR2 functionality/etc... does it address? ## If you're trying to teach them specific API calls, highlight what those are so they can focus on the important parts. ## If this tutorial builds upon code from a previous step, include a link to the necessary code ## Walk the user step-by-step through your tutorial. Include code snippets as appropriate to minimize the user's typing. ## Make sure that the user can tell which step they are on in case they lose track by providing clear details as to what they should see. ## Make sure that at the end of the tutorial the user can tell that they are done. ## Is there some command they can run that gives them specific output? ## Is there a screenshot of what they should see on their screen? |
#################################### ##FILL ME IN #################################### ## links to any required tutorials ## note.0= [[ROS/Tutorials|ROS tutorials]] ## descriptive title for the tutorial ## title = Installing and Starting Gazebo ## multi-line description to be displayed in search ## description = How to get Gazebo up and running. ## the next tutorial description (optional) ## next = ## links to next tutorial (optional) ## next.0.link=[[simulator_gazebo/Tutorials/SpawningObjectInSimulation|Spawn objects in the world]] ## next.1.link= ## what level user is this tutorial for ## level= BeginnerCategory ## domain_answers=answers.gazebosim.org #################################### <<IncludeCSTemplate(TutorialCSHeaderTemplate)>> <<TableOfContents(4)>> {{{#!wiki red/solid Users are highly discouraged from using the documentation and tutorials for Gazebo on this page. Gazebo is now a stand alone project at [[http://gazebosim.org/tutorials|gazebosim.org]]. See documentation there, thanks! }}} === Installation === [[ROS/Installation|Install ROS]] and get the simulator_gazebo package by (`%YOUR_ROS_DISTRO%` can be { `electric, `fuerte`, `groovy`} etc.): ## and download the [[Robots/PR2|personal robots repository]]. {{{ sudo apt-get install ros-%YOUR_ROS_DISTRO%-simulator-gazebo }}} Note: This does not work for the indigo distribution. Instead, try the following: {{{ sudo apt-get install ros-indigo-simulators }}} === Launching Gazebo === Setup ros environment variables: {{{ source /opt/ros/%YOUR_ROS_DISTRO%/setup.bash }}} The standard Gazebo launch file is started using: {{{ roslaunch gazebo_worlds empty_world.launch }}} Except in the case of Indigo, where the launch file is started using: {{{ roslaunch gazebo_ros empty_world.launch }}} This should start the simulator and open up a GUI window that looks like this: ## {{attachment:simulator_gazebo/Tutorials/empty_world_cturtle.jpg}} <<BR>> {{attachment:simulator_gazebo/Tutorials/gazebo_12Dec_1.png}} <<BR>> [[gazebo/InteractingWithGUI|*see here for Box-Turtle GUI interaction keys]]. If your system does not have [[simulator_gazebo/SystemRequirements|sufficient graphics support]], you can [[simulator_gazebo/Tutorials/RunningSimulatorHeadless|run gazebo headless]]. |
Line 12: | Line 65: |
||<#CCE0FF> '''Note:''' This series of tutorials assumes that you have installed, and have basic knowledge of, ROS. || === Setting up and starting Gazebo === Follow [[simulator_gazebo/Installation| installation instructions here]]. Then, |
==== Launch Script Explained ==== Looking at the [[gazebo_worlds]]/launch/empty_world.launch, |
Line 18: | Line 68: |
roslaunch `rospack find gazebo`/launch/empty_world.launch | <launch> <!-- start gazebo with an empty plane --> <param name="/use_sim_time" value="true" /> <node name="gazebo" pkg="gazebo" type="gazebo" args="$(find gazebo_worlds)/worlds/empty.world" respawn="false" output="screen"/> </launch> |
Line 20: | Line 74: |
This should start the simulator and open up a GUI window that looks like this, {{attachment:simulator_gazebo/Tutorials/empty_world.jpg}} <<BR>> You can move around in the GUI using the mouse: * Left mouse button + drag: rotates the camera viewing angle. * Middle mouse button + drag / scroll wheel: zoom. * Right mouse button + drag: pans the camera view. Looking at the [[https://personalrobots.svn.sf.net/svnroot/personalrobots/pkg/trunk/stacks/simulator_gazebo/gazebo/launch/empty_world.launch|launch file]], it simply starts the Gazebo executable with a world file (empty.world). The world file is where basic features of the world can be customized, such as physics parameters, ground plane and lighting. For most uses, the standard world file loaded by empty_world.launch should be sufficient. The ROS parameter '''/use_sim_time''' tells all nodes to use the '''/time''' ROS topic rather than system time. |
The script simply starts the Gazebo executable with a default world file (`empty.world`). The world file is where you can customize basic features of the simulator, such as physics engine parameters, ground plane textures, lighting and etc. For most users, the standard world file loaded by empty_world.launch should suffice. The ROS parameter '''/use_sim_time''' triggers ROS time to use the simulation time in the '''/clock''' ROS topic published by gazebo rather than the system wall clock time, see [[Clock#A.2BAC8-use_sim_time_parameter|here]] for more details. |
Line 33: | Line 80: |
'''Next Tutorial:''' simulator_gazebo/Tutorials/AddingObjectsToTheWorld | '''Next Tutorial:''' [[simulator_gazebo/Tutorials/SpawningObjectInSimulation|Spawn objects in the world]] |
Note: This tutorial assumes that you have completed the previous tutorials: ROS tutorials. |
![]() |
Installing and Starting Gazebo
Description: How to get Gazebo up and running.Tutorial Level: BEGINNER
Next Tutorial: Spawn objects in the world
Users are highly discouraged from using the documentation and tutorials for Gazebo on this page. Gazebo is now a stand alone project at gazebosim.org. See documentation there, thanks!
Installation
Install ROS and get the simulator_gazebo package by (%YOUR_ROS_DISTRO% can be { electric, fuerte, groovy`} etc.):
sudo apt-get install ros-%YOUR_ROS_DISTRO%-simulator-gazebo
Note: This does not work for the indigo distribution. Instead, try the following:
sudo apt-get install ros-indigo-simulators
Launching Gazebo
Setup ros environment variables:
source /opt/ros/%YOUR_ROS_DISTRO%/setup.bash
The standard Gazebo launch file is started using:
roslaunch gazebo_worlds empty_world.launch
Except in the case of Indigo, where the launch file is started using:
roslaunch gazebo_ros empty_world.launch
This should start the simulator and open up a GUI window that looks like this:
*see here for Box-Turtle GUI interaction keys.
If your system does not have sufficient graphics support, you can run gazebo headless.
Launch Script Explained
Looking at the gazebo_worlds/launch/empty_world.launch,
<launch> <!-- start gazebo with an empty plane --> <param name="/use_sim_time" value="true" /> <node name="gazebo" pkg="gazebo" type="gazebo" args="$(find gazebo_worlds)/worlds/empty.world" respawn="false" output="screen"/> </launch>
The script simply starts the Gazebo executable with a default world file (empty.world). The world file is where you can customize basic features of the simulator, such as physics engine parameters, ground plane textures, lighting and etc. For most users, the standard world file loaded by empty_world.launch should suffice. The ROS parameter /use_sim_time triggers ROS time to use the simulation time in the /clock ROS topic published by gazebo rather than the system wall clock time, see here for more details.
Next Tutorial: Spawn objects in the world