帮助中心
帮助中心主页
移动机器人通识
外部传感器
激光雷达
距离传感器
其他传感器
总线型编码器
电池及充电
屏幕
喇叭及氛围灯
功能授权
参数及报警码
料箱车任务模式指令下发

一、任务模式脚本文件说明

1.1 脚本文件说明

  1. 料箱机器人任务模式下需要三个脚本文件,分别是 crc.py, pickingRobot.py, ctuTask.py, 其中crc.py是定义循环冗余校验,pickingRobot.py定义机器人的模型,ctuTask.py定义任务模式指令。本文主要介绍料箱机器人任务模式的指令下发。
  2. 文档说明:本文档指令示例为任务链指令,基于 3051 API 格式。如果采用 3066 API格式 ,则添加 task_id 和 source_id字段即可。
  3. 机器人开机、重启,第一次执行取货、放货动作前需执行标零指令。

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 脚本参数说明

参数数据类型说明
modestr交互模式,其值为"task"或 "module"
robotIdstr机器ID
opTypestr机器人动作类型,其值为"put", "take", "move", "inspect"之一
binIdstr预留参数
binModelstr料箱种类,其值为"carton", "plasticbox"之一
binTypestr货物识别类型,其值为"dm_market", "markerless", "barcode"之一
srcTrayjson源托盘
dstTrayjson目标托盘
targetTrayjson扫描对象托盘
targetPositionjson库位位置
targetHeightdouble库位高度
locationTypestr库位类型, 其值为"storage_shelf", "storage_shelf_deep", "conveyor" 之一
preconditionsjson预备动作前置目标
box_widthdouble货箱宽度配置值
box_heightdouble货箱高度配置值
box_depthdouble货箱深度配置值
box_tag_heightdouble货箱底部与货箱码下边沿的高度差
box_tag_depth oxdouble货架上箱子之间的距离
shelf_tag_heightdouble货架放货平面与货架码上边沿的高度差
conveyor_tag_heightdouble输送线放货平面与货架码上边沿的高度差
gap_between_boxdouble货架上箱子之间的距离

二、任务模式指令下发示例

2.1 指令格式说明

以下各指令示例均为标准格式,指令固定格式包含 idoperationscript_namescript_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 内部放货指令

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
  • 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.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
  • 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.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
  • 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.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.10 任务终止指令

json
{
    "id": "SELF_POSITION",
    "operation": "script",
    "script_name": "ctuTask.py",
    "script_args": {
        "operation": "task_stop"
    }
}
1
2
3
4
5
6
7
8
最近更新 2022/11/28
文章内容

一、任务模式脚本文件说明

1.1 脚本文件说明

1.2 指令操作说明

1.3 脚本参数说明

二、任务模式指令下发示例

2.1 指令格式说明

2.2 标零指令

2.3 内部放货指令

2.4 内部取货指令

2.5 外部放货指令

2.6 外部取货指令

2.7 模式切换指令

2.8 参数配置指令

2.9 预备动作指令

2.10 任务终止指令