您好!欢迎光临工博士商城

PEPPER软银机器人服务商

产品:19    
联系我们
联系方式
  • 联系人:陈诗洁
  • 电话:18621383650
  • 邮件:CSJ@gongboshi.com
  • 手机:18621383650
新闻分类
站内搜索
 
友情链接
首页 > 新闻中心 > 设定程序带你的智能pepper学会:say你好人类!
新闻中心
设定程序带你的智能pepper学会:say你好人类!
发布时间:2019-10-12        浏览次数:203        返回列表
 设定程序带你的智能pepper学会:say你好人类!
声明:本媒体部分图片、文章来源于网络,
版权归原作者所有,如有侵权,请与我联系删除。
 

pepper机器人
目标

在这个教程中,您将创建一个应用小程序,让 Pepper 说一句“Hello human!”.

前提要求

确认你已经安装了了Android Studio, 和Robot SDK 以及其他相关tools .

更多细节,请参阅: Installing the Pepper SDK plug-in.

让我们新建一个项目!

•新建一个新的项目 HelloPepper.
•Robotify 这个项目并确认实现QiSDK & Robot Life Cycle.

建立和运行一个 Say

pepper机器人说话,我们将用到Say 接口 ,这个class表示许多可Pepper 执行操作中的一个使用 Say 接口:

1 Action

在onRobotFocusGained 方法中用 SayBuilder 创建一个新的 Say的实例 :

// Create a new say action.
Say say = SayBuilder.with(qiContext) // Create the builder with the context.
.withText("Hello human!") // Set the text to say.
.build(); // Build the say action.

2 Action

运行 Say

调用 run 方法:

// Execute the action.
say.run();
完整的代码看上去应该如下:

@Override
public void onRobotFocusGained(QiContext qiContext) {
// Create a new say action.
Say say = SayBuilder.with(qiContext) // Create the builder with the context.
.withText("Hello human!") // Set the text to say.
.build(); // Build the say action.

// Execute the action.
say.run();
}

@Override
public void onRobotFocusLost() {
// Nothing here.
}
这些是让pepper机器人说话所需的全部了!

源代码我们放在了 GitHub

安装和运行应用程序.

选择 “Hello Human”.

恭喜! 你有一个会说话的Pepper了





更多资讯:pepper机器人

分享到: 


 

联系热线:18621383650 联系人:陈诗洁 联系地址:上海市嘉定区南翔镇众仁路399号B栋20层2007-2012

技术和报价服务:星期一至星期六8:00-22:00 PEPPER软银机器人服务商

返回
顶部