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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM