-
Notifications
You must be signed in to change notification settings - Fork 8
Sphero Profile
Onuzimoyr edited this page Nov 17, 2015
·
2 revisions
| API | 機能概要 |
|---|---|
| Quaternion Event API | Spheroの四元数を通知するイベント。 |
| Locator Event API | Spheroの位置と速度を通知するイベント。 |
| Collision Event API | Spheroの衝突を通知するイベント。 |
Spheroが搭載しているいくつかのセンサー検知を通知するAPI。
なし
| インターフェース名称 | Version | 種別 |
|---|---|---|
| Quaternion Event API | 2.0.0 | 非同期I/F(イベントI/F) |
Spheroの四元数を通知するイベント。
| イベント名 | Content-Type |
|---|---|
| /gotapi/sphero/quaternion/onquaternion | application/json |
| 論理名 | 物理名 | データ型 | 省略 | 設定値 | |
| オブジェクト | quaternion | object | - | 四元数オブジェクト | |
| q0 | q0 | number | - | i軸 | |
| q1 | q1 | number | - | j軸 | |
| q2 | q2 | number | - | k軸 | |
| q3 | q3 | number | - | s軸 | |
| インターバル | interval | number | - | 計測のインターバル (単位: ミリ秒) |
|
{
"product":"Device Connect Manager",
"version":"x.x",
"serviceId":"localhost.deviceconnect.org",
"api" : "gotapi",
"profile":"sphero",
"interface":"quaternion",
"attribute":"onquaternion",
"sessionKey":"0a93ac0aade4e046ed63eb24d1172f5f35c88ca60daa901547c28d5827cb418a5de1d7c5f9e62405",
"quaternion":{
"q0":0.122,
"q1":0.222,
"q2":0.44,
"q3":0.33,
"interval":500,
}
}
| インターフェース名称 | Version | 種別 |
|---|---|---|
| Locator Event API | 2.0.0 | 非同期I/F(イベントI/F) |
Spheroの位置と速度を通知するイベント。
| イベント名 | Content-Type |
|---|---|
| /gotapi/sphero/locator/onlocator | application/json |
| 論理名 | 物理名 | データ型 | 省略 | 設定値 | |
| オブジェクト | locator | object | - | Spheroの位置座標オブジェクト | |
| 位置のx座標 | positionX | number | - | 位置のx座標 (単位: cm) |
|
| 位置のy座標 | positionY | number | - | 位置のy座標 (単位:cm) |
|
| 速度のx座標 | velocityX | number | - | 速度のx座標 (単位:cm/s) |
|
| 速度のy座標 | velocityY | number | - | 速度のy座標 (単位:cm/s) |
|
{
"product":"Device Connect Manager",
"version":"x.x",
"serviceId":"localhost.deviceconnect.org",
"api" : "gotapi",
"profile":"sphero",
"interface":"locator",
"attribute":"onlocator",
"sessionKey":"0a93ac0aade4e046ed63eb24d1172f5f35c88ca60daa901547c28d5827cb418a5de1d7c5f9e62405",
"locator":{
"positionX":1,
"positionY":2.5,
"velocityX":0.44,
"velocityY":0.33
}
}
| インターフェース名称 | Version | 種別 |
|---|---|---|
| Collision Event API | 2.0.0 | 非同期I/F(イベントI/F) |
Spheroの衝突を通知するイベント。
| イベント名 | Content-Type |
|---|---|
| /gotapi/sphero/collision/oncollision | application/json |
<td><b>論理名</b></td>
<td colspan="3" text-align="center"><b>物理名</b></td>
<td><b>データ型</b></td>
<td><b>省略</b></td>
<td><b>設定値</b></td>
<td>イベントオブジェクト</td>
<td colspan="3" text-align="center">collision</td>
<td>object</td>
<td>-</td>
<td>イベントの内容を保持するオブジェクト</td>
<td >衝突加速度</td>
<td rowspan="12"></td>
<td colspan="2">impactAcceleration</td>
<td>object</td>
<td>○</td>
<td>加速度のオブジェクト</td>
<td>x軸成分</td>
<td rowspan="3"></td>
<td >x</td>
<td>number</td>
<td>○</td>
<td>x軸方向への加速度(cm/s2)</td>
<td>y軸成分</td>
<td >y</td>
<td>number</td>
<td>○</td>
<td>y軸方向への加速度(cm/s2)</td>
<td>z軸成分</td>
<td >z</td>
<td>number</td>
<td>○</td>
<td>z軸方向への加速度(cm/s2)</td>
<td >衝突軸</td>
<td colspan="2">impactAxis</td>
<td>object</td>
<td>○</td>
<td>衝突軸のオブジェクト</td>
<td>x軸成分</td>
<td rowspan="2"></td>
<td >x</td>
<td>boolean</td>
<td>○</td>
<td>衝突軸を示すために使用されるx座標</td>
<td>y軸成分</td>
<td >y</td>
<td>boolean</td>
<td>○</td>
<td>衝突軸を示すために使用されるy座標</td>
<td >衝突力</td>
<td colspan="2">impactPower</td>
<td>object</td>
<td>○</td>
<td>衝突力値のオブジェクト</td>
<td>x軸成分</td>
<td rowspan="2"></td>
<td >x</td>
<td>number</td>
<td>○</td>
<td>衝突力値を有するx座標</td>
<td >y軸成分</td>
<td >y</td>
<td>number</td>
<td>○</td>
<td>衝突力値を有するy座標</td>
<td>衝突速度</td>
<td colspan="2">impactSpeed</td>
<td>number</td>
<td>○</td>
<td>衝突速度(単位: cm/s)</td>
<td >タイムスタンプ</td>
<td colspan="2">impactTimestamp</td>
<td>number</td>
<td>○</td>
<td>衝突した時間のタイムスタンプ(単位: ミリ秒)</td>
{
"product":"Device Connect Manager",
"version":"x.x",
"serviceId": "device1.localhost.deviceconnect.org",
"api" : "gotapi",
"profile" : "sphero",
"interface" : "collision"
"attribute" : "oncollision",
"sessionKey" : "0a93ac0aade4e046ed63eb24d1172f5f35c88ca60daa901547c28d5827cb418a5de1d7c5f9e62405",
“collision”: {
“impactAcceleration”:{
“x”:”0.55”,
“y”:”1.00”,
“z”:”0”,
}
}
}