返回主站|会员中心|保存桌面|手机浏览
普通会员

软银机器人

机器人租赁|机器人售卖

联系方式
  • 联系人:王经理
  • 电话:021-31666777
新闻分类
站内搜索
 
首页 > 新闻中心 > 怎样让Pepper机器人学会说:Hello Human!
新闻中心
怎样让Pepper机器人学会说:Hello Human!
发布时间:2019-11-12        浏览次数:84        返回列表

怎样让Pepper机器人学会说:Hello Human!

声明:本媒体部分图片、文章来源于网络,

版权归原作者所有,如有侵权,请与我联系删除。


目标

在这个教程中,您将创建一个应用小程序,让 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”.



 

联系热线:021-31666777 联系人:王经理 联系地址:上海嘉定区博园路1333号

技术和报价服务:星期一至星期六8:00-22:00 软银机器人 访问量:17333  管理入口  技术支持:工博士  免责声明

©2023 上海工博士人工智能科技有限公司 人工智能门户网站 www.aichinaw.com 法律顾问:北京金城同达律师事务所