CS378 - Mobile Computing Sensing and Sensors Part 2.

Slides:



Advertisements
Similar presentations
Android Application Development Tutorial. Topics Lecture 4 Overview Overview of Sensors Programming Tutorial 1: Tracking location with GPS and Google.
Advertisements

TouchDevelop Chapter 5-7 Chapter 5 Audio Chapter 6 Camera, Graphics and Video Chapter 7 Sensors Mengfei Ren.
Implementing Mobile Learning – Technical process Pete Stockley, 2012.
Cosc 5/4730 Input Keyboard, touch, and Accelerometer.
Get Moving With Core Motion!
Real-Time Sensing on Android Reliable Mobile Systems Group Fiji Systems Inc. Yin Yan, Shaun Cosgrove, Ethan Blanton, Steven Y. Ko, Lukasz Ziarek
Introduction to Smartphone Sensors
Android sensors.
The Accelerometer and Gyroscope
CS378 - Mobile Computing Sensing and Sensors. Sensors "I should have paid more attention in Physics 41" Most devices have built in sensors to measure.
CS378 - Mobile Computing Sensing and Sensors. Sensors "I should have paid more attention in Physics 41" Most devices have built in sensors to measure.
Android Sensors & Async Callbacks Jules White Bradley Dept. of Electrical and Computer Engineering Virginia Tech
Android Apps: Look and Feel Module 6, Intro to I.T., Fall 2011 Sam Scott.
Motion Capture Hardware
Lecture # 9 Hardware Sensor. Topics 2  SensorManger & Sensor  SensorEvent & SensorEventListener  Example Application.
Sensing. Possible sensors on devices – Documented in SensorEvent class Accelerometer (m/s 2 ) – acceleration in x, y, z axes Magnetic Field (micro Tesla)
Doodlz App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
DUE Hello World on the Android Platform.
DUE Introduction to the Android Platform Working Connections 2011.
1 CMSC 628: Introduction to Mobile Computing Nilanjan Banerjee Introduction to Mobile Computing University of Maryland Baltimore County
CS378 - Mobile Computing More UI - Part 2. Special Menus Two special application menus – options menu – context menu Options menu replaced by action bar.
DImpack By Chau Ngo EEL 6788 Spring Outline Problem Statement/Motivation Software Overview Demo Technical Difficulties Lessons Learned Improvements.
Goal: To understand Magnetism Objectives: 1)To examine Magnetic fields and field lines 2)To understand Why magnetic fields are important for the earth.
23/10/2015 E.R.Edwards 23/10/2015 Staffordshire University School of Computing Introduction to Android Sensors.
Sensors – Part I SE 395/595.
Chapter 8: Rotational Kinematics Essential Concepts and Summary.
Chapter 8 Rotational Kinematics. Radians Angular Displacement  Angle through which something is rotated  Counterclockwise => positive(+) Units => radians.
Inertial Navigation System Overview – Mechanization Equation
Touchdevelop api api gyroscope measure device rotation rate Disclaimer: This document is provided “as-is”. Information and views expressed in this document,
ADCS Review – Attitude Determination Prof. Der-Ming Ma, Ph.D. Dept. of Aerospace Engineering Tamkang University.
Sensors in android. App being more applicable Keeping track of your heart beat while jogging. Pointing the phone camera towards the night sky to know.
CS378 - Mobile Computing Audio.
Objective: To develop a fully-autonomous control system for the Q-ball based on onboard IMU/Magnetometer/Ultrasound sensory information Summer Internship.
CS378 - Mobile Computing More UI - Part 2. Special Menus Two special application menus – options menu – context menu Options menu replaced by action bar.
Sensors Nasrullah Khan Niazi. Using Device Sensors The Android SDK provides access to raw data from sensors on the device.The sensors,and their precision.
Sensors For Mobile Phones  Ambient Light Sensor  Proximity Sensor  GPS Receiver Sensor  Gyroscope Sensor  Barometer Sensor  Accelerometer Sensor.
6.111 Final Project A motion sensor baseball game By Chris Falling and JinHock Ong.
CS378 - Mobile Computing Sensing and Sensors Part 2.
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors Date: Feb 11, 2016.
Daniel Moth Principal PM Manager Visual Studio Emulator for Android.
PHY 101: Lecture Rotational Motion and Angular Displacement 8.2 Angular Velocity and Angular Acceleration 8.3 The Equations of Rotational Kinematics.
Accelerometer based motion gestures for mobile devices Presented by – Neel Parikh Advisor Committee members Dr. Chris Pollett Dr. Robert Chun Dr. Mark.
CPE 490/590 – Smartphone Development
How to Use an Android Tablet Well Come To You few Steps For How to Use an Android Tablet?
CHAPTER 8 Sensors and Camera. Chapter objectives: Understand Motion Sensors, Environmental Sensors and Positional Sensors Learn how to acquire measurement.
CS371m - Mobile Computing Sensing and Sensors.
The Doodlz app enables you to paint by dragging one or more fingers across the screen. The app provides options for setting the drawing color.
Android Android Sensors Android Sensors: – Accelerometer – Gravity sensor – Linear Acceleration sensor – Magnetic Field sensor – Orientation.
Sensors in Android.
Vijay Kumar Kolagani Dr. Yingcai Xiao
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors
North Attleboro High School
Android Application Audio 1.
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors.
APK Downloader
Walk n’ Play Group #8 - Team Murali Krishna Goli Viswanath Patimalla
What's Happening Today Working with Images
Emulator.
Sensors, maps and fragments:
Vijay Kumar Kolagani Dr. Yingcai Xiao
CS499 – Mobile Application Development
CS371m - Mobile Computing Sensing and Sensors.
Vijay Kumar Kolagani Dr. Yingcai Xiao
Inertial Measurement Unit (IMU) Basics
Android Topics Sensors Accelerometer and the Coordinate System
Android Programming Tutorial
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors.
Rotational Motion Let’s begin with Rotational Kinematics!!
Mobile Programming Sensors in Android.
Mobile Programming Dr. Mohsin Ali Memon.
Presentation transcript:

