+ All Categories
Home > Documents > Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection.

Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection.

Date post: 22-Dec-2015
Category:
Upload: angel-hampton
View: 221 times
Download: 2 times
Share this document with a friend
Popular Tags:
94
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.

Simulation of Robotic Systems

Particle Dynamics, Rigid Body Dynamics, Collision Detection

Page 2: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection.

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.

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.

Designing a Stair Climbing Robot

Page 5: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection.

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.

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.

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.

Particle Dynamics Implementation

Derivative fromprevious velocityand from forces.

Page 9: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Star Operator

Page 26: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection.

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.

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.

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.

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.

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.

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.

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.

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.

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.

3D Mesh File Formats

Some common formats STL

SMF

OpenInventor

VRML

Page 36: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection.

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.

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.

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.

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.

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.

How STL Works

           

                                                                                              

                     

                                    

                                                                                                                   

                                              

                                                                             

Page 42: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection.

Open Inventor

Developed by SGI Predecessor to VRML

– Scene Graph

Page 43: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection.

Virtual Reality Modeling Language (VRML)

SGML Based

Scene-Graph

Full Featured

Page 44: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection.

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.

Solid Representations

Page 46: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection.

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.

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.

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.

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.

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.

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.

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.

Spatial Occupancy Enumerations

Page 54: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Loops Colliding

Page 64: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection.

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.

Useful Geometric Concepts

Convex Hull

Convex Decomposition

Voronoi Regions

Page 66: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection.

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.

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.

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.

Voronoi Diagram

Page 70: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection.

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.

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.

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.

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.

Some Minkowski Differences

A B

A B

Page 75: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

BVH-Based Collision Detection

Page 90: Simulation of Robotic Systems Particle Dynamics, Rigid Body Dynamics, Collision Detection.

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.

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.

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.

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.

Ethics Revisited

"I hear its horrible brushes at night." -Graney

Roomba Violates All Three Laws Of Roombotics

-The Onion


Recommended