3d simulation in ros
TRANSCRIPT
Intro Gazebo Gazebo in ROS Examples
3D Simulation in ROS
Mihai Emanuel Dolha
Intelligent Autonomous SystemsTechnische Universität München
November 4, 2010
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Outline
1. Introduction
2. Gazebo
3. Gazebo in ROS
4. Examples
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Outline
1. Introduction
2. Gazebo
3. Gazebo in ROS
4. Examples
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Why do we use simulators? (1/2)
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Why do we use simulators?(2/2)
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
3D Simulator Components
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
3D Simulator Components
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
3D Simulator Components
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
3D Simulator Components
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Outline
1. Introduction
2. Gazebo
3. Gazebo in ROS
4. Examples
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Gazebo
I 3D multi robot simulator with dynamicsI part of the Player/Stage project
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Physics Engine(s)
I currently supported: ODE, Bullet
I rigid body dynamicsI based on Newton’s second law:
~F = m~aI constraint formulationI collision detectionI accelerations, velocities and
poses
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Physics Engine(s)
I currently supported: ODE, BulletI rigid body dynamics
I based on Newton’s second law:~F = m~a
I constraint formulationI collision detectionI accelerations, velocities and
poses
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Physics Engine(s)
I currently supported: ODE, BulletI rigid body dynamicsI based on Newton’s second law:
~F = m~a
I constraint formulationI collision detectionI accelerations, velocities and
poses
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Physics Engine(s)
I currently supported: ODE, BulletI rigid body dynamicsI based on Newton’s second law:
~F = m~aI constraint formulation
I collision detectionI accelerations, velocities and
poses
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Physics Engine(s)
I currently supported: ODE, BulletI rigid body dynamicsI based on Newton’s second law:
~F = m~aI constraint formulationI collision detection
I accelerations, velocities andposes
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Physics Engine(s)
I currently supported: ODE, BulletI rigid body dynamicsI based on Newton’s second law:
~F = m~aI constraint formulationI collision detectionI accelerations, velocities and
poses
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Physics Engine(s)
I ConstraintsI jointsI contacts
I Collision detectionI continuous or discreteI broad phase and narrow phase
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Rendering Engine
Ogre3DI Object-Oriented Graphics
Rendering EngineI based on OpenGL
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Modelling in Gazebo
Gazebo modelI other modelsI bodies
I pose,massI geometries
I collision shapeI visual shape
I sensorsI jointsI controllers
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Sensors in Gazebo
Laser sensorsI provided by physics
engineI raycastingI zero sweeping
durationI noise freeI real world data is
much more cluttered
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Sensors in Gazebo
CamerasI provided by
rendering engineI ideal pinhole
camerasI noise free and in
focusI no calibration
neededI real world like
texturing, shadingand lighting requireeffort
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Modeling in Gazebo
World files
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Communication in Gazebo
Controllers and interfaces
I clients write commands on interfacesI controllers get commands from interfacesI commands are processed, then applied to simulated modelI current model status and results are send to client
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Communication in Gazebo
Controllers and interfacesI clients write commands on interfaces
I controllers get commands from interfacesI commands are processed, then applied to simulated modelI current model status and results are send to client
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Communication in Gazebo
Controllers and interfacesI clients write commands on interfacesI controllers get commands from interfaces
I commands are processed, then applied to simulated modelI current model status and results are send to client
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Communication in Gazebo
Controllers and interfacesI clients write commands on interfacesI controllers get commands from interfacesI commands are processed, then applied to simulated model
I current model status and results are send to client
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Communication in Gazebo
Controllers and interfacesI clients write commands on interfacesI controllers get commands from interfacesI commands are processed, then applied to simulated modelI current model status and results are send to client
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Outline
1. Introduction
2. Gazebo
3. Gazebo in ROS
4. Examples
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Overview
I stack:simulator_gazebo
I actively maintainedand developed
I improved modelingmechanism
I integrated in theROS comunicationmechanisms
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Modeling using URDF
I URDF Description:
< robot name=" t e s t _ r o b o t ">< l i n k name=" l i n k 1 " / >< l i n k name=" l i n k 2 " / >< l i n k name=" l i n k 3 " / >< l i n k name=" l i n k 4 " / >
< j o i n t name=" j o i n t 1 " type="cont inuous ">
<parent l i n k =" l i n k 1 " / >< c h i l d l i n k =" l i n k 2 " / >
< / j o i n t >
< j o i n t name=" j o i n t 2 " type="cont inuous ">
<parent l i n k =" l i n k 1 " / >< c h i l d l i n k =" l i n k 3 " / >
< / j o i n t >
< j o i n t name=" j o i n t 3 " type="cont inuous ">
<parent l i n k =" l i n k 3 " / >< c h i l d l i n k =" l i n k 4 " / >
< / j o i n t >< / robot>
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Modeling
I Gazebo URDF extension
<gazebo re ference=" f i nge r_ t i p_camera_ l i nk "><sensor:camera name=" f inger_t ip_camera_sensor ">
<imageSize>640 480< / imageSize><imageFormat>L8< / imageFormat><hfov>90< / hfov><nearCl ip>0.01< / nearCl ip>< f a r C l i p >100< / f a r C l i p ><updateRate>20.0< / updateRate><con t ro l l e r : r os_camera name=" f i n g e r _ t i p _ c a m e r a _ c o n t r o l l e r " p lug in ="
l ibros_camera . so "><alwaysOn> t rue < / alwaysOn><updateRate>20.0< / updateRate><topicName>f inger_ t ip_cam / image< / topicName><frameName> f i nge r_ t i p_camera_ l i nk < / frameName>< in te r face :camera name=" f i nge r_ t i p_camera_ i face " / >
< / con t ro l l e r : r os_camera >< / sensor:camera>< t u r n G r a v i t y O f f > t rue < / t u r n G r a v i t y O f f >< ma te r i a l >PR2/ Blue< / ma te r i a l >
< / gazebo>
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Modeling
I Loading a URDF model in Gazebo
<launch>
< !−− send pr2 u rd f to param server −−><param name=" r o b o t _ d e s c r i p t i o n " command=" $( f i n d xacro ) / xacro . py ’ $ ( f i n d
p r2_desc r i p t i on ) / robots / pr2 . u rd f . xacro ’ " / >
< !−− push r o b o t _ d e s c r i p t i o n to f a c t o r y and spawn robot i n gazebo −−><node name=" pr2_gazebo_model " pkg=" gazebo " type=" spawn_model " args=" $( optenv
ROBOT_INITIAL_POSE) −unpause −u rd f −param r o b o t _ d e s c r i p t i o n −model pr2 "respawn=" f a l s e " output= " screen " / >
< / launch>
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Communication & Control
I robot description on parameter serverI the controller manager:
I loads controllersI creates a robot state object
I client nodes publish their commands on topicsI controllers read the topics, process the command and
push it to the robot stateI the controller manager gets the commands from the robot
state and sends them to the hardware or to the simulatedmodel
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Communication & Control
I robot description on parameter server
I the controller manager:I loads controllersI creates a robot state object
I client nodes publish their commands on topicsI controllers read the topics, process the command and
push it to the robot stateI the controller manager gets the commands from the robot
state and sends them to the hardware or to the simulatedmodel
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Communication & Control
I robot description on parameter serverI the controller manager:
I loads controllersI creates a robot state object
I client nodes publish their commands on topicsI controllers read the topics, process the command and
push it to the robot stateI the controller manager gets the commands from the robot
state and sends them to the hardware or to the simulatedmodel
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Communication & Control
I robot description on parameter serverI the controller manager:
I loads controllers
I creates a robot state objectI client nodes publish their commands on topicsI controllers read the topics, process the command and
push it to the robot stateI the controller manager gets the commands from the robot
state and sends them to the hardware or to the simulatedmodel
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Communication & Control
I robot description on parameter serverI the controller manager:
I loads controllersI creates a robot state object
I client nodes publish their commands on topicsI controllers read the topics, process the command and
push it to the robot stateI the controller manager gets the commands from the robot
state and sends them to the hardware or to the simulatedmodel
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Communication & Control
I robot description on parameter serverI the controller manager:
I loads controllersI creates a robot state object
I client nodes publish their commands on topics
I controllers read the topics, process the command andpush it to the robot state
I the controller manager gets the commands from the robotstate and sends them to the hardware or to the simulatedmodel
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Communication & Control
I robot description on parameter serverI the controller manager:
I loads controllersI creates a robot state object
I client nodes publish their commands on topicsI controllers read the topics, process the command and
push it to the robot state
I the controller manager gets the commands from the robotstate and sends them to the hardware or to the simulatedmodel
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Communication & Control
I robot description on parameter serverI the controller manager:
I loads controllersI creates a robot state object
I client nodes publish their commands on topicsI controllers read the topics, process the command and
push it to the robot stateI the controller manager gets the commands from the robot
state and sends them to the hardware or to the simulatedmodel
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Communication & Control
I pr2_teleop publishes commands on topic(/base_contrller/command)
I base_controller computes commands for each wheel andupdates the commands on the robot state
I the gazebo_ros_controller_manager checks the robotstate for commands and sends them to the joints of thesimulated model
I for controlling the real hardware: pr2_controller_managerI real world / simulator switching is done by the env. var.
ROBOT
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Outline
1. Introduction
2. Gazebo
3. Gazebo in ROS
4. Examples
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
The PR2 pluging in
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Naive physics simulation
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Naive physics simulation
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Human character simulation
November 4, 2010
3D Simulation Mihai Emanuel Dolha
Intro Gazebo Gazebo in ROS Examples
Thank you
Questions?
November 4, 2010
3D Simulation Mihai Emanuel Dolha