GBH_Ability/Head.md
2025-09-26 03:42:48 +00:00

47 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 机器人头部能力接口
## 接口列表
- [头部控制任务启动](#头部控制任务启动)
### task_type
| task_type | 任务说明 |
| ----------------- | ----------- |
| 0 | 头部控制任务 |
## 轮臂机器人头部控制任务启动
### 请求地址
`POST /api/task/start_task`
### 请求参数
| 字段名 | 类型 | 必填 | 默认值 | 说明 | 示例值 |
| ----------------- | ----------- | ---- | ----- |------------ | ------------------- |
| task_type | int64 | 是 | | 任务类型id | 0 |
| payload | object | 是 | | 任务输入参数 | |
| ├─ yaw | float | 是 | | 弧度 [-1.3961.396] | 0.4 |
| ├─ pitch | float | 是 | | 弧度 [-0.436,0.436] | 0.4 |
### 响应参数
| 字段名 | 类型 | 说明 | 示例值 |
| -------------- | ------ | -------------- | --------------------------------------- |
| task_id | string | 任务id | "e5672a6e-0bc2-4646-a019-dd914034e3ed" |
示例请求
``` json
{
"task_type": 0,
"payload": {
"yaw": -0.4,
"pitch": -0.4
}
}
```
示例返回
``` json
{
"task_id": "e5672a6e-0bc2-4646-a019-dd914034e3ed"
}
```
需要根据task_id向能力框架查询任务执行情况。
如果执行成功或执行中在向能力框架查询到的任务执行情况status字段为running或finished
如果执行失败在向能力框架查询到的任务执行情况status字段为error