==================[ Readings ]================== WATCH this talk (you may stop at the first half, as the second half is more hardware-oriented): "Sensor Fusion on Android Devices: A Revolution in Motion Processing", David Sachs, Google Tech Talks, 2010: https://www.youtube.com/watch?v=C7JQ7Rpwn2k - UI enabled by sensor fusion: 7:00--8:00 (watch this for project ideas) - Science of sensors: 8:40--15:20 - How sensor fusion works: 15:20--20:40 - Problems with integration and failure of double integration of acceleration for position: 23:20--27:45 "8.5m drift in one second for one degree of error in gravity direction" In class, we saw less drift: 1--2 meters in a second. The short animations of various MEMS motion sensor microstructures: 0:30--2:45 https://www.youtube.com/watch?v=eqZgxR6eRjo ==================[ Examples ]================== We had two in-class examples: PlumbBob and AccelIntegrator, both available in examples/ . PlumbBob used the Gravity sensor: https://developer.android.com/guide/topics/sensors/sensors_motion.html#sensors-motion-grav PlumbBob draws the projection of a plumb bob (https://en.wikipedia.org/wiki/Plumb_bob) onto the screen. "Projection" may sound like it needs some geometry, but is, in fact, trivial: the x and y components of the gravity sensor reading give us just that! It only remains to fit these to the size of the screen (see below for Canvas API). AccelIntegrator attempted to use the Linear Accelerometer: https://developer.android.com/guide/topics/sensors/sensors_motion.html#sensors-motion-linear READ for more types of sensors, such as significant motion, steps, etc. PlumbBob succeeded, whereas AccelIntegrator failed spectacularly, because double integration made sensor noise into strong sensor drift that overpowered all useful signal. See David Sachs' video around 23:20 for the explanation why. ==================[ Drawing custom figures ]================== PlumbBob extends a ViewGroup class (Layouts are derived from the same), and overrides the onDraw(..) function, with which all other Views such as Buttons, TextView, TextEdit, ImageView, etc. draw themselves. In our case, we just want a line and a circle. onDraw(..)'s argument, Canvas, knows how to draw these figures (and much more besides). READ https://developer.android.com/training/custom-views/custom-drawing.html It explains the design of this API on a much richer example; read PlumbBob's code for a minimal example. ==================[ Kalman filters ]================== Optional, for the mathematically inclined: https://en.wikipedia.org/wiki/Kalman_filter (See example Example application of a truck GPS) "An introduction to inertial navigation", Oliver J. Woodman http://www.cl.cam.ac.uk//techreports/UCAM-CL-TR-696.pdf http://www.bzarg.com/p/how-a-kalman-filter-works-in-pictures/