960 likes | 1.18k Views
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 .
E N D
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.
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.
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.
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
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].
Particle Dynamics Implementation Derivative from previous velocity and from forces.
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)
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
Coordinates The body frame is shown translated and rotated into world space.
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.
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
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.
Acceleration • The acceleration of a rigid body depends on its various physical properties: • Inertia • Forces and Torques • Momentum
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.
Forces and Torques • Forces are applied to the body from contacts and the environment.
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)
State Vector • We’ve now defined the concepts necessary to describe the state of a body: position orientation linear momentum angular momentum
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.
Implementation We now know everything we need to make a rigid body.
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.
Implementation Continued Forces and torques are added to the system, and the derivative is saved.
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.
New Velocity, I-1, and Omega These variables are not directly part of the state, they are simply used in the calculation.
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
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…
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. 2D Graphics
Approximate Facet / Mesh Just surfaces Voxel Volume info Exact Wireframe Parametric Surface Solid Model CSG BRep Implicit Solid Modeling 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 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 Negatives 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 Positives when Representing 3D Objects
Two Major Types to Care About(for this class) • Mesh-based representations • Solid Models • As generated from CAD or modeling systems
3D Mesh File Formats Some common formats • STL • SMF • OpenInventor • VRML
Minimal • Vertex + Face • No colors, normals, or texture • Primarily used to demonstrate geometry algorithms
Full-Featured • Colors / Transparency • Vertex-Face Normals(optional, can be computed) • Scene Graph • Lights • Textures • Views and Navigation
Subdivision Surfaces • Coarse Mesh & Subdivision Rule • Define smooth surface as limit of sequence of algorithmic refinements
Simple Mesh Format (SMF) • Michael Garland http://graphics.cs.uiuc.edu/~garland/ • Triangle data • Vertex indices begin at 1
Stereolithography (STL) • Triangle data +Face Normal • The de-facto standard for rapid prototyping
Open Inventor • Developed by SGI • Predecessor to VRML • Scene Graph
Virtual Reality Modeling Language (VRML) • SGML Based • Scene-Graph • Full Featured
Issues with 3D “mesh” formats • Easy to acquire • Easy to render • Harder to model with • Error prone • split faces, holes, gaps, etc
3D solid model representations • Implicit models • Super/quadrics • Blobbies • Swept objects • Boundary representations • Spatial enumerations • Distance fields • Quadtrees/octrees • Stochastic models
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.
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
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
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