Softbank Pepper Development - 在Android Studio中使用Java SDK - java-naoqi-sdk-<version><platfor



我目前开始为Pepper Robot进行开发。Choreagrache/Python+标准Android SDK运行良好。

我现在看到有一个Java SDK可以访问Pepper API(ALMemory,ALSpeechToText…):

http://doc.aldebaran.com/2-4/dev/java/index_java.html

到目前为止我做了什么:我下载了这个库,并在libs下将其添加到我的Android项目中。

我的代码只包含以下内容:

包com.example.falu.peppertest;

导入android.support.v7.app.AppCompatActivity;进口android.os.Bundle;

import com.aldebaran.qi.应用程序;导入com.aldebaran.qi.Session;

公共类MainActivity扩展了AppCompatActivity{

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
protected void onStart()
{
super.onStart();
String[] args = new String[]{"qi-url=tcp://falu-sp4.local:9559"};
//Using official SDK
try {
Application app = new Application(args);
}
catch(Exception ex) {
ex.printStackTrace();
}
} }

在使用列表中,它表示可以在ARM Android 4上使用。不幸的是,Adnroid SDK运行在Android 5(棒棒糖)上

有办法在那里使用这个图书馆吗?

如果我尝试,我总是得到消息:

10-23 07:11:57.253 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]jni在应用程序中检测到错误:GetMethodID收到空jclass 10-23 07:11:57.2533311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]在对GetMethodID 10-23的调用中07:11:57.253 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]来自java.lang.Objectcom.aldebaran.chi.DynamicObjectBuilder.object(long)10-23 07:11:57.2533311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]"main"prio=5 tid=1可运行10-2307:11:57.253 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]| group="main"sCount=0 dsCount=0obj=0x7490b000 self=0xb4025800 10-23 07:11:57.2543311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]| sysTid=3311 nice=0 cgrp=默认sched=0/0手柄=0xb7772ea0 10-23 07:11:57.2543311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]|状态=R schedstat=(0 0)utm=15stm=42芯=0 HZ=100 10-23 07:11:57.2543311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]|堆栈=0xbf099000-0xbf09b000stackSize=8MB 10-23 07:11:57.254 3311-3311/com.example.falu.peppertestA/art:art/runtime/check_jni.cc:65]|持有互斥="mutator锁"(共有)10-23 07:11:57.2543311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#00 pc 00005d03/system/lib/libbacktrace_libc++.so(UnwindCurrent::Unwind(unsignedint,ucontext*)+83)10-23 07:11:57.2543311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#01 pc 00003051/system/lib/libbacktrace_libc++.so(回溯::Unwind(unsigned int,ucontext*)+33)10-23 07:11:57.2543311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#02 pc 003c9e67/system/lib/libart.so(art::DumpNativeStack(std::__1::basic_stream>&,int,char const*,艺术::镜子:艺术方法*)+135)10-23 07:11:57.2543311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#03 pc 00393222/system/lib/libart.so(art::Thread::Dump(std::__1::basic_stream>&)const+306)10-23 07:11:57.2543311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#04 pc 001029bb/system/lib/libart.so(art::JniAbort(char const*,char const*)+1019)10-23 07:11:57.255 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#05 pc 0010359c/system/lib/libart.so(art::JniAbortF(char const*,…)+108)10-23 07:11:57.255 3311-3311/com.example.falu.peppertestA/art:art/runtime/check_jni.cc:65]本机:#06 pc 0010613f/system/lib/libart.so(art::ScopedCheck::CheckInstance(art:ScopedCheck::InstanceKind,_jobject*)+623)10-23 07:11:57.255 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#07 pc 0010792e/system/lib/libart.so(art::ScopedCheck::Check(bool,char const*,…)(.constprop.131)+718)10-23 07:11:57.2553311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#08 pc 00115b2d/system/lib/libart.so(art::CheckJNI::GetMethodID(_JNIEnv*,_jclass*,char const*,char const*)+109)10-23 07:11:57.2553311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#09 pc 00097952/data/app/com.example.falu.peppertest-2/lib/x86/libqimesagingjni.so(JNIObject::build(qi::Object)+82)10-23 07:11:57.2553311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#10 pc 00097dd5/data/app/com.example.falu.peppertest-2/lib/x86/libqimesagingjni.so(JNIObject::JNIObject(qi::Object)+53)10-23 07:11:57.2553311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#11 pc 0006d3e5/data/app/com.example.falu.peppertest-2/lib/x86/libqimesagingjni.so(Java_com_aldebaran_qi_DynamicObjectBuilder_object+325)10-2307:11:57.256 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#12 pc 000e6221/system/lib/libart.so(art_quick_generic_jni_蹦床+49)10-2307:11:57.256 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#13 pc 000e3bc8/system/lib/libart.so(art_quick_invoke_stub+72)10-23 07:11:57.2563311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#14 pc 0030bb55/system/lib/libart.so(艺术::镜像:艺术方法:调用(艺术:线程*,unsigned int*,unsigned int,art::JValue*,char const*)+245)10-2307:11:57.256 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#15 pc 00407f73/system/lib/libart.so(artInterpreterToCompiledCodeBridge+115)10-2307:11:57.256 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#16 pc 0024a61b/system/lib/libart.so(bool-art::interpreter::DoCall(art::mirror::ArtMethod*,art::Thread*,art::ShadowFrame&,art::指令常量*,无符号短字符,art::JValue*)+475)10-2307:11:57.256 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#17 pc 0043fbaa/system/lib/libart.so(布尔art::解释器::DoInvoke<(art::InvokeType)0,false,false>(art::Thread*,art::ShadowFrame&,art:;Instruction const*,无符号短音符,art::JValue*)+266)10-23 07:11:57.2563311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#18 pc 000c3bb5/system/lib/libart.so(艺术::JValueart::解释器:ExecuteGotoImpl(art::Thread*,art::MethodHelper&,art::DexFile::CodeItem const*,art::ShadowFrame&,艺术::价值)+40229)10-23 07:11:57.2563311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#19 pc 002342a4/system/lib/libart.so(artInterpreterToInterpreterBridge+244)10-2307:11:57.257 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#20 pc 0024b037/system/lib/libart.so(bool-art::interpreter::DoCall(art::mirror::ArtMethod*,art::Thread*,art::ShadowFrame&,art::指令常量*,无符号短字符,art::JValue*)+439)10-2307:11:57.257 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#21 pc 0043ee2e/system/lib/libart.so(布尔art::解释器::DoInvoke<(art::InvokeType)2,true,false>(art::Thread*,art::ShadowFrame&,art:;Instruction const*,无符号短音符,art::JValue*)+414)10-23 07:11:57.2573311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#22 pc 000bb65d/system/lib/libart.so(艺术::JValueart::解释器:ExecuteGotoImpl(art::Thread*,art::MethodHelper&,art::DexFile::CodeItem const*,art::ShadowFrame&,艺术::价值)+6093)10-23 07:11:57.2573311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#23 pc 002342a4/system/lib/libart.so(artInterpreterToInterpreterBridge+244)10-2307:11:57.257 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#24 pc 0024a61b/system/lib/libart.so(bool-art::interpreter::DoCall(art::mirror::ArtMethod*,art::Thread*,art::ShadowFrame&,art::指令常量*,无符号短字符,art::JValue*)+475)10-2307:11:57.257 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#25 pc 0043f6dc/system/lib/libart.so(布尔art::解释器::DoInvoke<(art::InvokeType)1,false,false>(art::Thread*,art::ShadowFrame&,art:;Instruction const*,无符号短音符,art::V值*)+316)10-23 07:11:57.2573311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#26 pc 000bb888/system/lib/libart.so(艺术::JValueart::解释器:ExecuteGotoImpl(art::Thread*,art::MethodHelper&,art::DexFile::CodeItem const*,art::ShadowFrame&,艺术::价值)+6648)10-23 07:11:57.2573311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#27 pc 002342a4/system/lib/libart.so(artInterpreterToInterpreterBridge+244)10-2307:11:57.257 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#28 pc 0024a61b/system/lib/libart.so(bool-art::interpreter::DoCall(art::mirror::ArtMethod*,art::Thread*,art::ShadowFrame&,art::指令常量*,无符号短字符,art::JValue*)+475)10-2307:11:57.258 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#29 pc 0043eb2e/system/lib/libart.so(布尔art::解释器::DoInvoke<(art::InvokeType)2,false,false>(art::Thread*,art::ShadowFrame&,art:;Instruction const*,无符号短音符,art::JValue*)+414)10-23 07:11:57.2583311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#30 pc 000c1a4d/system/lib/libart.so(艺术::JValueart::解释器:ExecuteGotoImpl(art::Thread*,art::MethodHelper&,art::DexFile::CodeItem const*,art::ShadowFrame&,艺术::价值)+31677)10-23 07:11:57.2583311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#31 pc 002339a3/system/lib/libart.so(艺术::解释器::EnterInterpreterFromStub(艺术:线程*,art::MethodHelper&,art::DexFile::CodeItem const*,art::ShadowFrame&)+195)10-23 07:11:57.2583311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#32 pc 00434a88/system/lib/libart.so(artQuickToInterpreterBridge+872)10-2307:11:57.258 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#33 pc 000e62b2/system/lib/libart.so(art_quick_to_interpreter_bridge+34)10-2307:11:57.258 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#34 pc 000e3bc8/system/lib/libart.so(art_quick_invoke_stub+72)10-23 07:11:57.2583311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#35 pc 0030bb55/system/lib/libart.so(艺术::镜像:艺术方法:调用(艺术:线程*,unsigned int*,unsigned int,art::JValue*,char const*)+245)10-2307:11:57.259 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#36 pc 00149db0/system/lib/libart.so(art::ClassLinker::InitializeClass(art:句柄,bool,bool)+1312)10-23 07:11:57.2593311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#37 pc 0014ac4c/system/lib/libart.so(art::ClassLinker::EnsureInitialized(art:句柄,bool,bool)+108)10-23 07:11:57.2593311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#38 pc 000c6d15/system/lib/libart.so(艺术::JValueart::解释器:ExecuteGotoImpl(art::Thread*,art::MethodHelper&,art::DexFile::CodeItem const*,art::ShadowFrame&,艺术::价值)+52869)10-23 07:11:57.2593311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#39 pc 002339a3/system/lib/libart.so(艺术::解释器::EnterInterpreterFromStub(艺术:线程*,art::MethodHelper&,art::DexFile::CodeItem const*,art::ShadowFrame&)+195)10-23 07:11:57.2593311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#40 pc 00434a88/system/lib/libart.so(artQuickToInterpreterBridge+872)10-2307:11:57.259 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#41 pc 000e62b2/system/lib/libart.so(art_quick_to_interpreter_bridge+34)10-2307:11:57.259 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#42 pc 00852ca5/数据/dalvik缓存/x86/system@framework@boot.oat(???)10-2307:11:57.259 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#43 pc 98fe3802???10-2307:11:57.259 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#44 pc 54984e1f???10-2307:11:57.260 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]本机:#45 pc 9f0097a1???10-2307:11:57.260 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]com.aldebaran.ki.DynamicObjectBuilder.object(本机方法)10-2307:11:57.260 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]com.aldebaran.qi.DynamicObjectBuilder.object(DynamicObjectBuilder.java:118)10-23 07:11:57.260 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]com.aldebaran.qi.EmbeddedTools.initTypeSystem(嵌入式工具.java:46)10-23 07:11:57.260 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]com.aldebaran.qi.EmbeddedTools.loadEmbeddedLibraries(EmbeddedTools.java:148)10-23 07:11:57.260 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]com.aldebaran.chi.Session。(Session。java:16)10-23 07:11:57.2603311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]com.example.falu.peppertest.MainActivity.onStart(MainActivity.java:22)10-23 07:11:57.260 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1236)10-23 07:11:57.260 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]android.app.Activity.performStart(Activity.java:6026)10-2307:11:57.260 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]android.app.ActivityThread.performLaunchActivity(ActivityThreads.java:2296)10-23 07:11:57.261 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]android.app.ActivityThread.handleLaunchActivity(ActivityThreads.java:2395)10-23 07:11:57.261 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]android.app.ActivityThread.access$800(ActivityThreads.java:151)10-2307:11:57.261 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]android.app.ActivityThread$H.handleMessage(ActivityThreads.java:1311)10-23 07:11:57.261 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]android.os.Handler.dispatchMessage(Handler.java:102)10-2307:11:57.261 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]android.os.Looper.loop(Looper.java:135)10-23 07:11:57.2613311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]android.app.ActivityThread.main(ActivityThreads.java:5398)10-2307:11:57.261 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]java.lang.reflect.Method.invoke!(土法)10-23 07:11:57.2613311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]java.lang.reflect.Method.ioke(Method.java:372)10-23 07:11:57.2613311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)10-23 07:11:57.262 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]com.android.internal.os.ZygoteInit.main(ZygoteNit.java:698)10-2307:11:57.262 3311-3311/com.example.falu.peppertest A/art:art/runtime/check_jni.cc:65]10-23 07:11:57.3653311-3311/com.example.falu.peppertest A/art:art/runtime/runtime.cc:289]运行时中止。。。

谢谢!

Pepper Java SDK使用编译的本地二进制文件(在Linux/Android上是.so,在Windows上是.dll),这意味着jar文件不像大多数文件那样可移植。

在这个SDK的早期版本中,它只有目标平台的二进制文件(例如Pepper的Linux),所以除非替换.so文件,否则它在平板电脑上无法工作。最新版本似乎确实检测到了Android,并切换到了不同的二进制文件,但我仍然无法让它工作,值得注意的是,它并没有被认为适合平板电脑。

有一个Android SDK

http://android.aldebaran.com/sdk/doc/pepper-sdk/introduction.html

这是否与你的Naoqi版本兼容是另一回事,我能够让它与模拟器和虚拟机器人一起工作,但与我可以访问的Pepper相比,插件中的Naoqi似乎有不同的服务。

最新更新