public interface

RobotEventListener

com.nuwarobotics.service.agent.RobotEventListener

Class Overview

Nuwa SDK bind Nuwa Robot Services to provide API of control robot RobotEventListener provide robot related event callback Such as Nuwa Core Service status change , Motion status, Sensor Event etc ...
Example :

 mRobotAPI.registerRobotEventListener(robotEventListener);
 RobotEventListener robotEventListener = new RobotEventListener() {
      //Override callback here
 }

Motor id list :

 neck_y : MOTOR_NECK_Y
 neck_z : MOTOR_NECK_Z
 right_shoulder_z : MOTOR_RIGHT_SHOULDER_Z
 right_shoulder_y : MOTOR_RIGHT_SHOULDER_Y
 right_shoulder_x : MOTOR_RIGHT_SHOULDER_X
 right_elbow_y : MOTOR_RIGHT_ELBOW_Y
 left_shoulder_z : MOTOR_LEFT_SHOULDER_Z
 left_shoulder_y : MOTOR_LEFT_SHOULDER_Y
 left_shoulder_x : MOTOR_LEFT_SHOULDER_X
 left_elbow_y : MOTOR_LEFT_ELBOW_Y
 

Touch Type ID :

 head : POSITION_HEAD
 chest : POSITION_CHEST
 right hand : POSITION_RIGHT_HAND
 left hand : POSITION_LEFT_HAND
 left face : POSITION_LEFT_FACE
 right face : POSITION_RIGHT_FACE

Summary

Public Methods
abstract void onCompleteOfMotionPlay(String motion)
Notify for Motion is completed
abstract void onDropSensorEvent(int value)
Notify for Drop Sensor
abstract void onErrorOfMotionPlay(int errorcode)
Notify for Error happen when play motion
abstract void onFaceSpeaker(float direction)
Notify for DOA angle
abstract void onLongPress(int type)
Notify for user long press touch sensor area.
abstract void onMotorErrorEvent(int id, int statuscode)
Notify for error happen on motor Motor id list
abstract void onPIREvent(int val)
Notify for PIR triggered NOTICE : When PIR triggered, 0 and 1 will send at the same time.
abstract void onPauseOfMotionPlay(String motion)
Notify for Motion is paused
abstract void onPlayBackOfMotionPlay(String motion)
Notify for Motion is playing next run
abstract void onPrepareMotion(boolean isError, String motion, float duration)
Notify for motionPrepare API completed
abstract void onRawTouch(int type, int x, int y)
Notify for coordinate of touch face
abstract void onStartOfMotionPlay(String motion)
Notify for Motion is starting
abstract void onStopOfMotionPlay(String motion)
Notify for Motion is stopped
abstract void onTap(int type)
Notify for user tap touch sensor area.
abstract void onTouchEvent(int type, int touch)
Notify for sensor touched
Touch id list
abstract void onTouchEyes(int eyeLR, int type)
Notify for Face Touch callback
abstract void onWikiServiceCrash()
Nuwa Robot Service happen Crash
abstract void onWikiServiceError(int statuscode)
Error happened need to processed
abstract void onWikiServiceRecovery()
Nuwa Robot Service was recovery after crash Nuwa Robot Service auto restart if crash happen.
abstract void onWikiServiceStart()
Nuwa Robot Service Ready NOTICE : Robot can only control after Service Started
abstract void onWikiServiceStop()
Nuwa Robot Service Stopped
abstract void onWindowSurfaceDestroy()
Some motion file included a image or video.
abstract void onWindowSurfaceReady()
Some motion file included a image or video.

Public Methods

public abstract void onCompleteOfMotionPlay (String motion)

Notify for Motion is completed

Parameters
motion name of played motion file

public abstract void onDropSensorEvent (int value)

Notify for Drop Sensor

Parameters
value 1 for drop sensor detected

public abstract void onErrorOfMotionPlay (int errorcode)

Notify for Error happen when play motion

Parameters
errorcode error code of motion play error case

public abstract void onFaceSpeaker (float direction)

Notify for DOA angle

