An application developer-focused introduction to the underlying sensor system design considerations and their impact on your Android application. Common problems discussed and solved.
3. Established
or Innovative Product?
Established Innovation-Driven
• Will I be making another • Do I have new sensors
new product in 6 types?
months? • Are features more
• Is the reference design important than release
considered good enough date?
for the application? • Are money and
resources no
problem?
7/15/2012 Costillo- OSCON 2012 3
5. Going On Your Own
• If you make your own, • But…
– You’re on your own – power ↓
– Integration pains – Control code size
– Test time ↑ – Control mechanical
– Gesture testing footprint
becomes a challenge – In-house expertise
– Calibration blues
– Larger mechanical
footprint
7/15/2012 Costillo- OSCON 2012 5
10. Wake up events and power
considerations
Application Internal External
Processor only Coprocessor Processor
D C
Reference supported Reference supported More processor selection
Most power hungry Most work done for More outcome control
you Most customized
Footprint impact
7/15/2012 Costillo- OSCON 2012 10
11. Hardware Summary
Power Latency =
Consumption Max(sensorsn)
Sensor
= Σ sensorsn + + dedicated
Solution
any dedicated processing
processor time
• Use tie-breaker criteria
7/15/2012 Costillo- OSCON 2012 11
14. Application
Frameworks
Libraries
Linux Kernel
LIBRARIES AND
SERVICES Hardware
7/15/2012 Costillo- OSCON 2012 14
15. Sensor HAL and Services
• HAL
device/<vendor>/<board name>/libsensors
• Service
frameworks/base/services/sensorservice
• Manager
frameworks/base/libs/gui
7/15/2012 Costillo- OSCON 2012
15
29. Bias
• Problem: Data is off
by a constant value.
• Sources:
– static calibration
failure
• Solutions:
– Calculate linear
offset at start of
application
– Recalibrate locally
7/15/2012 Costillo- OSCON 2012 29
30. Drift
• Problem: Shift of
data without cause
• Sources:
– Magnetic
interference
– Poor HW calibration
• Solutions:
– Increase smoothing
techniques
7/15/2012 Costillo- OSCON 2012 30
31. Settling Time
• Problem: Extended
time before
finalized steady
data.
• Sources:
– Latency
– Sensitivity
• Solutions:
– Limit additional
processing
7/15/2012 Costillo- OSCON 2012 31
32. Noise
• Problem: Data jumps
around constantly
• Sources:
– Sensor
– Calibration
– Poor filtering
• Solutions:
– High pass filter
– Linear averaging
– FFT
7/15/2012 Costillo- OSCON 2012 32
34. Best Practices in
Application Development
• Select the right sensor for the job.
• Use the Correct Data Rate.
– UI or GAMING are the most common.
• Use Sensor In Context
• Customize for your hardware and system
capabilities
• Magnetometer-based sensors are the most
touchy.
• Keep the Gesture UI simple.
7/15/2012 Costillo- OSCON 2012 34