simulation of robotic systems particle dynamics, rigid body dynamics, collision detection
TRANSCRIPT
![Page 1: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/1.jpg)
Simulation of Robotic Systems
Particle Dynamics, Rigid Body Dynamics, Collision Detection
![Page 2: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/2.jpg)
To Simulate…
Is to use a model of real system for experimentation.
For robots, these models are typically implemented using kinematics or dynamics.– Unlike kinematics, dynamics involves the changes
of velocity over time, which raises issues such as momentum, forces and torques, inertia, and mass.
![Page 3: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/3.jpg)
Why Simulate?
Test a robotic system away from the dangers and unpredictability of the natural world.– Robotic systems are costly, and could be
damaged during testing.– Difficult to reach terrain can be simulated virtually.
Open up robotics questions to computational processes and searches.
Explore the design options.
![Page 4: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/4.jpg)
Designing a Stair Climbing Robot
![Page 5: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/5.jpg)
Articulated Body Forward Dynamics
Articulated Body: Series of rigid links connected by joints.
Forward Dynamics: Given a set of forces and torques on the joints, calculate accelerations and trajectories.
![Page 6: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/6.jpg)
Initial Value Problems
An initial value problem is one in which we want to trace an unknown function given its starting state and how it changes.
They are solved using ordinary differential equations of the form
![Page 7: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/7.jpg)
Particle Dynamics
The movement of a particle can be calculated by the above method.
To get a first order ODE, we need to work in phase space, the space composed of position and velocity.
The derivative of the state is then [v, F/m].
![Page 8: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/8.jpg)
Particle Dynamics Implementation
Derivative fromprevious velocityand from forces.
![Page 9: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/9.jpg)
Rigid Body Dynamics
Algorithm Overview:state = Initialize()for (t = 0; t < t_final; t += time_step)
ClearForces(state)AccumulateForces(state, t)derivative = Derive(state)Scale(derivative, time_step)Add(state, derivative)
![Page 10: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/10.jpg)
Rigid Bodies
Rigid bodies represent all objects in the Rigid Body Dynamics simulation.
Each rigid body is a non-deformable shape. – The distance between any two points is constant.
Rigid bodies have an orientation:– Angular state– Angular velocity– Angular accelerations
![Page 11: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/11.jpg)
Coordinates
The body frame is shown translated and rotated into world space.
![Page 12: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/12.jpg)
Position and Orientation
The translation of the body’s basis gives it its position, a vector from the world origin to the body’s center of mass.
The rotation of the body’s basis gives it its orientation, a matrix in which each column corresponds to the new orientation of one of the basis axes.
![Page 13: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/13.jpg)
Velocity
We’re interested in how the position and orientation of the bodies change over time.– Linear velocity:– Angular velocity:
The direction of (t) gives the axis
The magnitude of (t) gives the speed
![Page 14: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/14.jpg)
Change of Orientation
The instantaneous change in the vector r(t) is (t) x r(t). This expands easily to the rotation matrix as a whole.
![Page 15: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/15.jpg)
Acceleration
The acceleration of a rigid body depends on its various physical properties:– Inertia – Forces and Torques– Momentum
![Page 16: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/16.jpg)
Inertia
3x3 matrix describing how the shape and mass distribution of the body affects the relationship between the angular velocity and the angular momentum I(t)
Similar to mass – like rotational mass.
![Page 17: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/17.jpg)
Forces and Torques
Forces are applied to the body from contacts and the environment.
![Page 18: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/18.jpg)
Momentum, Angular and Linear
Linear momentum– P(t) = m v(t)– dP(t)/dt = m a(t) = F(t)
Angular Momentum– L(t) = I(t) (t) (t) = I(t)-1 L(t)– It can be shown that dL(t)/dt = (t)
![Page 19: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/19.jpg)
State Vector
We’ve now defined the concepts necessary to describe the state of a body:
positionorientationlinear momentumangular
momentum
![Page 20: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/20.jpg)
Derivative of State Vector
Now that we have a state vector and its derivative defined, we can use the same approach we used for the 2D initial value problem.
![Page 21: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/21.jpg)
Implementation
We now know everything we need to make a rigid body.
![Page 22: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/22.jpg)
Implementation Contitued
This simulation runs for 10 seconds with a time step of 1/30 of a second.
The ode function works the same way as the one described for the initial value problem, we just need to define dydt.
![Page 23: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/23.jpg)
Implementation Continued
Forces and torques are added to the system, and the derivative is saved.
![Page 24: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/24.jpg)
Implementation Continued
The derivative vector is filled in:
Velocity comes from the current state.
dR(t)/dt is calculated with omega(t) and R(t), both known, and saved.
Forces and torques are added.
![Page 25: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/25.jpg)
Star Operator
![Page 26: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/26.jpg)
New Velocity, I-1, and Omega
These variables are not directly part of the state, they are simply used in the calculation.
![Page 27: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/27.jpg)
Collision Detection
Given two object, how would you check: – If they intersect with each other while moving?– If they do not interpenetrate each other, how far
are they apart?– If they overlap, how much is the amount of
penetration
![Page 28: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/28.jpg)
Classes of Objects & Problems
– 2D vs. 3D– Convex vs. Non-Convex– Polygonal vs. Non-Polygonal– Open surfaces vs. Closed volumes– Geometric vs. Volumetric– Rigid vs. Non-rigid (deformable/flexible)– Pairwise vs. Multiple (N-Body)– CSG vs. B-Rep– Static vs. Dynamic
And so on…
![Page 29: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/29.jpg)
2D Graphics
Raster:
Pixels– X11 bitmap, XBM– X11 pixmap, XPM– GIF– TIFF– PNG– JPG
Lossy, jaggies when transforming, good for photos.
Vector:
Drawing instructions– Postscript– CGM– Fig– DWG
Non-lossy, smooth when scaling, good for line art and diagrams.
![Page 30: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/30.jpg)
Representing 3D Objects
Approximate– Facet / Mesh
Just surfaces
– Voxel Volume info
Exact– Wireframe– Parametric Surface– Solid Model
CSG BRep Implicit Solid Modeling
![Page 31: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/31.jpg)
Representing 3D Objects
Exact– Precise model of
object topology– Mathematically
represent all geometry
Approximate– A discretization of
the 3D object– Use simple
primitives to model topology and geometry
![Page 32: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/32.jpg)
Negatives when Representing 3D Objects
Exact– Complex data structures– Expensive algorithms– Wide variety of formats,
each with subtle nuances– Hard to acquire data– Translation required for
rendering
Approximate– Lossy– Data structure sizes can get
HUGE, if you want good fidelity
– Easy to break (i.e. cracks can appear)
– Not good for certain applications
Lots of interpolation and guess work
![Page 33: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/33.jpg)
Positives when Representing 3D Objects
Exact– Precision
Simulation, modeling, etc– Lots of modeling
environments– Physical properties– Many applications (tool path
generation, motion, etc.)– Compact
Approximate– Easy to implement– Easy to acquire
3D scanner, CT
– Easy to render Direct mapping to the
graphics pipeline
– Lots of algorithms
![Page 34: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/34.jpg)
Two Major Types to Care About(for this class)
Mesh-based representations Solid Models
– As generated from CAD or modeling systems
![Page 35: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/35.jpg)
3D Mesh File Formats
Some common formats STL
SMF
OpenInventor
VRML
![Page 36: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/36.jpg)
Minimal
Vertex + Face
No colors, normals, or texture
Primarily used to demonstrate geometry algorithms
![Page 37: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/37.jpg)
Full-Featured
Colors / Transparency Vertex-Face Normals
(optional, can be computed)
Scene Graph Lights Textures Views and Navigation
![Page 38: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/38.jpg)
Subdivision Surfaces
Coarse Mesh & Subdivision Rule– Define smooth surface as limit of sequence of
algorithmic refinements
![Page 39: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/39.jpg)
Simple Mesh Format (SMF)
Michael Garland http://graphics.cs.uiuc.edu/~garland/
Triangle data
Vertex indices begin at 1
![Page 40: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/40.jpg)
Stereolithography (STL)
Triangle data +Face Normal
The de-facto standard for rapid prototyping
![Page 41: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/41.jpg)
How STL Works
![Page 42: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/42.jpg)
Open Inventor
Developed by SGI Predecessor to VRML
– Scene Graph
![Page 43: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/43.jpg)
Virtual Reality Modeling Language (VRML)
SGML Based
Scene-Graph
Full Featured
![Page 44: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/44.jpg)
Issues with 3D “mesh” formats
Easy to acquire Easy to render Harder to model with Error prone
– split faces, holes, gaps, etc
![Page 45: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/45.jpg)
Solid Representations
![Page 46: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/46.jpg)
3D solid model representations
Implicit models Super/quadrics Blobbies Swept objects Boundary representations Spatial enumerations Distance fields Quadtrees/octrees Stochastic models
![Page 47: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/47.jpg)
Boundary Representation Solid Modeling
The de facto standard for CAD since ~1987– BReps integrated into CAGD surfaces + analytic
surfaces + boolean modeling
Models are defined by their boundaries Topological and geometric integrity
constraints are enforced for the boundaries– Faces meet at shared edges, vertices are shared,
etc.
![Page 48: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/48.jpg)
Solids and Solid Modeling
Solid modeling introduces a mathematical theory of solid shape– Domain of objects– Set of operations on the domain of objects– Representation that is
Unambiguous Accurate Unique Compact Efficient
![Page 49: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/49.jpg)
Solid Objects and Operations
Solids are point sets– Boundary and interior
Point sets can be operated on with boolean algebra (union, intersect, etc)
Foley/VanDam, 1990/1994
![Page 50: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/50.jpg)
Solid Object Definitions
Boundary points– Points where distance to the object and the
object’s complement is zero
Interior points– All the other points in the object
Closure– Union of interior points and boundary points
![Page 51: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/51.jpg)
State of the Art: BRep Solid Modeling
… but much more than polyhedra Two main (commercial) alternatives
– All NURBS, all the time Pro/E, SDRC, …
– Analytic surfaces + parametric surfaces + NURBS + …. all stitched together at edges
Parasolid, ACIS, …
![Page 52: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/52.jpg)
Issues in Boundary Representation Solid Modeling
Very complex data structures– NURBS-based winged-edges, etc
Complex algorithms– manipulation, booleans, collision detection
Robustness Integrity Translation Features Constraints and Parametrics
![Page 53: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/53.jpg)
Spatial Occupancy Enumerations
![Page 54: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/54.jpg)
Spatial Occupancy Enumeration
Brute force– A grid
Pixels– Picture elements
Voxels– Volume elements
Quadtrees– 2D representation
Octrees– 3D representation– Extension of quadtrees
![Page 55: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/55.jpg)
Brute Force Spatial Occupancy Enumeration
Impose a 2D/3D grid– Like graph paper or
sugar cubes
Identify occupied cells Problems
– High fidelity requires many cells
“Modified”– Partial occupancy
Foley/VanDam, 1990/1994
![Page 56: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/56.jpg)
Quadtree
Hierarchically represent spatial occupancy
Tree with four regions– NE, NW, SE, SW– “dark” if occupied
Foley/VanDam, 1990/1994
![Page 57: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/57.jpg)
Octree
8 octants 3D space– Left, Right, Up, Down,
Front, Back
Foley/VanDam, 1990/1994
![Page 58: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/58.jpg)
Applications for Spatial Occupancy Enumeration
Many different applications
– GIS– Medical– Engineering Simulation– Volume Rendering– Video Gaming– Approximating real-world
data– ….
![Page 59: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/59.jpg)
Issues with Spatial Occupancy Enumeration
Approximate– Kind of like faceting a surface, discretizing 3D
space– Operationally, the combinatorics (as opposed to
the numerics) can be challenging– Not as good for applications wanting exact
computation (e.g. tool path programming)
![Page 60: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/60.jpg)
Other Techniques: Surface Models
Basic idea:– Represent a model as a set of faces/patches
Limitations:– Topological integrity; how do faces “line up”?;
which way is ‘inside’/ ‘outside’?
Used in many CAD applications– Why? They are fine for drafting and rendering,
not as good for creating true physical models
![Page 61: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/61.jpg)
Other Techniques:Implicit Solid Modeling
Computer Algebra meets CAD Idea:
– Represents solid as the set of points where an implicit global function takes on certain value
F(x,y,z) < val
– Primitive solids are combined using CSG – Composition operations are implemented by
functionals which provide an implicit function for the resulting solid
From M.Ganter, D. Storti, G. Turkiyyah @ UW
![Page 62: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/62.jpg)
Collision Detection
Where do the forces mentioned above come from?– Motors– Gravity– Joints– Collisions
Collision Detection is the process of discovering whether objects have intersected and, if so, how much they interpenetrated.
![Page 63: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/63.jpg)
Loops Colliding
![Page 64: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/64.jpg)
Basics
Check for edge-edge intersection in 2D
(Check for edge-face intersection in 3D) Check every point of A inside of B & every point
of B inside of A Check for pair-wise edge-edge intersections
![Page 65: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/65.jpg)
Useful Geometric Concepts
Convex Hull
Convex Decomposition
Voronoi Regions
![Page 66: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/66.jpg)
Convex Hull
The convex hull of a set S is the intersection of all convex sets that contains S.
The convex hull of S is the smallest convex polygon that contains S and that the extreme points of S are just the corners of that polygon.
Solving the convex hull problem implicitly solves the extreme point problem.
![Page 67: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/67.jpg)
Convex Decomposition
The process to divide up a non-convex polyhedron into pieces of convex polyhedra
Optimal convex decomposition of general non-convex polyhedra can be NP-hard.
To partition a non-degenerate simple polyhedron takes O((n + r2) log r) time, where n is the number of vertices and r is the number of reflex edges of the original non-convex object.
In general, a non-convex polyhedron of n vertices can be partitioned into O(n2) convex pieces.
![Page 68: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/68.jpg)
Voronoi Diagram
Given a set S of n points in R2 , for each point pi in S, there is the set of points (x, y) in the plane that are closer to pi than any other point in S, called Voronoi polygons. The collection of n Voronoi polygons given the n points in the set S is the "Voronoi diagram", Vor(S), of the point set S.
Intuition: To partition the plane into regions, each of these is the set of points that are closer to a point pi in S than any other. The partition is based on the set of closest points, e.g. bisectors that have 2 or 3 closest points.
![Page 69: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/69.jpg)
Voronoi Diagram
![Page 70: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/70.jpg)
Voronoi Regions
A Voronoi region associated with a feature is a set of points that are closer to that feature than any other.
FACTS:– The Voronoi regions form a partition of space outside
of the polyhedron according to the closest feature. – The collection of Voronoi regions of each polyhedron is
the generalized Voronoi diagram of the polyhedron. – The generalized Voronoi diagram of a convex
polyhedron has linear size and consists of polyhedral regions. And, all Voronoi regions are convex.
![Page 71: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/71.jpg)
Voronoi Marching
Basic Ideas: Coherence: local geometry does not change much,
when computations repetitively performed over successive small time intervals
Locality: to "track" the pair of closest features between 2 moving convex polygons(polyhedra) w/ Voronoi regions
Performance: expected constant running time, independent of the geometric complexity
![Page 72: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/72.jpg)
2D Example
Objects A & B and their Voronoi regions: P1 and P2 are the pair of closest points between A and B. Note P1 and P2 lie within the Voronoi regions of each other.
A
B
P1
P2
![Page 73: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/73.jpg)
Minkowski Sums/Differences
Minkowski Sum (A, B) = { a + b | a A, b B } Minkowski Diff (A, B) = { a - b | a A, b B } A and B collide iff Minkowski Difference(A,B)
contains the point 0.
![Page 74: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/74.jpg)
Some Minkowski Differences
A B
A B
![Page 75: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/75.jpg)
Minkowski Difference & Translation
Minkowski-Diff(Trans(A, t1), Trans(B, t2)) = Trans(Minkowski-Diff(A,B), t1 - t2)
Trans(A, t1) and Trans(B, t2) intersect iff Minkowski-Diff(A,B) contains point (t2 - t1).
![Page 76: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/76.jpg)
Properties
Distance– distance(A,B) = min a A, b B || a - b ||2– distance(A,B) = min c Minkowski-Diff(A,B) || c ||2– if A and B disjoint, c is a point on boundary of Minkowski
difference
Penetration Depth – pd(A,B) = min{ || t ||2 | A Translated(B,t) = }– pd(A,B) = mint Minkowski-Diff(A,B) || t ||2 – if A and B intersect, t is a point on boundary of Minkowski
difference
![Page 77: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/77.jpg)
Practicality
Expensive to compute boundary of Minkowski difference:– For convex polyhedra, Minkowski difference may
take O(n2)– For general polyhedra, no known algorithm of
complexity less than O(n6) is known
![Page 78: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/78.jpg)
General Methods
Decompose into convex pieces, and take minimum over all pairs of pieces:– Optimal (minimal) model decomposition is NP-
hard. – Approximation algorithms exist for closed solids,
but what about a list of triangles?
Collection of triangles/polygons:– n*m pairs of triangles - brute force expensive– Hierarchical representations used to accelerate
minimum finding
![Page 79: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/79.jpg)
Hierarchical Representations
Two Common Types:– Bounding Volume Hierarchies – trees of spheres, ellipses, cubes,
axis-aligned bounding boxes (AABBs), oriented bounding boxes (OBBs), K-dop, SSV, etc.
– Spatial Decomposition - BSP, K-d trees, octrees, MSP tree, R-trees, grids/cells, space-time bounds, etc.
Do very well in “rejection tests”, when objects are far apart.
Performance may slow down, when the two objects are in close proximity and can have multiple contacts .
![Page 80: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/80.jpg)
BVH vs. Spatial Partitioning
BVH: SP:- Object centric - Space centric
- Spatial redundancy - Object redundancy
![Page 81: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/81.jpg)
BVH vs. Spatial Partitioning
BVH: SP:- Object centric - Space centric
- Spatial redundancy - Object redundancy
![Page 82: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/82.jpg)
BVH vs. Spatial Partitioning
BVH: SP:- Object centric - Space centric
- Spatial redundancy - Object redundancy
![Page 83: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/83.jpg)
BVH vs. Spatial Partitioning
BVH: SP:- Object centric - Space centric
- Spatial redundancy - Object redundancy
![Page 84: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/84.jpg)
Spatial Data Structures & Subdivision
Many others……
Uniform Spatial Sub Quadtree/Octree kd-tree BSP-tree
![Page 85: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/85.jpg)
Uniform Spatial Subdivision
Decompose the objects (the entire simulated environment) into identical cells arranged in a fixed, regular grids (equal size boxes or voxels)
To represent an object, only need to decide which cells are occupied. To perform collision detection, check if any cell is occupied by two object
Storage: to represent an object at resolution of n voxels per dimension requires upto n3 cells
![Page 86: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/86.jpg)
Octrees
Quadtree is derived by subdividing a 2D-plane in both dimensions to form quadrants
Octrees are a 3D-extension of quadtree
Use divide-and-conquer
Reduce storage requirements (in comparison to grids/voxels)
![Page 87: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/87.jpg)
Bounding Volume Hierarchies
Model Hierarchy: – each node has a simple volume that bounds a set of
triangles – children contain volumes that each bound a different portion
of the parent’s triangles – The leaves of the hierarchy usually contain individual
triangles
A binary bounding volume hierarchy:
![Page 88: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/88.jpg)
Type of Bounding Volumes
Spheres Ellipsoids Axis-Aligned Bounding Boxes (AABB) Oriented Bounding Boxes (OBBs) Convex Hulls k-Discrete Orientation Polytopes (k-dop) Spherical Shells Swept-Sphere Volumes (SSVs)
– Point Swept Spheres (PSS)– Line Swept Spheres (LSS)– Rectangle Swept Spheres (RSS)– Triangle Swept Spheres (TSS)
![Page 89: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/89.jpg)
BVH-Based Collision Detection
![Page 90: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/90.jpg)
Collision Detection using BVH
1. Check for collision between two parent nodes (starting from the roots of two given trees)
2. If there is no interference between two parents, 3. Then stop and report “no collision”4. Else All children of one parent node are checked against all children of the other node5. If there is a collision between the children6. Then If at leave nodes7. Then report “collision”8. Else go to Step 49. Else stop and report “no collision”
![Page 91: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/91.jpg)
Separating Axis Theorem
The separating axis theorem tells us that, given two convex shapes, if we can find an axis along which the projection of the two shapes does not overlap, then the shapes don't overlap.
![Page 92: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/92.jpg)
Seperating Axis Theorem
Two polytopes A and B are disjoint iff there exists a separating axis which is perpendicular to a face from either or perpedicular to an edge from each.
![Page 93: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/93.jpg)
Responding to Collisions
Two ways to deal with collision:– penalty-force: use spring forces to pull objects out
of collision.– impulse-based: use instantaneous impulses
(changes in velocity) to prevent objects from interpenetrating.
Find the time of collisionwithin some epsilon.
Change the object velocities at this time, accounting for bounce and friction as desired.
![Page 94: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection](https://reader030.vdocuments.us/reader030/viewer/2022032705/56649d935503460f94a7a424/html5/thumbnails/94.jpg)
Ethics Revisited
"I hear its horrible brushes at night." -Graney
Roomba Violates All Three Laws Of Roombotics
-The Onion