-
Notifications
You must be signed in to change notification settings - Fork 91
Detection & Interaction
User detection and interaction are two state machines which allow us to monitor when temi has detected a person and when a user is interacting with temi.
To make use of these state machines temi has to have the Detection Mode turned on, see integration instructions below. In Detection mode temi will:
- Constantly look for users
- Distance 0.8 meter in frame of RGB camera
- If there is more than 1 user - pick the closest one and the most center one
temi will start the Detection mode session if Launcher in a state without user interaction and movement, and your skill can listen for the events from that via this feature and according it to do what you want temi to do.
For more information on the detection and interaction state machines see below the Listeners section.
Note: There's a Welcoming Mode app already developed that would satisfy most B2B needs, and can provide a good reference for anyone who like to develop an app using the welcoming abilities.
| Return | Method | Description |
|---|---|---|
| void | setDetectionModeOn(boolean on) | Turn on(off) detection mode |
| void | setDetectionModeOn(boolean on, float distance) | Turn on detection mode with the maximum dection distance |
| Interface | Description |
|---|---|
| OnDetectionStateChangedListener | Detection mode state changed listener |
| OnUserInteractionChangedListener | User interaction state changed listener |
| OnDetectionDataChangedListener | Detection mode data changed listener |
| Model | Description |
|---|---|
| DetectionData | Detection data in detection mode |
To configure the skill can use Detection mode you must take the following steps:
-
The skill should be a Kiosk Mode skill first. Please learn how to configure skill into a Kiosk Mode from here.
-
Return temi and go to Settings > General Settings > Turn on the Tracking User.
-
Return to home page.
-
Compile and run your skill.
Use this method to turn on (off) the detection mode. If use this method to turn on the detection mode, the maximum detection distance would be the default( 0.8 meters).
-
Parameters
Parameter Type Description on boolean true(false) to turn on(off) the detection mode -
Prototype
void setDectionModeOn(boolean on);
-
Required permissions
Selected Kiosk, Settings
-
Support from
0.10.70
Use this method to turn on(off) the detection mode. If you use this method to turn on the detection mode, you can set its maximum detection distance at the same time.
-
Parameters
Parameter Type Description on boolean true(false) to turn on(off) the detection modedistance float The maximum distance that the detection mode can detect (only works when onistrue). 0.5 - 2.0 are valid. -
Prototype
void setDectionModeOn(boolean on, float distance);
-
Required permissions
Selected Kiosk, Settings
-
Support from
0.10.70
Set your context to implement this listener and add the override method to get the latest state regarding the user detection.
package com.robotemi.sdk.listeners;
interface OnDetectionStateChangedListener {}-
Parameters
Parameter Type Description state int Detection mode state, possible states are DETECTED,LOST,IDLE -
Prototype
abstract void onDetectionStateChanged(int state);
-
Parameters
Parameter Type Description listener OnDetectionStateChangedListener An instance of a class that implements this interface -
Prototype
void addOnDetectionStateChangedListener(OnDetectionStateChangedListener listener)
-
Parameters
Parameter Type Description listener OnDetectionStateChangedListener An instance of a class that implements this interface -
Prototype
void removeOnDetectionStateChangedListener(OnDetectionStateChangedListener listener)
0.10.53
Set your context to implement this listener and add the override method to get the latest state regarding the user interaction. isInteracting will be returned true if the user is interacting otherwise it will be false. The interaction state machine will become active if one of the following condition is met:
- User is detected
- User is interacting with temi by touch or voice, or is in telepresence
- temi is in motion
package com.robotemi.sdk.listeners;
interface OnUserInteractionChangedListener {}-
Parameters
Parameter Type Description isInteracting boolean true(false) means that user is(is not) interacting -
Prototype
abstract void onUserInteraction(boolean isInteracting);
-
Parameters
Parameter Type Description listener OnUserInteractionChangedListener An instance of a class that implements this interface -
Prototype
void addOnUserInteractionChangedListener(OnUserInteractionChangedListener listener)
-
Parameters
Parameter Type Description listener OnUserInteractionChangedListener An instance of a class that implements this interface -
Prototype
void removeOnUserInteractionChangedListener(OnUserInteractionChangedListener listener)
0.10.53
After the detection mode is turned on, data related to detection mode can be received in its subclass.
package com.robotemi.sdk.listeners;
interface OnDetectionDataChangedListener {}-
Parameters
Parameter Type Description detectionData DetectionData Detected data -
Prototype
abstract void onDetectionDataChanged(DetectionData detectionData);
-
Parameters
Parameter Type Description listener OnDetectionDataChangedListener An instance of a class that implements this interface -
Prototype
void addOnDetectionDataChangedListener(OnDetectionDataChangedListener listener)
-
Parameters
Parameter Type Description listener OnDetectionDataChangedListener An instance of a class that implements this interface -
Prototype
void removeOnDetectionDataChangedListener(OnDetectionDataChangedListener listener)
0.10.70
Below are the list of models used in the utils methods.
Used for holding the data related detection mode.
package com.robotemi.sdk.model;
class DetectionData {}| Attribute | Type | Description |
|---|---|---|
| angle | double | - |
| distance | double | The distance from temi to the detected user |
| isDetected | boolean |
true(false) means temi did(did not) detect someone |