Parameters
direction angle to voice source
See Also

public abstract void onLongPress (int type)

Notify for user long press touch sensor area. (long touch down and up)
Touch id list

Parameters
type Touch Type ID

public abstract void onMotorErrorEvent (int id, int statuscode)

Notify for error happen on motor Motor id list

Parameters
id motor id
statuscode error code Motor ID Table :
 neck_y : MOTOR_NECK_Y
 neck_z : MOTOR_NECK_Z
 right_shoulder_z : MOTOR_RIGHT_SHOULDER_Z
 right_shoulder_y : MOTOR_RIGHT_SHOULDER_Y
 right_shoulder_x : MOTOR_RIGHT_SHOULDER_X
 right_elbow_y : MOTOR_RIGHT_ELBOW_Y
 left_shoulder_z : MOTOR_LEFT_SHOULDER_Z
 left_shoulder_y : MOTOR_LEFT_SHOULDER_Y
 left_shoulder_x : MOTOR_LEFT_SHOULDER_X
 left_elbow_y : MOTOR_LEFT_ELBOW_Y
 

public abstract void onPIREvent (int val)

Notify for PIR triggered NOTICE : When PIR triggered, 0 and 1 will send at the same time.

Parameters
val 0/1 for detected

public abstract void onPauseOfMotionPlay (String motion)

Notify for Motion is paused

Parameters
motion name of played motion file
See Also

public abstract void onPlayBackOfMotionPlay (String motion)

Notify for Motion is playing next run

Parameters
motion name of played motion file

public abstract void onPrepareMotion (boolean isError, String motion, float duration)

Notify for motionPrepare API completed

Parameters
isError true for load success
motion loaded motion file
duration time duration length of motion file

public abstract void onRawTouch (int type, int x, int y)

Notify for coordinate of touch face

Parameters
type touch down: 1, touched up: 0
x coordinate x of touched area
y coordinate y of touched area

public abstract void onStartOfMotionPlay (String motion)

Notify for Motion is starting

Parameters
motion name of played motion file
See Also

public abstract void onStopOfMotionPlay (String motion)

Notify for Motion is stopped

Parameters
motion name of played motion file

public abstract void onTap (int type)

Notify for user tap touch sensor area. (touch down and up) Touch id list

Parameters
type Touch Type ID

public abstract void onTouchEvent (int type, int touch)

Notify for sensor touched
Touch id list

Parameters
type id of touched area
touch touch down: 1, touched up: 0

public abstract void onTouchEyes (int eyeLR, int type)

Notify for Face Touch callback

Parameters
eyeLR 1 for Left eye, 2 for right eye
type touch down: 1, touched up: 0

public abstract void onWikiServiceCrash ()

Nuwa Robot Service happen Crash

public abstract void onWikiServiceError (int statuscode)

Error happened need to processed

Parameters
statuscode ERROR_NONE = 0x00 No Error happen ERROR_FW_AIMOTOR = 0x10 Joint Motor Safe mode or corrupted Suggest: Reboot. If this error occurred again, send back for repair ERROR_FW_WHEEL = 0x20 Wheel Safe mode Suggest: Clear any debris from the wheels and reboot. If this error occurred again, send back for repair ERROR_MAINBOARD_COMM_FAIL = 0x40 Motor communication fail Suggest: Reboot. If this error occurred again, send back for repair ERROR_MOTOR_VERSION = 0x400 Motor firmware version incorrect Suggest: Launch firmware update process and upgrade to correct version

public abstract void onWikiServiceRecovery ()

Nuwa Robot Service was recovery after crash Nuwa Robot Service auto restart if crash happen.

public abstract void onWikiServiceStart ()

Nuwa Robot Service Ready NOTICE : Robot can only control after Service Started

public abstract void onWikiServiceStop ()

Nuwa Robot Service Stopped

public abstract void onWindowSurfaceDestroy ()

Some motion file included a image or video. This callback notify the motion view destroy

public abstract void onWindowSurfaceReady ()

Some motion file included a image or video. This callback notify the motion view ready