23
Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in GazeboSteven Peters (scpeters), John Hsu (hsu)

ROSCon 2014

Page 2: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

OutlineDARPA Virtual Robotics Challenge

Overview of the Open Source Gazebo Simulator

Physics Engines in Gazebo

Benchmark Physics Tests

Robotic Walking Task

Conclusion

Page 3: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

DARPA Virtual Robotics ChallengeDisaster first responder scenario: what is needed to fight fires?

Drive a utility vehicle (ie. water truck).Walk across various terrains.Thread a fire hose into standpipe.

Page 5: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

Gazebo Simulator: Overview and PurposeGoal: Best possible substitute for physical robot

Architecture:

Use cases: Design and testing of robot components and control Software testing and verification Competitions

Physics Sensors Interfaces GUI

gazebosim.org

Page 6: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

Open Source Physics Engines in Gazebo

Open Dynamics Engine

Bullet

Simbody

DART

bitbucket.org/odedevs/odeRobotics, gaming

github.com/bulletphysics/bullet3Gaming, animation, Sony, AMD, Google

github.com/simbody/simbodyBiomechanics, Stanford

github.com/dartsim/dartRobotics, animation, Georgia Tech

Page 7: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

Open Source Physics Engines in GazeboEasy to switch between physics engines (gazebo 3.0+)

Command line option:gazebo -e {bullet|dart|ode|simbody}

Attribute in sdf world file:<world><physics type=”simbody” />...

gazebo4 package includes support for Bullet, ODE, and Simbody(Dart requires building from source)from packages.osrfoundation.org:sudo apt-get install ros-indigo-gazebo4-ros-pkgs

Page 8: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

Physics engine differences: coordinate representationConsider double pendulum:

Maximal coordinates (ODE, Bullet):12 degrees of freedom, 10 constraintsSparse 12x12 mass matrixAccuracy depends on constraint solver

Generalized coordinates (Simbody, DART):2 degrees of freedom, no constraintsDense 2x2 mass matrixKinematics implicit in formulation

θ1

θ2

x1,y1,z1

r1,p1,y1

x2,y2,z2

r2,p2,y2

Page 9: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

Physics engine differences: spring / damper numericsExplicit spring damper

Velocity (i+1) depends on states (i)

Implicit spring damperVelocity (i+1) depends on states (i+1)

Explicit: easier to computeImplicit: numerically stable

m

k

b x

xi+1 = xi + 1/m (− kxi − bxi)

xi+1 = xi + 1/m (− kxi+1 − bxi+1)

Page 10: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

Features: DART ODE Bullet Simbody

Contact Rigid / Impulse Rigid / Impulse Rigid / Impulse Rigid / Forcevariable step size

Joint Damping Implicit Explicit or Implicit** in our fork of ODE Explicit Implicit

Coordinates Generalized MaximalMaximal

Generalized not yet supported by Gazebo

Generalized

Physics engine differences: summary

Page 11: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

Comparing physics engines: benchmark tests

Complexity

Scenario to simulateModel, initial conditions, disturbances, control inputsExpected behavior

Choose parameters to varyTime step size, number of objects, solver iterations

Performance metricsAccuracy, computational speed

Simple modelsKnown solutions

Robot walking???

Page 12: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

Benchmark 1: Free-floating rigid bodiesModel: boxes 1x4x9

Free-floatingConstant gravity field

Initial conditions:Largest angular velocity about axisof size 4 (leads to tumbling)

Expected behavior:Parabolic trajectory of center of mass (c.m.)Angular momentum conserved in world frame

https://vimeo.com/105581956

4

9

1

9c.m.

Page 13: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

Benchmark 1: Free-floating rigid bodiesParameters:

Solver time step size (s)Number of boxes

Performance metrics:Center of mass position error (max)Angular momentum error (max)Computational time per box

https://vimeo.com/105581956

Page 14: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

Benchmark 2: mass-spring oscillatorsModel:

Rigid bodies connected to world withprismatic joints

Spring force acting on rigid bodiesDisturbance torque τ applied

Expected behavior:Sinusoidal trajectoryNo angular deviation

https://vimeo.com/105581955

mk

x

τ

Page 15: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

Benchmark 2: mass-spring oscillatorsParameters:

Solver time step size (s)ODE constraint solver iterations

Performance metrics:Position errorAngular constraint satisfaction

https://vimeo.com/105581955

Explicit springunstable for largetime steps

Page 16: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

Benchmark 3: object stackingBoxes stacked with large inertia ratio

Static equilibriumVariable inertia ratio

MetricsPosition / velocity errorComputational speed

ODE Bullet DART Simbody

0.4 0.5 1.1 >100

Time ratio (real / sim)

Page 17: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

Benchmark 4: robot walkingModel:

Atlas humanoid robot from Boston DynamicsWalking on flat ground using black-box controller

Parameters:Solver time step size (s)ODE constraint solver iterations

Expected behavior:Expect walking without falling overComplex scenario, no exact solution

Page 18: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

Robotic walking task: speed comparison

https://vimeo.com/105584932

Page 19: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

Robotic walking task: superimposed

http://vimeo.com/84443645

Page 20: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

Robotic walking task: analysisTrajectories look similarHard to say more without validation

ODE parameter studyIterations vs error vs speed

Page 21: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

Physics engine differences: summary

Features: DART ODE Bullet Simbody

Contact Rigid / Impulse Rigid / Impulse Rigid / Impulse Rigid / Forcevariable step size

Joint Damping Implicit Explicit or Implicit** in our fork of ODE Explicit Implicit

Coordinates Generalized MaximalMaximal

Generalized not yet supported by Gazebo

Generalized

Page 22: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

Future WorkTest more solver parameters (factorial!)

Benchmark problems of intermediate complexity

Common data formats to reproduce benchmarks outside Gazebo

Plugin architecture for Gazebo physics

Validation

gazebosim.org

Page 23: Steven Peters (scpeters), John Hsu (hsu) · Comparison of Rigid Body Dynamic Simulators for Robotic Simulation in Gazebo Steven Peters (scpeters), John Hsu (hsu) ROSCon 2014

OSRF Sponsors