CS378 - Mobile Computing Sensing and Sensors Part 2

Using Sensors Recall basics for using a Sensor: – Obtain the SensorManager object – create a SensorEventListener for SensorEvents logic that responds to sensor event – Register the sensor listener with a Sensor via the SensorManager 2

Sensor Best Practices Unregister sensor listeners – when done with Sensor or activity using sensor paused (onPause method) – sensorManager. unregisterListener(sensorListener) – otherwise data still sent and battery resources continue to be used 3

Sensors Best Practices verify sensor available before using it use getSensorList method and type ensure list is not empty before trying to register a listener with a sensor 4

Sensors Best Practices Avoid deprecated sensors and methods TYPE_ORIENTATION and TYPE_TEMPERATURE are deprecated as of Ice Cream Sandwich 5

Sensors Best Practices Don't block the onSensorChanged() method – recall the resolution on sensors – 50 updates a second for onSensorChange method not uncommon – when registering listener update is only a hint and may be ignored – if necessary save event and do work in another thread or asynch task 6

Sensor Best Practices Testing on the emulator Android SDK doesn't provide any simulated sensors 3 rd party sensor emulator 7

SensorSimulator Download the Sensor Simulator tool Start Sensor Simulator program Install SensorSimulator apk on the emulator Start app, connect simulator to emulator, start app that requires sensor data Must modify app so it uses Sensor Simulator library 8

Sensor Simulator 9

Mouse in Sensor Simulator controls device, feeds sensor data to emulator Can also record sensor data from real device and play back on emulator 10

Sensing Orientation Orientation of the device x - tangential to ground and points roughly east y - tangential to the ground and points towards magnetic north z perpendicular to the ground and points towards the sky 11

Orientation Sensor Deprecated Instead register listener(s) with ACCELEROMETER and MAGNETIC_FIELD sensors in the onSensorChanged method – pull values from SensorEvent for accelerator event or magnetic field event – accelerometer 3 values, acceleration in x, y, z directions – magnetic field, ambient magnetic field in x, y, and z axis 12

Orientation Sensor with values from accelerometer and magnetic field obtain a rotation matrix method in SensorManager transforms from device coordinate system to world coordinate system finally, call getOrientation with rotation matrix and array to store result 13

Result of getOrientation method writes to array of floats 3 values [0] -> azimuth, rotation around the z axis [1] -> pitch, rotation around the x axis [2] -> roll, rotation around the y axis angles in radians, positive in counter clockwise direction 14 notice positive x and z flipped

Demo OrientationTestActivity 15

Sensor Sample - Moving Ball Place ball in middle of screen Ball has position, velocity, and acceleration acceleration based on linear acceleration sensor update over time, based on equations of motion, but fudged to suit application 16

Sensor Sample - Moving Ball Gross Simplification velocity set equal to acceleration 17

Sensor Sample - Moving Ball Alternate Implementation position updated in separate thread which redraws the view 18

Sensor Sample Draw lines for x and y velocities 19

Sensor Sample - TBBT Inspired by and 20

TBBT Sound Effect App 21

Responding to Events 22

Changing Images Use of an Image View Initial Image set in onCreate new image set in onSensorChange register listener with MediaPlayer on completion reset image 23