Class Index

B C I N R S U V

B

BaseBehaviorService Target SDK : 2.0.0.05

Developer should implement a class to determine how to react when receiving a customized NLP response from NUWA Trainingkit. 
BehaviorServiceConnectionCallback  

C

CustomBehaviorListener CustomBehaviorListener use to implement callback. 

I

IClientId Declare Client identifier
IClientId mClientId = new IClientId(this.getPackageName());
 

N

NuwaRobotAPI A NuwaRobotAPI is a single, focused thing that the NuwaRobot developer can do. 
NuwaRobotAPI.JointMotor System Behavior Service API -- END  

R

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 ... 

S

SimpleGrammarData SimpleGrammarData allow user easy to create grammar data
 //prepare local command list
 ArrayList cmdList = new ArrayList() {{
     add("今日の天気");
     add("おはよう");
 }};//you can customize this list
 //Create Grammar class object
 //NOTICE : please only use "lower case letter" as naming of grammar name
 SimpleGrammarData mGrammarData = new SimpleGrammarData("example");
 //setup local command list to grammar class
 for (String string : cmdList) {
     mGrammarData.addSlot(string);
     Log.d(TAG, "add string : " + string);
 }
 //generate grammar data
 mGrammarData.updateBody();
 //create and update Grammar to Robot
 Log.d(TAG, "createGrammar " + mGrammarData.body);
 //NOTICE : please only use "lower case letter" as naming of grammar name
 mRobotAPI.createGrammar(mGrammarData.grammar, mGrammarData.body); // Regist cmd

The body in SimpleGrammarData is JSON format and as below
 {
  "version“: 1.0,
   “grammar": "test", //grammar set name
   “command": {  //command array, if single command only, just only write single array
     "single": [
       "今日の天気",
       "おはよう"
     ],
    }
 }
 
 
SystemBehaviorCallback  
SystemBehaviorCallback.ServiceCallback  

U

UnityCallback  
UnityCallback.UnityListener  
UnityFaceCallback UnityFaceCallback Use to receive event callback
Related API :
registerCallback(UnityFaceCallback)
unregisterCallback(UnityFaceCallback)
To receive callback of Face Touch
    mController.registerCallback(new UnityFaceCallback());
    class UnityFaceCallback extends UnityFaceCallback {
         @Override
         public void on_touch_left_eye() {
             Log.d("FaceControl", "on_touch_left_eye()");
         }

         @Override
         public void on_touch_right_eye() {
             Log.d("FaceControl", "on_touch_right_eye()");
         }

         @Override
         public void on_touch_nose() {
             Log.d("FaceControl", "on_touch_nose()");
         }

         @Override
         public void on_touch_mouth() {
             Log.d("FaceControl", "on_touch_mouth()");
         }

         @Override
         public void on_touch_head() {
             Log.d("FaceControl", "on_touch_head()");
         }

         @Override
         public void on_touch_left_edge() {
             Log.d("FaceControl", "on_touch_left_edge()");
         }

         @Override
         public void on_touch_right_edge() {
            Log.d("FaceControl", "on_touch_right_edge()");
         }

         @Override
         public void on_touch_bottom() {
            Log.d("FaceControl", "on_touch_bottom()");
         }
     }
 
UnityFaceManager Nuwa Face is a Activity which constructed with the Unity engine. 
UnityFaceManager.MouthOnType  

V

VoiceEventListener register the VoiceEventListener into RobotAPI instance and get callback return after listen event trigger Suggest to move the action into handler (or thread) avoid blocing the codeflow. 
VoiceEventListener.HotwordState The running state for Always-wakeup  
VoiceEventListener.HotwordType The result type for Always-wakeup  
VoiceEventListener.ListenType Listen trigger by which mode  
VoiceEventListener.ResultType voice type of result  
VoiceEventListener.SpeakState The state of speak  
VoiceEventListener.SpeakType The type of speak  
VoiceEventListener.SpeechState List the speech state  
VoiceResultJsonParser Simple tool to parser Result JSON format
@Override
public void onSpeech2TextComplete(boolean isError, String json) {
    String result_string = VoiceResultJsonParser.parseVoiceResult(json);
}
@Override
public void onWakeup(boolean isError, String score, float direction) {
    String wakeup_word = VoiceResultJsonParser.parseVoiceResult(score);
}
Json format
 {
  "version": 1.0, //version control (double base)
   "type": 1, //Result format, 1 is Command type, 2 is Recognized type
   "result": "Hello", // ASR result(String base)
   "class": "com.xxx.lib.voice.hybrid.engine.XXXTWMixEngine", // Engine class name(for debug)
   "engine": "ASR solution", //engine solution name
   "extra":  //extra tag for solution extention (OPTION)
       {
         //Define : 
         "content":"String"
       },
   "content": "XXX", //Extra section  (OPTION)
 }