| com.nuwarobotics.service.agent.RobotEventListener |
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
}
neck_y :MOTOR_NECK_Yneck_z :MOTOR_NECK_Zright_shoulder_z :MOTOR_RIGHT_SHOULDER_Zright_shoulder_y :MOTOR_RIGHT_SHOULDER_Yright_shoulder_x :MOTOR_RIGHT_SHOULDER_Xright_elbow_y :MOTOR_RIGHT_ELBOW_Yleft_shoulder_z :MOTOR_LEFT_SHOULDER_Zleft_shoulder_y :MOTOR_LEFT_SHOULDER_Yleft_shoulder_x :MOTOR_LEFT_SHOULDER_Xleft_elbow_y :MOTOR_LEFT_ELBOW_Y
head :POSITION_HEADchest :POSITION_CHESTright hand :POSITION_RIGHT_HANDleft hand :POSITION_LEFT_HANDleft face :POSITION_LEFT_FACEright face :POSITION_RIGHT_FACE
| 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.
| ||||||||||
Notify for Motion is completed
| motion | name of played motion file |
|---|
Notify for Drop Sensor
| value | 1 for drop sensor detected |
|---|
Notify for Error happen when play motion
| errorcode | error code of motion play error case |
|---|
Notify for user long press touch sensor area. (long touch down and up)
Touch id list
| type | Touch Type ID |
|---|
Notify for error happen on motor Motor id list
| id | motor id |
|---|---|
| statuscode | error code
Motor ID Table :
neck_y : |
Notify for PIR triggered NOTICE : When PIR triggered, 0 and 1 will send at the same time.
| val | 0/1 for detected |
|---|
Notify for Motion is playing next run
| motion | name of played motion file |
|---|
Notify for motionPrepare API completed
| isError | true for load success |
|---|---|
| motion | loaded motion file |
| duration | time duration length of motion file |
Notify for coordinate of touch face
| type | touch down: 1, touched up: 0 |
|---|---|
| x | coordinate x of touched area |
| y | coordinate y of touched area |
Notify for Motion is stopped
| motion | name of played motion file |
|---|
Notify for user tap touch sensor area. (touch down and up) Touch id list
| type | Touch Type ID |
|---|
Notify for sensor touched
Touch id list
| type | id of touched area |
|---|---|
| touch | touch down: 1, touched up: 0 |
Notify for Face Touch callback
| eyeLR | 1 for Left eye, 2 for right eye |
|---|---|
| type | touch down: 1, touched up: 0 |
Nuwa Robot Service happen Crash
Error happened need to processed
| 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 |
|---|
Nuwa Robot Service was recovery after crash Nuwa Robot Service auto restart if crash happen.
Nuwa Robot Service Ready NOTICE : Robot can only control after Service Started
Nuwa Robot Service Stopped
Some motion file included a image or video. This callback notify the motion view destroy
Some motion file included a image or video. This callback notify the motion view ready