帮助中心主页











































Robokit 功能文档
移动机器人通识
底盘类型
地图构建及定位
识别
条形码识别
复合机器人识别
3D 相机识别
2D 激光识别
标定
标定类型
手动标定项
导航
机构脚本
机构脚本编程规范
导航
打滑检测
机构脚本接口字典
辊筒车
功能授权
附录
参数及报警码
料箱车任务模式指令下发
一、任务模式脚本文件说明
1.1 脚本文件说明
- 料箱机器人任务模式下需要三个脚本文件,分别是 crc.py, pickingRobot.py, ctuTask.py, 其中crc.py是定义循环冗余校验,pickingRobot.py定义机器人的模型,ctuTask.py定义任务模式指令。本文主要介绍料箱机器人任务模式的指令下发。
- 文档说明:本文档指令示例为任务链指令,基于 3051 API 格式。如果采用 3066 API格式 ,则添加 task_id 和 source_id字段即可。
- 机器人开机、重启,第一次执行取货、放货动作前需执行标零指令。
1.2 指令操作说明
任务模式各项操作说明参考下表1:
operation | 任务指令说明 | 脚本参数 |
---|---|---|
robot_reset | 机器标零 | 无 |
internal_opt | 内部取放货动作 | robotId opType binId srcTray dstTray binType[可缺省] binModel[可缺省] targetTray["opType"取值"INSPECT"时包含此参数] |
external_opt | 外部取放货动作 | robotId opType binId targetPosition targetHeight binType[可缺省] binModel[可缺省] locationType[可缺省] |
preaction | 预备动作 | robotId preconditions |
param_set | 参数设置 | robotId box_width box_height box_depth box_tag_height box_tag_depth shelf_tag_height conveyor_tag_height gap_between_box |
switch_mode | 模式切换 | mode |
1.3 脚本参数说明
参数 | 数据类型 | 说明 |
---|---|---|
mode | str | 交互模式,其值为"task"或 "module" |
robotId | str | 机器ID |
opType | str | 机器人动作类型,其值为"put", "take", "move", "inspect"之一 |
binId | str | 预留参数 |
binModel | str | 料箱种类,其值为"carton", "plasticbox"之一 |
binType | str | 货物识别类型,其值为"dm_market", "markerless", "barcode"之一 |
srcTray | json | 源托盘 |
dstTray | json | 目标托盘 |
targetTray | json | 扫描对象托盘 |
targetPosition | json | 库位位置 |
targetHeight | double | 库位高度 |
locationType | str | 库位类型, 其值为"storage_shelf", "storage_shelf_deep", "conveyor" 之一 |
preconditions | json | 预备动作前置目标 |
box_width | double | 货箱宽度配置值 |
box_height | double | 货箱高度配置值 |
box_depth | double | 货箱深度配置值 |
box_tag_height | double | 货箱底部与货箱码下边沿的高度差 |
box_tag_depth ox | double | 货架上箱子之间的距离 |
shelf_tag_height | double | 货架放货平面与货架码上边沿的高度差 |
conveyor_tag_height | double | 输送线放货平面与货架码上边沿的高度差 |
gap_between_box | double | 货架上箱子之间的距离 |
二、任务模式指令下发示例
2.1 指令格式说明
以下各指令示例均为标准格式,指令固定格式包含 id
、 operation
、 script_name
、 script_args
四个字段,operation
字段表示此任务指令为执行脚本,而 script_args 字段下的 operation
表示脚本执行动作,两者须区分。其中 script_args
字段根据脚本执行动作不同有不同的参数,上表1中的 operation
对应指令中script_args
字段下 operation
,即脚本的执行动作类型,上表1的脚本参数对应指令中 script_args
参数中其余字段。编写指令,根据上表1中 operation
对应的操作修改对应的 script_args
字段数据即可。
说明:指令中的脚本参数解释,请参考 1.3 章表2,更多详细说明需参考“库宝机器接口API”文档,参数与该文档参数保持一致。
2.2 标零指令
json
{
"id": "SELF_POSITION",
"operation": "script",
"script_name": "ctuTask.py",
"script_args": {
"operation": "robot_reset"
}
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
- 该指令使升降、旋转、手臂、手指等机构使能;
- 该指令使机构状态复位;
- 该指令不会使机构发生机械复位。
2.3 内部放货指令
json
{
"id": "SELF_POSITION",
"source_id": "SELF_POSITION",
"task_id": "12345678",
"operation": "script",
"script_name": "ctuTask.py",
"script_args": {
"binId": "",
"opType": "move",
"operation": "internal_opt",
"dstTray": {
"id": 2,
"type": 1
},
"srcTray": {
"id": 0,
"type": 0
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
- srcTray表示原背篓,其中id表示层数,从0开始计数,type表示背篓类型,0是货叉,1是背篓;
- dstTray表示目标背篓;
- opType: 取放货类型;
- binId 是预留参数,用以标识料箱编号。
2.4 内部取货指令
json
{
"id": "SELF_POSITION",
"operation": "script",
"script_name": "ctuTask.py",
"script_args": {
"binId": "",
"opType": "move",
"operation": "internal_opt",
"dstTray": {
"id": 0,
"type": 0
},
"srcTray": {
"id": 3,
"type": 1
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2.5 外部放货指令
json
{
"id": "SELF_POSITION",
"operation": "script",
"script_name": "ctuTask.py",
"script_args": {
"binId": "",
"opType": "put",
"operation": "external_opt",
"targetHeight": 1380,
"targetPosition": {
"theta": 1.5708,
"x": 71.1,
"y": 26.3
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- binId:预留参数;
- opType::取放货类型;
- targetHeight:库位高度;
- targetPosition:库位位置及朝向。
2.6 外部取货指令
json
{
"id": "SELF_POSITION",
"operation": "script",
"script_name": "ctuTask.py",
"script_args": {
"binId": "",
"opType": "take",
"operation": "external_opt",
"targetHeight": 990,
"targetPosition": {
"theta": 1.5708,
"x": 71.1,
"y": 26.3
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2.7 模式切换指令
json
{
"id": "SELF_POSITION",
"operation": "script",
"script_name": "ctuTask.py",
"script_args": {
"operation": "switch_mode",
"mode": "module"
}
}
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
- mode:机器人交互模式,有 "task", "module" 两种模式。
2.8 参数配置指令
json
{
"id": "SELF_POSITION",
"operation": "script",
"script_name": "ctuTask.py",
"script_args": {
"operation": "param_set",
"box_width": 0,
"box_height": 0,
"box_depth": 0,
"box_tag_height": 0,
"box_tag_depth": 0,
"shelf_tag_height": 0,
"conveyor_tag_height": 0,
"gap_between_box": 0
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- 参数值需要实际测量
2.9 预备动作指令
json
{
"id": "SELF_POSITION",
"operation": "script",
"script_name": "ctuTask.py",
"script_args": {
"operation": "preaction",
"preconditions": {
"liftPositionMax": 0,
"liftPositionMin": 0,
"forkRotationPositionMax": 0,
"forkRotationPositionMin": 0,
"fingerPosition": 0
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2.10 任务终止指令
json
{
"id": "SELF_POSITION",
"operation": "script",
"script_name": "ctuTask.py",
"script_args": {
"operation": "task_stop"
}
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
最近更新 2022/11/28
有帮助
没帮助