Download presentation
Presentation is loading. Please wait.
1
http://robotics.usc.edu http://cres.usc.edu Nate Koenig 15 Sep 2004 Stage and Gazebo The Instant Expert’s Guide
2
2 Simulators When, why, how, what The right tool: Stage or Gazebo? Stage in depth Installation, usage Examples Gazebo in depth Installation and usage Examples Where to get help Overview
3
3 What Mimic the real world, to a certain extent When Always!! Why Save time and your sanity Experimentation much less destructive Use hardware you don’t have Create really cool videos How Someone has probably already done it, so use it Working with Simulators
4
4 Which Simulator? Stage 2D Sensor-based Player interface Kinematic O(1) ~ O(n) Large teams (100’s) Gazebo 3D Sensor-based Player Dynamic O(n) ~ O(n 3 ) Small teams (10’s)
5
5 The Big Picture Client Player Stage Gazebo Real Hardware Data Cmds TCP/UDP SHM
6
6 Stage
7
7 Stage: Environment Simulates mobile robots, sensors and objects on 2-D bitmapped environment
8
8 Stage: Models Designed for multi-agent autonomous research Each model simple (computationally cheap) Can simulate many such models
9
9 Stage: Control Control models via Player Simulated hardware appear as their real counterparts Easy transition between simulation and real world Supports a wide range of devices: Pioneers, laser, sonar, camera, pucks, etc.
10
10 Stage In Depth The result?
11
11 Stage: Worldfile Stage environment specified in a worldfile Describes the robots, sensors and objects Many examples provided in distribution
12
12 # the resolution of Stage's raytrace model in meters resolution 0.02 # GUI settings gui ( size [ 502.000 506.000 ] origin [5.018 4.950 0] scale 0.021 # the size of each bitmap pixel in meters ) # load a bitmapped environment from a file bitmap ( file "cave.pnm.gz" resolution 0.02 ) include "pioneer.inc“ # create a robot, set start position and Player port, and equip it with laser scanner position ( port 6665 pose [1.0 1.0 20] laser() ) # the resolution of Stage's raytrace model in meters resolution 0.02 # GUI settings gui ( size [ 502.000 506.000 ] origin [5.018 4.950 0] scale 0.021 # the size of each bitmap pixel in meters ) # load a bitmapped environment from a file bitmap ( file "cave.pnm.gz" resolution 0.02 ) include "pioneer.inc“ # create a robot, set start position and Player port, and equip it with laser scanner position ( port 6665 pose [1.0 1.0 20] laser() ) Example Stage Worldfile
13
13 Running Stage To run stage: Note: Stage automatically starts a player server Problem: abstract devices not implemented in Stage are needed. Such as VFH, or AMCL Solution: start another Player server using passthrough devices Passthrough devices send data/cmds between Player servers A secondary server can collect data from Player, and run abstract devices $ stage
14
14 Working With Stage Player localhost:8000 Controller (client) Controller (client) TCP/UDP Stage position:0 driver passthrough port 7000 laser:0 driver passthrough port 7000 position:0 driver vfh position_index 0 laser_index 0 port 7000 position:0 port 7000 laser:0 TCP/UDP
15
15 Gazebo
16
16 Gazebo: In Depth Simulates robots, sensors, and objects in a 3-D dynamic environment Generates realistic sensor feedback and physical interactions between objects
17
17 Gazebo In Depth Gazebo aims to be a high fidelity simulator Each model is NOT computationally cheap Small robot populations are possible. Dependent on number and type of robots
18
18 Exception to the rule
19
19 Gazebo Architecture
20
20 Gazebo Architecture
21
21 Gazebo Architecture
22
22 Gazebo Client Code Client code (your program), can interface to Gazebo in two ways libgazebo Shared Memory, direct interface Fast, but requires more work Player Simulation transparency Get all of Player’s goodies Easier, but with more computational overhead Recommended for most cases
23
23 Gazebo Architecture
24
24 Libgazebo Simple C library Treat as a blackbox Client and server must run on same machine Read sensor data and send commands to simulated devices Devices and Interfaces: Devices (Model), represent real world objects Pioneer2AT, SickLMS200 The objects within Gazebo simulation Interfaces are general specifications for entire classes of devices Position, Laser The programmatic hooks to devices
25
25 Gazebo Architecture
26
26 The World A world is composed of a model hierarchy Models define simulated devices Models can be nested Specifies how models are physically attached to one another Think of it as “bolting” one model to another robot1 laser1 0.10.0 0.2 robot1 laser1 0.10.0 0.2 Worldfile snippet: Pioneer with a sick laser attached Sick’s relative location to Pioneer
27
27 Gazebo Architecture
28
28 Models Each model contains a few key properties: Physical presence (optional): Body: sphere, box, composite shapes Kinematics: joints, velocities Dynamics: mass, friction, forces Appearance: color, texture Interface (optional): Control and feedback interface (libgazebo)
29
29 Types of Models Static Models: Built into Gazebo; statically linked into server In general such models added by lead developers Plugin Models: Shared objects loaded at runtime. Akin to linux kernel modules Recommended for new, experimental, third- party models Easier to build, faster code/compile/test cycle, source can be maintained in separate repository
30
30 Available Models Factory GarminGPS GroundPlane LightSource MapExtruder ObserverCam Pioneer2AT Pioneer2DX Pioneer2Gripper Pioneer2Sonars SegwayRMP SickLMS200 SimpleSolid SonyVID30 Terrain TruthWidget MapExtruder
31
31 Working with Player Steps to creating a simulation: Write Gazebo worldfile Start Gazebo Write corresponding Player configuration file Start Player Start client program Note: Gazebo must be started before Player Player must be re-started whenever Gazebo is restarted
32
32 Example: Using a single robot Single robot with a scanning laser range finder robot1_position 0 0 0.40 0 0 45 robot1_laser 0.15 0 0.20 0 0 0 robot1_position 0 0 0.40 0 0 45 robot1_laser 0.15 0 0.20 0 0 0 driver ( name "gz_position" devices ["position:0"] gz_id "robot1_position" ) driver ( name "gz_laser" devices ["laser:0"] gz_id "robot1_laser" ) driver ( name "gz_position" devices ["position:0"] gz_id "robot1_position" ) driver ( name "gz_laser" devices ["laser:0"] gz_id "robot1_laser" ) Gazebo world Player config
33
33 Example: Using a single robot Run Gazebo Run Player Now run your code $ gazebo $ player –g default
34
34 Source distributions from the Player/Stage website: http://playerstage.sourceforge.net/ No binary (pre-built) distributions Basic requirements: Posix-like OS (Linux, OS X) GCC Gazebo additional requirements: OpenGL with hardware acceleration Open Dynamics Engine (www.ode.org) Getting Player/Stage/Gazebo
35
35 To use Gazebo: Download, install: 1. librtk-src-2.2.0 2. gazebo-src-0.2.0 3. player-src-1.4rc1 To use Stage: Download, install 4. librtk-src-2.2.0 5. player-src-1.3.2 6. stage-src-1.3.2 Installing Packages
36
36 Where to get help: Your peers Player/Stage website Player/Stage/Gazebo mailing list archives Player/Stage/Gazebo mailing lists Getting Help
37
37 Questions?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.