跳至主要内容
版本: 3.4.x

超文本传输协定

默认情况下,HTTP 服务启动: http://localhost:10000.注意:端口可在服务配置中更改。

版本

方法获取

URL: http://localhost:10000/version

回复示例:

{
"build_time": "2024-08-07T16:01:53Z",
"git_branch": "main",
"git_describe": "3.0.0-2-gce34c39e",
"git_hash": "ce34c39e",
"git_tag": "3.0.0",
"project_name": "haply-inverse-service",
"project_version": "3.0.0.0"
}

设备

方法获取

URL: http://localhost:10000/devices

回复示例:

{
"inverse3": [
{
"device_id": "04BA",
"config": {
"type": "inverse3",
"device_info": {
"minor_version": 1,
"major_version": 7,
"id": "04BA",
"device_type": 4,
"uuid": "2D35F80DD9005F599B68F49944CB04BA"
},
"port": "COM13",
"extended_device_id": "2D35F80DD9005F599B68F49944CB04BA",
"extended_firmware_version": "8C20FDC8010AA1E15AA133CDA2534874",
"gravity_compensation": {
"enabled": true,
"scaling_factor": 1
},
"handedness": "right",
"torque_scaling": {
"enabled": true
}
},
"state": {
"angular_position": {
"a0": -69.31704,
"a1": 137.62952,
"a2": 19.832787
},
"angular_velocity": {
"a0": 0,
"a1": 0,
"a2": 0
},
"body_orientation": {
"x": -0.01940918,
"y": 0.7026367,
"z": 0.00048828125,
"w": 0.7113037
},
"cursor_position": {
"x": 0.07842738,
"y": -0.14836666,
"z": 0.14297646
},
"cursor_velocity": {
"x": -0.011969013,
"y": 0.0012009288,
"z": -0.043197
},
"mode": "idle"
},
"status": {
"calibrated": false,
"in_use": false,
"power_supply": true,
"ready": true,
"started": true
}
}
],
"verse_grip": [
{
"device_id": "61548",
"config": {
"port": "COM3",
"type": "verse_grip"
},
"state": {
"button": false,
"hall": 0,
"orientation": {
"x": -0.5019531,
"y": 0.8632202,
"z": -0.048095703,
"w": -0.022338867
}
},
"status": {
"error": 0,
"ready": true
}
}
],
"wireless_verse_grip": [
{
"device_id": "0",
"config": {
"port": "COM6",
"type": "wireless_verse_grip",
"major_version": 1,
"minor_version": 4,
"hardware_version": 1
},
"state": {
"battery_level": 0.816,
"battery_voltage": 3.77,
"buttons": {
"a": false,
"b": false,
"c": false
},
"hall": 16,
"orientation": {
"x": -0.019866943,
"y": -0.017486572,
"z": 0.05508423,
"w": -0.9963989
}
},
"status": {
"connected": true,
"awake": true,
"ready": true
}
}
]
}

力标尺

方法邮寄

URL: http://localhost:10000/force_scale

身体示例:

{
"force_scale": 0.5
}

回复示例:

{
"ok": true
}

重力补偿

方法邮寄

URL: http://localhost:10000/gravity_compensation

身体示例:

{
"device_id": "049D",
"enable": true,
"gravity_scaling_factor": 0.8
}

回复示例:

{
"ok": true
}

扭矩缩放

方法邮寄

URL: http://localhost:10000/torque_scaling

身体示例:

{
"device_id": "049D",
"enable": true
}

回复示例:

{
"ok": true
}

设备便携性

方法邮寄

URL: http://localhost:10000/device_handedness

身体示例:

{
"device_id": "049D",
"handedness": "right"
}

回复示例:

{
"ok": true
}

保存配置

仅适用于Inverse3 设备。警告避免过于频繁地保存配置,因为可应用于任何给定设备的保存次数有限。 的保存次数有限。

方法邮寄

URL: http://localhost:10000/save_configuration

身体示例:

{
"device_id": "049D"
}

回复示例:

{
"ok": true
}

串行启用

启用或禁用所有串行通信。当串行通信被禁用时,将无法向设备发送命令。

方法邮寄

URL: http://localhost:10000/serial_enable

身体示例:

{
"enable": true
}

回复示例:

{
"ok": true
}

抓握式垂直塞

启用或禁用手柄垂直停止实验功能。该功能将检查无线 VerseGrip 的方向,以检测 当 VerseGrip 下降时。触发后,它会将Inverse3 设置为当前位置的位置控制,以便末端效应器 不会掉落。当再次拿起 VerseGrip 时,它将自动关闭。

实验性

作为一项试验性功能,它在默认情况下禁用的,需要明确启用才能激活。

方法邮寄

URL: http://localhost:10000/experimental/features/grip_dropped_simulation_stopper

身体示例:

{
"enable": true,
"hall_effect_threshold": 17
}

回复示例:

{
"ok": true
}