AIM
|
#include <CarryDevice.h>
Public Member Functions | |
CarryDevice (std::string name=MODULE_NAME) | |
void | doTick () |
void | addData (const AIMData &data) |
AIMValue | setProperty (const std::string &key, AIMValue value) |
void | setProperties (const std::map< std::string, AIMValue > &properties) |
std::map< std::string, AIMValue > & | getProperties () |
Public Member Functions inherited from AIM | |
AIM (std::string name="") | |
AIM (const AIM &other) | |
AIM & | operator= (const AIM &rhs) |
virtual void | addDataSubscriber (const std::string &key, AIM *subscriber) |
virtual void | removeDataSubscriber (const std::string &key) |
virtual AIMValue | getProperty (std::string key) const |
virtual void | sendData () |
virtual std::string | exportProperties () |
virtual std::vector< std::pair < std::string, AIMValue > > | getOutputData (bool clear_output=false) |
virtual std::vector< std::pair < std::string, AIMValue > > | getInputData (bool clear_input=false) |
virtual AIM * | getDataSubscriber (std::string subscriber) |
virtual std::string | getName () const |
virtual std::vector< AIMValue > | getRequirements () const |
virtual bool | requirementsAreUpdated (bool reset=true) const |
Static Public Attributes | |
static const std::string | SENSOR_ACCELEROMETER_EVENT = "accelerometer event" |
static const std::string | PROP_SENSOREVENT_ACC = "SensorEvent Accelerometer" |
static const std::string | PROP_TIME_WINDOW = "time window" |
static const std::string | PROP_LAST_VALUES = "last values" |
static const std::string | PROP_MAX_LAST_ACTION_TIME = "max last action time" |
static const std::string | PROP_LAST_ACTION_TIME = "last action time" |
static const std::string | PROP_LAST_OUTPUT = "last output" |
static const std::string | PROP_CAMERA0_LIMITS = "camera 0 limits" |
static const std::string | PROP_CAMERA1_LIMITS = "camera 1 limits" |
static const std::string | PROP_FEATURE_NORMALIZATION = "normalization feature" |
static const std::string | FEATURE_NORMALIZATION_STD = "standard score normalization" |
static const std::string | FEATURE_NORMALIZATION_MINMAX = "min max normalization" |
static const std::string | MODULE_NAME = "carry_device" |
Static Public Attributes inherited from AIM | |
static const std::string | VERSION = AIM_VERSION |
Additional Inherited Members | |
Public Types inherited from AIM | |
typedef std::pair< std::string, AIMValue > | AIMData |
typedef std::queue< AIMData > | AIMDataQueue |
typedef std::queue< AIMValue > | AIMValueQueue |
typedef std::map< std::string, AIMValueQueue > | InputDataQueue |
Protected Member Functions inherited from AIM | |
void | setDataSubscribers (const std::map< std::string, AIM * > &subscribers) |
void | setInputDataQueue (const InputDataQueue &inputDataQueue) |
void | setOutputDataQueue (const AIMDataQueue &outputDataQueue) |
Protected Attributes inherited from AIM | |
std::string | name |
std::vector< AIMValue > | requirements |
bool | requirementsUpdated |
std::map< std::string, AIM * > | dataSubscribers |
std::map< std::string, AIMValue > | properties |
InputDataQueue | inputDataQueue |
AIMDataQueue | outputDataQueue |
Created on: March 20, 2013 Author: Ted Schmidt
This is wrapper class for the Carry Device Module
This module recognizes whether the device is being carried by the user or not.
This module returns a value with:
{"carried":true} when the device is recently:
used, moved or has a proximity change.
{"carried":true, "in hand":true} when the device is recently:
used
{"carried":true, "on body":true} when the device is recently:
moved, has low proximity, has low light
else it returns:
{"carried":false}
As AIMData input it needs the key:values
{"accelerometer":{"value":{"x-axis":9.81, "y-axis":0.1, "z-axis":9.81}, "date":12345678.11}} float acceleration value
{"accelerometer_burst":{"value":{"header": "x,y,z","hz": 50,"values": [[9.81,0.1,9.81],[9.80,0,9.80]]}, "date":12345678.11}} float acceleration values
{"light":{"value":{"lux":11}, "date":12345678.11}} integer lux
{"screen activity":{"value":{"screen":"on"}, "date":12345678.11}} string can either be on or off
{"proximity":{"value":0.06, "date":12345678.11}} integer in meters
{"call state":{"value":{"state":"idle"}, "date":12345678.11}} string can either be calling, ringing, idle, dialing
{"battery":{"value":{"status":"charging ac"}, "date":12345678.11}} string can either be charging ac, charging usb, discharging, full
CarryDevice::CarryDevice | ( | std::string | name = MODULE_NAME | ) |
CarryDevice constructor
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.
|
virtual |
Add data
This method adds data to the input queue of the AI-module The AIMData object
AIMData | data The input data |
Reimplemented from AIM.
|
virtual |
Do an AIM tick
This method is called to tick the AI-module to do its processing. During this tick the AI module grabs it's input data, does its processing, and sends the data to its data receivers. This method can be used in combination with AIM priorities, to streamline the data flow and timers for timed AI modules.
Reimplemented from AIM.
|
virtual |
Return the module and submodule properties
Reimplemented from AIM.
|
virtual |
Set the module properties
Set the defined properties. Old property values will remain if no new values are specified for a property.
map | properties The properties to set |
Set the properties for this module and for each submodule
Reimplemented from AIM.
Set a property value
To set a property value for the sensor event module use the key PROP_SENSOREVENT_ACC.
Set the properties
Reimplemented from AIM.
|
static |
Feature type for the normalization feature: min max
|
static |
Feature type for the normalization feature: standard score / z-score
|
static |
Name of the this module
|
static |
Property key for the measured limits of camera 0
|
static |
Property key for the measured limits of camera 1
|
static |
Property key for the normalization feature
property for the normalization feature
|
static |
Property key for the timestamp of the last action/state change
|
static |
Property key for the last output action/state
|
static |
Property key for the last values
|
static |
Property key for the max time to return on body if there's no state change
|
static |
Property key of the sensor event module
|
static |
Property key for the time window
|
static |
Input name of the accelerometer event sensor