Cortex Android
 All Classes Namespaces Functions Variables
nl.sense_os.cortex.CarryDeviceSensor Class Reference
Inheritance diagram for nl.sense_os.cortex.CarryDeviceSensor:

Public Member Functions

 CarryDeviceSensor (String name, SensePlatform sensePlatform)
 
 CarryDeviceSensor (SensePlatform sensePlatform)
 
void setInterval (double interval)
 
void setTimeWindow (double time_window)
 
void setEventThreshold (double threshold)
 
void reCalibrate ()
 
void onNewData (SensorDataPoint dataPoint)
 

Protected Member Functions

void setup ()
 

Detailed Description

The CarryDevice module recognizes whether the device is being carried by the user or not.
This module returns:
{"carried":1} when the device is recently:
used, moved or has a proximity change.
{"in hand":1} when the device has:
( high motion variance ) and ( is used or has high light values)
{"on body":1} when the device has:
low proximity and light readings and is moved and not used
else
{"carried":0}
The module will compute an output Based on the time window as interval.
This DataProcessor requires the following sensors/settings:
SensorNames.ACCELEROMETER
SensorNames.PROXIMITY
SensorNames.SCREEN_ACTIVITY
SensorNames.LIGHT
SensorNames.CALL_STATE
SensorNames.BATTERY_SENSOR
SensorNames.CAMERA_LIGHT
Motion sensing enabled
PhoneState sensing enabled
Ambience sensing enabled

Author
Ted Schmidt ted@s.nosp@m.ense.nosp@m.-os.n.nosp@m.l

Copyright (c) 2013 Sense Observation Systems BV. All rights reserved.

Constructor & Destructor Documentation

nl.sense_os.cortex.CarryDeviceSensor.CarryDeviceSensor ( String  name,
SensePlatform  sensePlatform 
)

CarryDevice constructor

A CarryDevice data producer will be registered at the Sense Service
under the name supplied with this constructor.
To receive data from this DataProducer, subscription should be done at the Sense Service with the given name.
The DataProcessor persists its state based on the supplied name.
Re-creating a CarryDevice DataProducer with the same name will load its previous settings.
By default it sets the time window of this module to 60 seconds.
The time window for the sensor event module used for triggering on motion events is set to 60*5 seconds.
The threshold value of the sensor event module is set to 0.005, it can have a value between 0-1.
Where 0 is the lowest variance encountered for the sensor and 1 the highest.
The maximum time it will return the on body state when no new events have occurred is set to PROP_MAX_LAST_ACTION_TIME = 60*15 seconds.

Parameters
sensePlatformThe SensePlatform
nameThe name of the data processor. Should be unique.
nl.sense_os.cortex.CarryDeviceSensor.CarryDeviceSensor ( SensePlatform  sensePlatform)

CarryDevice constructor

A CarryDevice data producer will be registered at the Sense Service

See Also
CarryDeviceSensor(String name, SensePlatform sensePlatform)
Parameters
sensePlatformThe SensePlatform

Member Function Documentation

void nl.sense_os.cortex.CarryDeviceSensor.onNewData ( SensorDataPoint  dataPoint)

On new data

This method receives data from the sensors to which the DataProcessor is subscribed

Parameters
dataPointThe SensorDataPoint coming from the subscribed sensor
void nl.sense_os.cortex.CarryDeviceSensor.reCalibrate ( )

Re-calibrate the module

This method removes the learned lowest variance for acceleration sensor.

void nl.sense_os.cortex.CarryDeviceSensor.setEventThreshold ( double  threshold)

Set the event threshold

This method sets the threshold for when a change in sensor data is seen as noise or as an event.

The default 0.05 = 5% higher then noise

Parameters
thresholddouble threshold value between 0-1
void nl.sense_os.cortex.CarryDeviceSensor.setInterval ( double  interval)

Set the interval

This method sets the interval at which to do the computation whether the device is carried. The default is 60 seconds. Setting the interval will reset the time window

Parameters
intervalin seconds
void nl.sense_os.cortex.CarryDeviceSensor.setTimeWindow ( double  time_window)

Set the time window

This method sets the time window used for auto calibrating the accelerometer. The default value is 10% larger than the interval. Setting the interval will reset the time window

Parameters
time_windowdouble The time window used for calibration
void nl.sense_os.cortex.CarryDeviceSensor.setup ( )
protected

Setup the sensor

This method sets the input sensor and the initial settings


The documentation for this class was generated from the following file: