Skip to content

Stitching node with action throwing error: "The order contains an action with a non-unique id"

According to the VDA 5050 protocol, when an order update is sent, it should include a stitching node—where the last node in the base order is repeated as the first node in the update order. In these cases, the two nodes should be identical.

However, when this stitching node contains an action, libvda throws an error: "The order contains an action with a non-unique id", and the order update fails to execute.

While it is understood that actions should generally have distinct actionIds, the stitching node's action should be an exception, as it is part of maintaining order continuity. Allowing the actionId to remain the same in this specific case would prevent the error and ensure the order update functions as expected.

Example:

Order 1:

{
  "headerId": 240,
  "timestamp": "2024-09-09T06:47:28.496823",
  "version": "2.0.0",
  "manufacturer": "SomeCompany",
  "serialNumber": "2340120051",
  "orderId": "3c147dc4-763e-4e11-9006-87144e3808d8-test_5",
  "orderUpdateId": 0,
  "nodes": [
    {
      "nodeId": "3c147dc4-763e-4e11-9006-87144e3808d8-n0-s0",
      "sequenceId": 0,
      "released": true,
      "actions": [],
      "nodePosition": {
        "x": 3.921409845352173,
        "y": -8.912192344665527,
        "mapId": "",
        "theta": 6.246316432952881
      }
    },
    {
      "nodeId": "3c147dc4-763e-4e11-9006-87144e3808d8-n0-s2",
      "sequenceId": 2,
      "released": true,
      "actions": [
        {
          "actionId": "3c147dc4-763e-4e11-9006-87144e3808d8-n1-s0-n1",
          "actionType": "sendMqttMessage",
          "blockingType": "NONE",
          "actionParameters": [
            {
              "key": "payload",
              "value": "42"
            },
            {
              "key": "topic",
              "value": "test/topic"
            }
          ]
        }
      ],
      "nodePosition": {
        "x": 1.66,
        "y": -8.69,
        "mapId": "",
        "theta": 0
      }
    }
  ],
  "edges": [
    {
      "edgeId": "3c147dc4-763e-4e11-9006-87144e3808d8-e1",
      "sequenceId": 1,
      "released": true,
      "startNodeId": "3c147dc4-763e-4e11-9006-87144e3808d8-n0-s0",
      "endNodeId": "3c147dc4-763e-4e11-9006-87144e3808d8-n0-s2",
      "actions": [],
      "maxSpeed": 0.3
    }
  ]
}

Order 2:

{
  "headerId": 241,
  "timestamp": "2024-09-09T06:47:28.496823",
  "version": "2.0.0",
  "manufacturer": "SomeCompany",
  "serialNumber": "2340120051",
  "orderId": "3c147dc4-763e-4e11-9006-87144e3808d8-test_5",
  "orderUpdateId": 1,
  "nodes": [
    {
      "nodeId": "3c147dc4-763e-4e11-9006-87144e3808d8-n0-s2",
      "sequenceId": 2,
      "released": true,
      "actions": [
        {
          "actionId": "3c147dc4-763e-4e11-9006-87144e3808d8-n1-s0-n1",
          "actionType": "sendMqttMessage",
          "blockingType": "NONE",
          "actionParameters": [
            {
              "key": "payload",
              "value": "42"
            },
            {
              "key": "topic",
              "value": "test/topic"
            }
          ]
        }
      ],
      "nodePosition": {
        "x": 1.66,
        "y": -8.69,
        "mapId": "",
        "theta": 0
      }
    },
    {
      "nodeId": "3c147dc4-763e-4e11-9006-87144e3808d8-n2-s0",
      "sequenceId": 4,
      "released": true,
      "actions": [],
      "nodePosition": {
        "x": 1.4892473220825195,
        "y": -8.685822486877441,
        "mapId": "",
        "theta": 3.062729597091675
      }
    },
    {
      "nodeId": "3c147dc4-763e-4e11-9006-87144e3808d8-n2-s2",
      "sequenceId": 6,
      "released": true,
      "actions": [],
      "nodePosition": {
        "x": 3.6,
        "y": -8.86,
        "mapId": "",
        "theta": 0
      }
    }
  ],
  "edges": [
    {
      "edgeId": "3c147dc4-763e-4e11-9006-87144e3808d8-e2",
      "sequenceId": 3,
      "released": true,
      "startNodeId": "3c147dc4-763e-4e11-9006-87144e3808d8-n0-s2",
      "endNodeId": "3c147dc4-763e-4e11-9006-87144e3808d8-n2-s0",
      "actions": [],
      "maxSpeed": 0.3
    },
    {
      "edgeId": "3c147dc4-763e-4e11-9006-87144e3808d8-e3",
      "sequenceId": 5,
      "released": true,
      "startNodeId": "3c147dc4-763e-4e11-9006-87144e3808d8-n2-s0",
      "endNodeId": "3c147dc4-763e-4e11-9006-87144e3808d8-n2-s2",
      "actions": [],
      "maxSpeed": 0.3
    }
  ]
}

Resulting state with error:

{
  "actionStates": [
    {
      "actionId": "3c147dc4-763e-4e11-9006-87144e3808d8-n1-s0-n1",
      "actionStatus": "FINISHED",
      "actionType": "sendMqttMessage"
    }
  ],
  "agvPosition": {
    "localizationScore": 0.9153022170066833,
    "mapId": "",
    "positionInitialized": true,
    "theta": 3.0379679203033447,
    "x": 1.4947450160980225,
    "y": -8.662605285644531
  },
  "batteryState": {
    "batteryCharge": 100,
    "batteryVoltage": 28.799999237060547,
    "charging": false
  },
  "distanceSinceLastNode": 0,
  "driving": false,
  "edgeStates": [],
  "errors": [
    {
      "errorDescription": "The order contains an action with a non-unique id",
      "errorLevel": "WARNING",
      "errorReferences": [
        {
          "referenceKey": "state.action.actionId",
          "referenceValue": "3c147dc4-763e-4e11-9006-87144e3808d8-n1-s0-n1"
        },
        {
          "referenceKey": "state.action.actionType",
          "referenceValue": "sendMqttMessage"
        },
        {
          "referenceKey": "order.action.actionId",
          "referenceValue": "3c147dc4-763e-4e11-9006-87144e3808d8-n1-s0-n1"
        },
        {
          "referenceKey": "order.action.actionType",
          "referenceValue": "sendMqttMessage"
        }
      ],
      "errorType": "orderError"
    }
  ],
  "headerId": 4784,
  "information": [],
  "lastNodeId": "3c147dc4-763e-4e11-9006-87144e3808d8-n0-s2",
  "lastNodeSequenceId": 2,
  "manufacturer": "SomeCompany",
  "nodeStates": [],
  "operatingMode": "AUTOMATIC",
  "orderId": "3c147dc4-763e-4e11-9006-87144e3808d8-test_5",
  "orderUpdateId": 0,
  "paused": false,
  "safetyState": {
    "eStop": "NONE",
    "fieldViolation": false
  },
  "serialNumber": "2340120051",
  "timestamp": "2024-09-09T08:07:45Z",
  "velocity": {
    "omega": 2.145021127408235e-9,
    "vx": -0.000011874579286086373,
    "vy": -6.038842204070249e-10
  },
  "version": "2.0.0"
}