Pepper RobotSDK QiChat没有按预期工作

时间:2017-08-08 07:45:21

标签: android robot pepper

尝试播放以下主题文件:

topic: ~test()
language: en

# Defining extra concepts out of words or group of words
concept:(hello) [hi hey]

# Replying to speech
u:(~hello) ~hello

QiChatPlayer init:

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

import com.aldebaran.apps.qichatplayer.QiChatPlayer;
import com.aldebaran.apps.qichatplayer.QiChatPlayerListener;

public class MainActivity extends Activity {
    private static final String TAG = MainActivity.class.getSimpleName();

    QiChatPlayer qiChatPlayer = null;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

    }

    @Override
    protected void onResume() {
        super.onResume();

        qiChatPlayer = new QiChatPlayer(getApplicationContext());
        qiChatPlayer.changeLogSetting(true, true, true, true, true, true);
        qiChatPlayer.init(new QiChatPlayerListener() {
            @Override
            public void onQiChatPlayerServiceConnected() {
                qiChatPlayer.loadTopicFile("test");
            }

            @Override
            public void onLoadCompleted() {
                qiChatPlayer.startTalk();
            }

            @Override
            public void onError(int i) {
                Log.e(TAG, "error: " + i);
            }
        });
    }

    @Override
    protected void onPause() {
        super.onPause();
        qiChatPlayer.stopTalk();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();

        qiChatPlayer.destroy();

    }
}

在QiChatPlayer faze得到以下w / e:

com.aldebaran.apps.ttsengine W/qimessaging.jni: FIXME: only jstring are supported
com.aldebaran.apps.ttsengine W/qimessaging.jni: FIXME: only jstring are supported
com.aldebaran.apps.ttsengine E/qi.path.sdklayout: Cannot create directory '"/mnt/sdcard/.config/qimessaging"' error was: boost::filesystem::status: Permission denied: "/mnt/sdcard/.config/qimessaging"
com.aldebaran.apps.ttsengine E/qi.os: Unable to create file: ''
com.aldebaran.apps.ttsengine W/qimessaging.transportsocket: connect: Connection refused

试图与机器人交谈:

human: hi
robot: hello

预期的机器人答案是"嗨"或者"嘿"但不是说他的回答是概念名称。

确定。让我们尝试简化主题:

topic: ~test()
language: en

u:(Hi) Hello

human: Hi
robot: Hello

它有效,但错误/警告是相同的。另一个尝试:

topic: ~test()
language: en

u:(Hi) Hello human

human: Hi
robot Hellohuman

还有一个:

topic: ~test()
language: enu

u:([Hi hello]) [hello hi] human

对话框:

human: Hi
robot: hellohihuman

他不明白这个空间。文件编码是默认的: enter image description here

在那种情况下:

topic: ~test()
language: enu

u:(["hello how are you" "hello are you OK"]) ["I am fine" "I am OK"]

app崩溃了:

A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x10 in tid 25774 (Thread-263)
com.aldebaran.robotservice I/RobotService: Send broadcast for Activity : robolutions.com.robotapp.MainActivity
I/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG: Build fingerprint: 'Android/aosp_x86/generic_x86:5.1.1/LMY49F/pepper05170905:userdebug/release-keys'
I/DEBUG: Revision: '0'
I/DEBUG: ABI: 'x86'
I/DEBUG: pid: 25758, tid: 25774, name: Thread-263  >>> robolutions.com.robotapp <<<
I/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10
I/DEBUG:     eax a4f54a14  ebx b318df58  ecx 00000000  edx 00000000
I/DEBUG:     esi 00000000  edi a40180b8
I/DEBUG:     xcs 00000073  xds 0000007b  xes 0000007b  xfs 0000005f  xss 0000007b
I/DEBUG:     eip b3182c7a  ebp a40180a0  esp a4f547f0  flags 00210246
I/DEBUG: backtrace:
I/DEBUG:     #00 pc 00007c7a  /data/app/robolutions.com.robotapp-1/lib/x86/libqichat.so (yyparse+4058)
I/DEBUG:     #01 pc 000059d7  /data/app/robolutions.com.robotapp-1/lib/x86/libqichat.so (parse+167)
I/DEBUG:     #02 pc 00002819  /data/app/robolutions.com.robotapp-1/lib/x86/libqichat.so
I/DEBUG:     #03 pc 000094ca  /data/dalvik-cache/x86/data@app@robolutions.com.robotapp-1@base.apk@classes.dex

我试图找到可以满足我要求的工作样本,但我找到的只是简单的样本,比如hi-hello,在我的情况下也可以。

对于主题创建,我遵循了本指南:dialog editor

的gradle:

compile 'com.aldebaran:libqi-java-android:sdk-2016-05-16'
compile 'com.aldebaran:qisdk:0.7'
compile 'com.aldebaran:qichatplayer:1.0.1'

使用过的sdk和工具:

enter image description here

1 个答案:

答案 0 :(得分:0)

onCreate方法中:

QiSDK.register(this,this)