com.nuwarobotics.service.agent.NuwaRobotAPI |
A NuwaRobotAPI is a single, focused thing that the NuwaRobot developer can do.
Document for NuwaSDK 2.1.0.08 version.
Topics covered here:
The NuwaRobotAPI class is the most important part of Nuwa robot control system and the way NuwaRobotAPI is granted and used can be referenced on NuwaSDK tutorial .
NuwaRobotAPIs in the NuwaRobot system are managed as an HashMap.
When a new NuwaRobotAPI is created with client ID, it is put into the HashMap with given client ID
and become running. Finally, call release()
if current NuwaRobotAPI is no more used.
// ID name: a unique name register to NuwaSDK IClientId id = new IClientId("your_app_package_name"); NuwaRobotAPI mRobot = new NuwaRobotAPI(android.content.Context, id); // release Nuwa SDK resource while App closed.(or Activity in pause/destroy state) mRobot.release();
mRobot.registerRobotEventListener(new RobotEventListener() { @Override public void onWikiServiceStart() { // Once mRobot is created, you will receive a callback of onWikiServiceStart() } @Override public void onTouchEvent() { } });
RobotEventListener robotEventListener = new RobotEventListener() { @Override public void onWikiServiceStart() { // Nuwa Robot SDK is ready now, you call call Nuwa SDK API now. Log.d(TAG, "onWikiServiceStart, robot ready to be control"); //Step 3 : Start Control Robot after Service ready. //Register Voice Callback event mRobotAPI.registerVoiceEventListener(voiceEventListener);//listen callback of robot voice related event } }; VoiceEventListener voiceEventListener = new VoiceEventListener() { @Override public void onWakeup(boolean isError, String score, float direction) { //do something } ... ... };
Before beginning to use Nuwa motion player, here is a brief definition of Nuwa motion>
A Nuwa motion> is a special, private Robot motion format used to control Robot behavior, and can be composed of following units>
You can just play a named motion , and Nuwa Robot will execute a serials of pre-defined actions.
mRobot.showWindow(false); mRobot.hideWindow(false);
<meta-data android:name="com.nuwarobotics.app.help.THIRD_VALUE" android:value="true" />
Please See NuwaSDK tutorial for detail.
Please See NuwaSDK tutorial for detail.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
class | NuwaRobotAPI.JointMotor | System Behavior Service API -- END |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | CHINESE_CHINA | Locale string - China | |||||||||
String | CHINESE_HONGKONG | Locale string - Hong Kong | |||||||||
String | CHINESE_TAIWAN | Locale string - Taiwan | |||||||||
String | ENGLISH | Locale string - English | |||||||||
int | ERROR_FW_AIMOTOR | ||||||||||
int | ERROR_FW_WHEEL | ||||||||||
int | ERROR_MAINBOARD_COMM_FAIL | ||||||||||
int | ERROR_MOTOR_VERSION | ||||||||||
int | ERROR_NONE | ||||||||||
String | JAPAN | Locale string - Japan | |||||||||
int | MOTOR_LEFT_ELBOW_Y | A constant describing motor left elbow y. | |||||||||
int | MOTOR_LEFT_SHOULDER_X | A constant describing motor left shoulder x. | |||||||||
int | MOTOR_LEFT_SHOULDER_Y | A constant describing motor left shoulder y. | |||||||||
int | MOTOR_LEFT_SHOULDER_Z | A constant describing motor left shoulder z. | |||||||||
int | MOTOR_NECK_Y | A constant describing motor neck y. | |||||||||
int | MOTOR_NECK_Z | A constant describing motor neck z. | |||||||||
int | MOTOR_RIGHT_ELBOW_Y | A constant describing motor right elbow y. | |||||||||
int | MOTOR_RIGHT_SHOULDER_X | A constant describing motor right shoulder x. | |||||||||
int | MOTOR_RIGHT_SHOULDER_Y | A constant describing motor right shoulder y. | |||||||||
int | MOTOR_RIGHT_SHOULDER_Z | A constant describing motor right shoulder z. | |||||||||
int | POSITION_CHEST | A constant describing position chest. | |||||||||
int | POSITION_HEAD | A constant describing position head. | |||||||||
int | POSITION_LEFT_FACE | A constant describing position left face. | |||||||||
int | POSITION_LEFT_HAND | A constant describing position left hand. | |||||||||
int | POSITION_RIGHT_FACE | A constant describing position right face. | |||||||||
int | POSITION_RIGHT_HAND | A constant describing position right hand. | |||||||||
int | SENSOR_DROP | A constant describing a Drop IR sensor type. | |||||||||
int | SENSOR_NONE | A constant describing a NONE sensor type, which is used to stop receiving any types of sensor event for current caller. | |||||||||
int | SENSOR_PIR | A constant describing a Pyro-electric Infrared Detector sensor type. | |||||||||
int | SENSOR_RAW_TOUCH | A constant describing a Robot Raw Touch sensor type. | |||||||||
int | SENSOR_SYSTEM_ERROR | A constant describing a Motor Error sensor type. | |||||||||
int | SENSOR_TOUCH | A constant describing a Robot Touch area. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
NuwaRobotAPI(Context context, IClientId mClientId)
Default constructor with caller ClientID
IMPORTMENT : DO NOT USE DUPLICATE ClientId at same package.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
SystemBehaviorManager |
SystemBehaviorManager()
Get SystemBehaviorManager instance to call related API
| ||||||||||
UnityFaceManager |
UnityFaceManager()
Get Face Control Manager instance
| ||||||||||
void |
controlAlwaysWakeup(boolean enable)
Enable Disable Always wakeup runtime.
| ||||||||||
void |
createGrammar(String grammar_id, String grammar_string)
createGrammar : local command grammar
Nuwa Local command grammar base on BNF grammar
You can use com.nuwarobotics.service.agent.GrammarData or
SimpleGrammarData to create BNF object | ||||||||||
void |
ctlMotor(int motor, float degree, float speed)
Control specific motor to request position
| ||||||||||
boolean |
disableMotionSto(int id)
This function disables motion STO(smart torque off).
| ||||||||||
void |
disablePowerKey()
Target SDK : 2.0.0.08
lock Power key : not allow any function of power key and not allow drop down menu leave current UI. | ||||||||||
void |
disableSystemLED()
Set LED control owner to APP
| ||||||||||
void |
enableLed(int id, int onOff)
enable or disable target LED
| ||||||||||
void |
enableLedBreath(int id, int interval, int ratio)
Set LED Breathly to target LED.
| ||||||||||
boolean |
enableMotionSto(int id, int delay)
This function enables motion STO(smart torque off).
| ||||||||||
boolean |
enableMotionSto(int id)
This function enables motion STO(smart torque off).
| ||||||||||
void |
enablePowerKey()
unlock Power key : allow any function of power key.
| ||||||||||
void |
enableSystemLED()
Set LED control owner to SYSTEM
| ||||||||||
void |
faceSpeaker()
Allow trigger robot rotate wheel face to speaker when wakeup
| ||||||||||
int |
getDropSensorOfNumber()
Get how many drop sensor on this robot
| ||||||||||
int |
getDropSensorState()
Get safe mode status
| ||||||||||
static NuwaRobotAPI |
getInst()
Get instance of NuwaRobotAPI; should new NuwaRobotAPI() before use it
| ||||||||||
List<String> |
getMotionList()
Get preload motion name list.
| ||||||||||
int |
getMotionStoDelay(int id)
This function gets motion STO(smart torque off) delay.
| ||||||||||
float | getMotorPositionInDegree(int mortorid) | ||||||||||
float |
getMotorPresentPositionInDegree(int mortorid)
Get robot present location
| ||||||||||
float |
getMotorPresentSpeedInDegreePerSec(int mortorName)
Get specific motor current speed, in degree per second
| ||||||||||
int |
getRobotErrorFlag()
Retrieve Robot Error
| ||||||||||
float |
getRobotPresentAngularSpeed()
Return Robot present Angular speed in degree per second
| ||||||||||
float |
getRobotPresentLinearSpeed()
Return Robot present Linear speed in meter per second
| ||||||||||
float[] |
getRobotPresentLocation()
Get robot present location
| ||||||||||
static String |
getVersion()
Get Nuwa Robot API version
| ||||||||||
boolean |
handleRemoteSDKCallback(Message message)
Use to handle Robot callback event.
| ||||||||||
void |
hideFace()
Hide Nuwa kebbi face
Target SDK : 2.1.0.08 | ||||||||||
void |
hideWindow(boolean anim)
Hide(close) the motion video window from Display
| ||||||||||
boolean |
isKiWiServiceReady()
Check Nuwa Robot SDK engine is ready or not before app calling any Robot SDK API
| ||||||||||
void |
lockWheel()
Lock the robot wheel runtime.
| ||||||||||
void |
lockWindow(boolean iflock)
Lock the motion video window on Display
| ||||||||||
float |
motionCurrentPosition()
Get the current timeline of playing motion
| ||||||||||
void |
motionMediaDisable(boolean disable)
Disable motion media player.
| ||||||||||
String |
motionName()
Get the name of playing motion
| ||||||||||
boolean |
motionPause()
Pause current playing motion
| ||||||||||
void |
motionPlay(Uri motionUri, String type, Uri videoUri)
Loads and Starts to play target motion with specific Uri without face.
| ||||||||||
void |
motionPlay(String motion, boolean show, String path)
Load Start play motion file which not preload in robot.
| ||||||||||
boolean |
motionPlay()
Start play the motion which loading by
motionPrepare(String)
motionPrepare and motionPlay can be a pair to use. | ||||||||||
void |
motionPlay(String motion, boolean show)
Load and Start play target motion
| ||||||||||
void |
motionPrepare(String motion)
Loading target motion file.
| ||||||||||
void |
motionPrepare(Uri motionUri, String type, Uri videoUri)
Loading target motion file and video.
| ||||||||||
void |
motionReset()
Reset current motion to initial position
| ||||||||||
boolean |
motionResume()
Resume the paused motion
| ||||||||||
boolean |
motionSeek(float time)
Seek motion timeline to target time position
| ||||||||||
void |
motionStop(boolean hide)
Stop current playing motion
| ||||||||||
float |
motionTotalDuration()
Get total duration of current prepared motion file
| ||||||||||
void |
mouthEmotionOn(long moveSpeed, int mouthOnType)
Control mouth move with specific emotion.
| ||||||||||
void |
mouthOff()
Face Control : Control mouth off
| ||||||||||
void |
mouthOn(long speed)
Face Control : Control mouth on with speed
| ||||||||||
void |
move(float direction_speed)
Control Robot wheel move forward and backward
| ||||||||||
void |
playFaceAnimation(String animation)
Play specific face animation
Target SDK : 2.1.0.08 | ||||||||||
void |
playFaceAnimation(int id)
Play specific face animation
Target SDK : 2.1.0.08 | ||||||||||
void |
playUnityFace(String animation)
[Deprecated] Play specific Unity face.
| ||||||||||
RobotEventListener |
registerRobotEventListener(RobotEventListener listener)
Registers a
RobotEventListener for receive
all kinds of notifications and results from Robot. | ||||||||||
VoiceEvaluateListener |
registerVoiceEvaluateListener(VoiceEvaluateListener listener)
Registers a com.nuwarobotics.service.agent.VoiceEvaluateListener VoiceEvaluateListener for receive
all kinds of voice results from Robot.
| ||||||||||
VoiceEventListener |
registerVoiceEventListener(VoiceEventListener listener)
Registers a
VoiceEventListener for receive
all kinds of voice results from Robot. | ||||||||||
void |
release()
Release all Nuwa Robot API resource
| ||||||||||
void |
requestMoitonList()
Request nuwa service to load all motion name list.
| ||||||||||
void |
requestSensor(int op)
request receive robot sensor event
Example Code : mRobotAPI.requestSensor(NuwaRobotAPI.SENSOR_TOUCH | NuwaRobotAPI.SENSOR_PIR | NuwaRobotAPI.SENSOR_DROP) | ||||||||||
void | resetAudioParameter() | ||||||||||
void |
setDropSensorState(int state)
Set the seneor state
| ||||||||||
void |
setLedColor(int id, int brightness, int r, int g, int b)
Set LED color to target LED.
| ||||||||||
void |
setListenParameter(VoiceEventListener.ListenType type, String key, String value)
Setup the listen parameter of ASR engine
//Extra Parameter : Ask ASR engine listen in specific language mRobot.setListenParameter(VoiceEventListener.ListenType.RECOGNIZE, "language", "en-US"); //Function : Ask subtitle force show some string mRobot.setListenParameter(VoiceEventListener.ListenType.RECOGNIZE, "subtitle_add", "string want subtitle show"); | ||||||||||
void |
setSpeakParameter(VoiceEventListener.SpeakType type, String key, String value)
Setup the speak parameter of TTS engine
mRobot.setSpeakParameter("isForced", "true"); //set isForced as true mRobot.setSpeakParameter("pitch", "80"); //pitch range: 50~200 mRobot.setSpeakParameter("speed", "120"); //speed range: 50~200 | ||||||||||
void |
showFace()
Show Nuwa kebbi face
Target SDK : 2.1.0.08 | ||||||||||
void |
showWindow(boolean anim)
Show motion video window on Display
| ||||||||||
void |
startLocalCommand()
Start to recognize the local command
Prepare grammar by | ||||||||||
void |
startMixUnderstand()
recognize with ASR and local command type,
Prepare grammar by | ||||||||||
void |
startRecognize(boolean wakup)
Start to recognize user speech
| ||||||||||
void |
startSpeech2Text(boolean wakup)
Start listen speech to text result
| ||||||||||
void |
startTTS(String text)
speech synthesis by default locale
If you want speak some string, and show another string to subtitle. | ||||||||||
void |
startTTS(String text, String locale)
speech synthesis with define locale
| ||||||||||
void |
startWakeUp(boolean async)
Start monitor wakeup `once` when user trigger robot wakeup.
| ||||||||||
void |
stopListen()
Stop current recognize if
startRecognize(boolean) call | ||||||||||
void |
stopSensor(int op)
Stop to listen sensor event
Example Code : mRobotAPI.stopSensor(NuwaRobotAPI.SENSOR_TOUCH | NuwaRobotAPI.SENSOR_PIR) | ||||||||||
void |
stopTTS()
Stop current speaking if
startTTS(String) call | ||||||||||
void |
turn(float angle_speed)
Control Robot wheel turn left or right circularly
| ||||||||||
void |
unlockWheel()
Unlock the wheel
|
Locale string - China
Locale string - Hong Kong
Locale string - Taiwan
Locale string - English
Locale string - Japan
A constant describing motor left elbow y.
Target SDK : 2.1.0.08
A constant describing motor left shoulder x.
Target SDK : 2.1.0.08
A constant describing motor left shoulder y.
Target SDK : 2.1.0.08
A constant describing motor left shoulder z.
Target SDK : 2.1.0.08
A constant describing motor neck y.
Target SDK : 2.1.0.08
A constant describing motor neck z.
Target SDK : 2.1.0.08
A constant describing motor right elbow y.
Target SDK : 2.1.0.08
A constant describing motor right shoulder x.
Target SDK : 2.1.0.08
A constant describing motor right shoulder y.
Target SDK : 2.1.0.08
A constant describing motor right shoulder z.
Target SDK : 2.1.0.08
A constant describing position chest.
Target SDK : 2.1.0.08
A constant describing position head.
Target SDK : 2.1.0.08
A constant describing position left face.
Target SDK : 2.1.0.08
A constant describing position left hand.
Target SDK : 2.1.0.08
A constant describing position right face.
Target SDK : 2.1.0.08
A constant describing position right hand.
Target SDK : 2.1.0.08
A constant describing a Drop IR sensor type.
A constant describing a NONE sensor type, which is used to stop receiving any types of sensor event for current caller.
A constant describing a Pyro-electric Infrared Detector sensor type.
A constant describing a Robot Raw Touch sensor type.
A constant describing a Motor Error sensor type.
A constant describing a Robot Touch area. (1: HEAD; 2:CHEST; 3: RIGHT_HAND 4: LEFT_HAND)
Default constructor with caller ClientID IMPORTMENT : DO NOT USE DUPLICATE ClientId at same package.
Get SystemBehaviorManager instance to call related API
Get Face Control Manager instance
Enable Disable Always wakeup runtime. NOTICE : Please MUST enable always wakeup when app no more use
enable | Enable always wakeup or not |
---|
createGrammar : local command grammar
Nuwa Local command grammar base on BNF grammar
You can use com.nuwarobotics.service.agent.GrammarData or SimpleGrammarData
to create BNF object
grammar_id | readable grammar id (NOTICE : Please only naming with lower case latter without special character) |
---|---|
grammar_string | grammar string |
Control specific motor to request position
motor | Target Motor |
---|---|
degree | Target motor degree |
speed | move speed |
This function disables motion STO(smart torque off).
Target SDK : 2.0.0.08
lock Power key : not allow any function of power key and not allow drop down menu leave current UI.
Default Power key behavior, short press go to Nuwa Robot Face, long press to show power off panel.
Notice : Lunch app icon of Drop Down Menu will not available after disablePowerKey
NOTICE : Please must call enablePowerKey()
after no more use
Set LED control owner to APP
enable or disable target LED
id | id of LED requested;
1 = LED_ID_HEAD two side of face LED (臉兩側LED燈) 2 = LED_ID_CHEST neck(or chest) LED (胸前LED燈) 3 = LED_ID_RIGHT_HAND Left hand LED (左手LED燈) 4 = LED_ID_LEFT_HAND Right hand LED (右手LED燈) |
---|---|
onOff | 0: turn off LED; 1: turn on LED |
Set LED Breathly to target LED.
Please disable system control LED by disableSystemLED()
before you use setLedColor
id | id of LED requested;
1 = LED_ID_HEAD two side of face LED (臉兩側LED燈) 2 = LED_ID_CHEST neck(or chest) LED (胸前LED燈) 3 = LED_ID_RIGHT_HAND Left hand LED (左手LED燈) 4 = LED_ID_LEFT_HAND Right hand LED (右手LED燈) |
---|---|
interval | the breath interval |
This function enables motion STO(smart torque off).
This function enables motion STO(smart torque off).
unlock Power key : allow any function of power key.
Default Power key behavior, short press go to Nuwa Robot Face, long press to show power off panel.
Target SDK : 2.0.0.08
Set LED control owner to SYSTEM
Allow trigger robot rotate wheel face to speaker when wakeup
Get how many drop sensor on this robot
Get safe mode status
0 : SAFEMODE_NORMAL 1 : SAFEMODE_MOTOR_RELEASE 2 : SAFEMODE_DROP 3 : SAFEMODE_WHEEL_RELEASE 4 : SAFEMODE_MOTOR_WHEEL_RELEASE
Get instance of NuwaRobotAPI; should new NuwaRobotAPI() before use it
Get preload motion name list.
Please call requestMoitonList()
first, before getMotionList.
This function gets motion STO(smart torque off) delay.
Get robot present location
mortorid | range from 1 to 10 |
---|
Get specific motor current speed, in degree per second
mortorName | motor name |
---|
Retrieve Robot Error
Return Robot present Angular speed in degree per second
Return Robot present Linear speed in meter per second
Get robot present location
Get Nuwa Robot API version
Use to handle Robot callback event.
message | connection manager message |
---|
Hide Nuwa kebbi face
Target SDK : 2.1.0.08
Hide(close) the motion video window from Display
anim | play fade in or not when hide the window |
---|
Check Nuwa Robot SDK engine is ready or not before app calling any Robot SDK API
Lock the robot wheel runtime. Please unlock after no more use
Lock the motion video window on Display
Disable motion media player.
Some fst motion included the mp4 media, this function allow developer re-use these motion file but not play media.
Target SDK : 2.1.0.02
NOTICE : Please must call #motionMediaDisable(false) after no more use
Get the name of playing motion
Loads and Starts to play target motion with specific Uri without face.
motionUri | is a Uri direct to a motion file(bin/script format) |
---|---|
type | is the type of target motion file, one of MOTION_OP_TYPE_BIN or MOTION_OP_TYPE_SCRIPT |
videoUri | is a Uri direct to a video file |
Load Start play motion file which not preload in robot.
motion | The name of motion. |
---|---|
show | If the motion contains a MP4, please set it as true. If you want to implement any view or face for displaying when motion playing, please set it as false. |
path | The path where you put the motion resource. For example: The folder motion_bin (required, fst files are stored here) and media (not required, mp4 files are stored here) under folder assets. If the assets folder is put at "/storage/emulated/0/assets", please assign "/storage/emulated/0" as path argument. |
Start play the motion which loading by motionPrepare(String)
motionPrepare and motionPlay can be a pair to use. motionPrepare is used for loading a huge motion file before playing. This design avoids the delay, programmer can prepare motion file ar earlier stage.
Load and Start play target motion
motion | The name of motion. |
---|---|
show | If the motion contains a MP4, please set it as true. If you want to implement any view or face for displaying when motion playing, please set it as false. |
Loading target motion file.
If use this API, please start motion by motionPlay()
motion | The name of motion. |
---|
Loading target motion file and video.
If use this API, please start motion by motionPlay()
motionUri | is a Uri direct to a motion file(bin/script format) |
---|---|
type | is the type of target motion file, one of MOTION_OP_TYPE_BIN or MOTION_OP_TYPE_SCRIPT |
videoUri | is a Uri direct to a video file |
Reset current motion to initial position
Seek motion timeline to target time position
time | The time unit is second, such as 3.1759999 seconds. |
---|
Stop current playing motion
hide | Stop playing a motion and hide the overlap window, please set it as true. If you want to stay at the moment that MP4 stopped position (keep window showing), please set it as false (please invoke hideWindow, if you want to quit from the MP4 screen). |
---|
Get total duration of current prepared motion file
Control mouth move with specific emotion. Please reset emotion to default before call mouthOff
private void stopFaceAndCloseMouth() { UnityFaceManager.getInstance().playFaceAnimationDefault(); UnityFaceManager.getInstance().mouthOff(); }
moveSpeed | The speed is a duration to change next frame in ms. The suggested value is between 50 (fastest) to 100 (slowest). |
---|---|
mouthOnType | The type decides which speak animation will be played.
off(0), peace_a(1), peace_b(2), joy(3), sadness(4), anger(5), fear(6), disgust(7), surprise(8); Mouth preview : animation preview of each MouthOnType |
UnityFaceManager.MouthOnType
mouthOff()
Face Control : Control mouth on with speed
speed | The speed is a duration to change next frame in ms. The suggested value is between 50 (fastest) to 100 (slowest). |
---|
Control Robot wheel move forward and backward
direction_speed | Move direction and speed. (cm/sec)
Direction/Speed value range (AIR-H200 : 0.2 ~ -0.2) (old robot : 0.3 ~ -0.3) MAX : 0.3 forward MIN : -0.3 backward |
---|
Play specific face animation
Target SDK : 2.1.0.08
animation | The name of face animation.
Face preview : face expression animation preview |
---|
Play specific face animation
Target SDK : 2.1.0.08
id | The id of face animation. |
---|
[Deprecated] Play specific Unity face.
Please be noticed that this API deprecated, and replaced by playFaceAnimation(int)
playFaceAnimation(String)
animation | face animation file name
Face preview : face expression animation preview |
---|
Registers a RobotEventListener
for receive
all kinds of notifications and results from Robot.
listener | A RobotEventListener object. |
---|
Registers a com.nuwarobotics.service.agent.VoiceEvaluateListener VoiceEvaluateListener for receive all kinds of voice results from Robot.
listener | A com.nuwarobotics.service.agent.VoiceEvaluateListener VoiceEvaluateListener object. |
---|
Registers a VoiceEventListener
for receive
all kinds of voice results from Robot.
listener | A VoiceEventListener object. |
---|
Release all Nuwa Robot API resource
Request nuwa service to load all motion name list. It need some time to loading.
request receive robot sensor event
Example Code :
mRobotAPI.requestSensor(NuwaRobotAPI.SENSOR_TOUCH | NuwaRobotAPI.SENSOR_PIR | NuwaRobotAPI.SENSOR_DROP)
op | request sensor list |
---|
Set the seneor state
state | control sensor mode
0 : Hardware.SENSOR_DISABLE 1 : Hardware.SENSOR_ENABLE_IR |
---|
Set LED color to target LED.
Please disable system control LED by disableSystemLED()
before you use setLedColor
id | id of LED requested;
1 = LED_ID_HEAD two side of face LED (臉兩側LED燈) 2 = LED_ID_CHEST neck(or chest) LED (胸前LED燈) 3 = LED_ID_RIGHT_HAND Left hand LED (左手LED燈) 4 = LED_ID_LEFT_HAND Right hand LED (右手LED燈) |
---|---|
brightness | The brightness value from 0 to 255. |
r | The RED color value from 0 to 255. |
g | The GREEN color value from 0 to 255. |
b | The BLUE color value from 0 to 255. |
Setup the listen parameter of ASR engine
//Extra Parameter : Ask ASR engine listen in specific language mRobot.setListenParameter(VoiceEventListener.ListenType.RECOGNIZE, "language", "en-US"); //Function : Ask subtitle force show some string mRobot.setListenParameter(VoiceEventListener.ListenType.RECOGNIZE, "subtitle_add", "string want subtitle show");
type | control type VoiceEventListener.ListenType |
---|---|
key | the key name of asr parameter (ie. "language") |
value | the value of key (ie. "en-US") |
Setup the speak parameter of TTS engine
mRobot.setSpeakParameter("isForced", "true"); //set isForced as true mRobot.setSpeakParameter("pitch", "80"); //pitch range: 50~200 mRobot.setSpeakParameter("speed", "120"); //speed range: 50~200
type | speak type. (usually use SpeakType.NORMAL ) |
---|---|
key | the key name of tts parameter "volume" "pitch" "speed" "gain" |
value | the value of the KEY |
Show Nuwa kebbi face
Target SDK : 2.1.0.08
Show motion video window on Display
anim | play fade in or not when showing the window |
---|
Start to recognize the local command
Prepare grammar by createGrammar(String, String)
first.
NOTICE : It must call on uithread. (DO NOT CALL IN CALLBACK DIRECTLY)
recognize with ASR and local command type,
Prepare grammar by createGrammar(String, String)
first.
NOTICE : It must call on uithread. (DO NOT CALL IN CALLBACK DIRECTLY)
Start to recognize user speech
wakup | Need wait wakeup robot or not |
---|
Start listen speech to text result
wakup | Get the string after wakeup or not |
---|
speech synthesis by default locale
If you want speak some string, and show another string to subtitle. Here is example.
// Add special prefix characters // to TTS string, SDK will not show subtitle when speak. mRobotAPI.startTTS("//string want kebbi speak"); // Use a special force show subtitle function to show another string mRobotAPI.setListenParameter(VoiceEventListener.ListenType.RECOGNIZE, "subtitle_add", "string want subtitle show");
text | the request speak string |
---|
speech synthesis with define locale
text | the request speak string |
---|---|
locale | String from locale String (for example: ENGLISH , JAPAN , CHINESE_TAIWAN ) |
Start monitor wakeup `once` when user trigger robot wakeup.
You can say `"Hello Kebbi"` to get a wakeup event callback in your Appication context `ONCE`, and robot system behavior NOT response on this time.
System will not response at this time, if app call startWakeUp.
NOTICE : It must call on uithread. (DO NOT CALL IN CALLBACK DIRECTLY)
async | asynchronous the wakeup or not |
---|
Stop to listen sensor event
Example Code :
mRobotAPI.stopSensor(NuwaRobotAPI.SENSOR_TOUCH | NuwaRobotAPI.SENSOR_PIR)
op | stop sensor list |
---|
Control Robot wheel turn left or right circularly
angle_speed | Turn angle and speed (angle/sec)
Angle/Speed value range (AIR-H200 -50.0 ~ 50.0) (old robot -30.0 ~ 30.0) MAX : 50.0 (turn RIGHT) MIN : -50.0 (turn LEFT) |
---|