openTCS Http接口创建运输订单

openTCS官方提供关了Web API的文档

https://www.opentcs.org/docs/4.19/developer/web-api/index.html

在这里插入图片描述

1.运输订单
   Get方法(可以在浏览器地址栏直接输入测试)
      http://127.0.0.1:55200/v1/transportOrders
    返回所有的运输订单:
      [ {
       “name” : “TOrder-0fa56142-3e0a-4702-8eef-39136c82b8f1”,
       “category” : “-”,
       “state” : “FINISHED”,
       “intendedVehicle” : null,
       “processingVehicle” : “AGV2”,
       “destinations” : [ {
       “locationName” : “WorkPlace”,
       “operation” : “Work”,
        “state” : “FINISHED”,
       “properties” : []
       }]
      },{
       “name” : “Move-24d8eb37-1251-426b-af41-4604511ff4c9”,
       “category” : “-”,
       “state” : “BEING_PROCESSED”,
       “intendedVehicle” : “AGV2”,
       “processingVehicle” : “AGV2”,
       “destinations” : [{
       “locationName” : “Point1”,
       “operation” : “MOVE”,
       “state” : “TRAVELLING”,
       “properties” : []
       }]
      }]
2.根据订单号获取运输订单信息
   GET方法:
     http://127.0.0.1:55200/v1/transportOrders/{orderNum}
     例如
     http://127.0.0.1:55200/v1/transportOrders/TOrder-0fa56142-3e0a-4702-8eef-39136c82b8f1
   返回:
   {
    “name” : “TOrder-0fa56142-3e0a-4702-8eef-39136c82b8f1”,
    “category” : “-”,
     “state” : “FINISHED”,
     “intendedVehicle” : null,
     “processingVehicle” : “AGV2”,
     “destinations” : [ {
     “locationName” : “WorkPlace”,
     “operation” : “Work”,
     “state” : “FINISHED”,
     “properties” : []
     }]
   }

3.创建订单
     Post方法:
         http://127.0.0.1:55200/v1/transportOrders/{orderNum}
         orderNum随机生成(建议用UUID)
         contentType为:application/json
         Post数据如下:
         创建运输订单
         {
             “intendedVehicle” : null,
             “destinations” : [ {
                 “locationName” : “Load1”,
                 “operation” : “Load”,
                 “properties” : [ ]
             }, {
                 “locationName” : “Unload1”,
                 “operation” : “Unload”,
                 “properties” : [ ]
             } ]
         }
         或者移动订单
         {
             “intendedVehicle” : “AGV1”,
             “destinations” : [ {
             “locationName” : “Point5”,
             “operation” : “MOVE”,
             “properties” : [ ]
         } ]
     }
     返回:
         Successful operation

4.取消订单
   POST方法
     http://127.0.0.1:55200/v1/transportOrders/{orderNum}/withdrawal
   返回
     Successful operation

5.获取小车信息
     GET方法
         http://127.0.0.1:55200/v1/vehicles
     返回:
     [ {
         “name” : “AGV1”,
         “properties” : {
             “tcs:preferredAdapterClass” : “org.opentcs.virtualvehicle.LoopbackCommunicationAdapterFactory”,
             “IP” :“192.168.1.100”,
             “Port” : “4001”
             },
             “length” : 1000,
             “energyLevelGood” : 90,
             “energyLevelCritical” : 30,
             “energyLevel” : 100,
             “integrationLevel” : “TO_BE_UTILIZED”,
             “procState” : “IDLE”,
             “transportOrder” : null,
             “currentPosition” : “0,5”,
             “state” : “IDLE”
             }, {
                 “name” : “AGV2”,
             “properties” : {
                 “tcs:preferredAdapterClass” : “org.opentcs.virtualvehicle.LoopbackCommunicationAdapterFactory”,
                 “IP” : “192.168.1.101”,
                 “Port” : “4001”
             },
             “length” : 1000,
             “energyLevelGood” : 90,
             “energyLevelCritical” : 30,
             “energyLevel” : 100,
             “integrationLevel” : “TO_BE_UTILIZED”,
             “procState” : “PROCESSING_ORDER”,
             “transportOrder” : “Move-24d8eb37-1251-426b-af41-4604511ff4c9”,
             “currentPosition” : “0,0”,
             “state” : “IDLE”
         }]

6.根据小车编号获得小车信息
   GET方法
     http://127.0.0.1:55200/v1/vehicles/{vehicleName}
     例如
     http://127.0.0.1:55200/v1/vehicles/AGV1
   返回:
     {
         “name” : “AGV1”,
         “properties” : {
         “tcs:preferredAdapterClass” :         “org.opentcs.virtualvehicle.LoopbackCommunicationAdapterFactory”,
         “IP” : “192.168.1.100”,
         “Port” : “4001”
     },
     “length” : 1000,
     “energyLevelGood” : 90,
     “energyLevelCritical” : 30,
     “energyLevel” : 100,
     “integrationLevel” : “TO_BE_UTILIZED”,
     “procState” : “IDLE”,
     “transportOrder” : null,
     “currentPosition” : “0,5”,
     “state” : “IDLE”
     }

7.取消正在执行任务的小车
     POST方法:
         http://127.0.0.1:55200/v1/vehicles/{vehicleName}/withdrawal
         例如
         http://127.0.0.1:55200/v1/vehicles/AGV1/withdrawal
     返回:
         Successful operation


转载链接:https://blog.csdn.net/jielounlee/article/details/86229308

posted @ 2020-07-23 17:08  不止所见  阅读(761)  评论(0编辑  收藏  举报