天天看点

夜光精讲 Opentcs 框架与实际AGV方案(二)

夜光序言:

A little more persistence, a little more effort, and what seemed hopeless failure may turn to glorious success

再多一点点毅力,多付出一点点努力,看似无望的失败也会转化成辉煌的成功。

夜光精讲 Opentcs 框架与实际AGV方案(二)

正文:

调度系统与机器人的通讯

任何系统与实体之间通讯都需要协议,调度系统与机器人的通讯通过Kernel中的Adapter实现,信息传输格式采用JS0N格式,数据交换的载体为Redis数据库。

调度系统通过Kernel的Adapter向Redis服务器发送运输订单信息,而该信息由客户的MES系统生成,通过通讯协议存放到Redis服务器中,供Adapter从中取用,Adapter获取到订单后会计算出该订单的静态路由,以及路由成本,从而选择最优路径,并为该车匹配,将携带路由命令的订单存放到Redis服务器,并从Redis服务器中取回移动机器人的状态信息,在客户端Viewer上显示。

JS0N 格式样例:

// Genius:Retrieves a single named transport order.

[
  {
    "name": "TOrder-01",
    "category": "Park",
    "state": "RAW",
    "intendedVehicle": "Vehicle-0001",
    "processingVehicle": "Vehicle-0002",
    "destinations": [
      {
        "locationName": "Storage-01",
        "operation": "Store",
        "state": "PRISTINE",
        "properties": [
          {
            "key": "key1",
            "value": "value1"
          }
        ]
      }
    ]
  }
]
           
// Genius:The details of the transport order to be created.
{
  "deadline": "2018-05-17T06:42:40.396Z",
  "intendedVehicle": "Vehicle-01",
  "destinations": [
    {
      "locationName": "Storage 01",
      "operation": "Load cargo",
      "properties": [
        {
          "key": "key1",
          "value": "value1"
        }
      ]
    }
  ],
  "properties": [
    {
      "key": "key1",
      "value": "value1"
    }
  ],
  "dependencies": [
    "TOrder-002"
  ]
}
           
// Genius:Retrieves a set of vehicles.

[
  {
    "name": "Vehicle-0001",
    "properties": {
      "additionalProp1": "string",
      "additionalProp2": "string",
      "additionalProp3": "string"
    },
    "length": "1000",
    "energyLevelGood": "90",
    "energyLevelCritical": "30",
    "energyLevel": "60",
    "integrationLevel": "TO_BE_IGNORED",
    "procState": "UNAVAILABLE",
    "transportOrder": "TOrder-01",
    "currentPosition": "Point-0001",
    "state": "UNKNOWN"
  }
]
           
// Genius:Retrieves the vehicle with the given name.

{
  "name": "Vehicle-0001",
  "properties": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "length": "1000",
  "energyLevelGood": "90",
  "energyLevelCritical": "30",
  "energyLevel": "60",
  "integrationLevel": "TO_BE_IGNORED",
  "procState": "UNAVAILABLE",
  "transportOrder": "TOrder-01",
  "currentPosition": "Point-0001",
  "state": "UNKNOWN"
}
           
// Genius:Retrieving status updates

{
  "timeStamp": "2019-05-21T01:52:56.770Z",
  "statusMessages": [
    {
      "type": "TransportOrder",
      "sequenceNumber": "123",
      "creationTimeStamp": "2018-05-14T07:42:00.343Z",
      "orderName": "TOrder-0001",
      "processingVehicleName": "Vehicle-0001",
      "orderState": "RAW",
      "destinations": [
        {
          "locationName": "Storage-01",
          "operation": "Store",
          "state": "PRISTINE",
          "properties": [
            {
              "key": "key1",
              "value": "value1"
            }
          ]
        }
      ],
      "properties": [
        {
          "key": "key1",
          "value": "value1"
        }
      ]
    },
    {
      "type": "Vehicle",
      "sequenceNumber": "123",
      "creationTimeStamp": "2018-05-14T07:42:00.343Z",
      "vehicleName": "Vehicle-0001",
      "transportOrderName": "TOrder-0001",
      "position": "Point-0001",
      "precisePosition": {
        "x": "60",
        "y": "40",
        "z": "0"
      },
      "state": "UNKNOWN",
      "procState": "UNAVAILABLE"
    }
  ]
}
           
夜光精讲 Opentcs 框架与实际AGV方案(二)

继续阅读