モバイル型ロボット電話 RoBoHoN と、音声アシスタント機能を備えたスピーカー Google Home Mini が協力して、エアバイオリン などをするお遊戯会を実装しました。
実行の様子
[Qiita] RoBoHoN と google Home のお遊戯会を実装した の実行動画です / 5歳男児(SHARP公式設定)ロボホンと、オトナなmini が、エアバイオリン🎻などをします pic.twitter.com/E0MsdDQjTl
— n_u (@ln_ulln_ul) 2018年1月9日
実装
manzai.hvml
<?xml version="1.0" ?>
<hvml version="2.0">
<head>
<producer>com.dev.zdev.manzai</producer>
<description>MANZAIシナリオ</description>
<scene value="com.dev.zdev.manzai.scn_talk" />
<version value="1.0" />
<accost priority="75" topic_id="001" word="com.dev.zdev.manzai.talk" />
</head>
<body>
<topic id="001" listen="false">
<action index="1">
<behavior id="0x060047" type="normal"/><!--きょろきょろ -->
</action>
<action index="2">
<behavior id="0x06005e" type="normal"/><!--マイク -->
<speech>こんにちはー! ロボホンと、グーグルホームでーす</speech>
</action>
<action index="3">
<behavior id="0x060008" type="normal"/><!--おじぎ -->
</action>
<action index="4">
<speech>オッケー、グーグル。 バイオリンの音して</speech>
<behavior id="assign" type="normal" />
</action>
<action index="5">
<behavior id="0x060006" type="normal"/><!--腰に手 -->
<speech>…<wait ms="6000"/></speech>
</action>
<action index="6">
<behavior id="0x060051" type="normal"/><!--バイオリン -->
</action>
<action index="7">
<behavior id="0x060051" type="normal"/><!--バイオリン -->
</action>
<action index="8">
<behavior id="0x06000a" type="normal"/><!--頷いて右手上げる -->
<speech>オッケー、グーグル。 投げキッスして</speech>
</action>
<action index="9">
<speech><wait ms="8000"/>そっかー。 なげキッスはこうやるんだよ! ステキでしょ?</speech>
<behavior id="assign" type="normal" /><!--モーション自動アサインで投げキッス -->
</action>
<action index="10">
<speech>オッケー、グーグル。 僕を誉めて!<wait ms="8000"/></speech>
<behavior id="assign" type="normal" /><!--モーション自動アサイン(もじもじそわそわ) -->
</action>
<action index="11">
<behavior id="0x06002e" type="normal"/>
<speech>…<wait ms="4000"/></speech><!--右手で頭をかく -->
</action>
<action index="12">
<behavior id="0x060022" type="normal"/><!--2 回頷く -->
</action>
<action index="13">
<behavior id="0x060027" type="normal"/><!--両手を広げる -->
<speech><emotion type="happy" level="2">ありがとうございましたー!</emotion></speech>
</action>
<action index="14">
<behavior id="0x060007" type="normal"/><!--おじぎ -->
</action>
</topic>
</body>
</hvml>
まとめ
うちに後から来た後輩の Google Home mini と、先輩の RoBoHoN を仲良くさせてみたくて実装しました。
(「OK,Google、アラームを7時にかけて」など Google Home にオーダーすると、横に居た RoBoHoN が 「アラーム」の語を聴き取って、「アラーム?アラームだったら…」と焦って話しだすなどの一幕もあったため…)
今回の実装の RoBoHoN の挙動は「RoBoHoN=5歳男児程度」の公式設定に拠った作りこみですが、GoogleHome の返答はランダムなので、後輩のオトナ感が(「私も、頑張らないと!」と軽やかに返答するなど…)図らずもにじみ出ました。