openTCS / opentcs-commadapter-vda5050

An implementation of the VDA5050 interface for openTCS (by Fraunhofer IML)
https://www.opentcs.org/
MIT License
33 stars 12 forks source link

After the parking order is interrupted, the AGV will not proceed with the next transportorder. #12

Closed z29591259 closed 1 month ago

z29591259 commented 1 month ago

Affected version

OpenTCS Version 5.17.1 VDA5050 Version 0.20

Steps to reproduce

  1. Set kernel config defaultdispatcher.parkIdleVehicles => true
  2. Use map with a VDA5050 vehicle , set property "vda5050:maxStepsHorizon"=>2, also with a park point
  3. Move AGV to the point leave park point for a long distance that make sure there is enought time to create new order before parking order finish, and wait until kernel send parking order to AGV
  4. While AGV is executing park order, use API or OperationDesk to create a transportorder

Expected behaviour

Parking order should be interrupted, then AGV processes the next transportorder.

Actual behaviour

After the parking order is interrupted, the AGV remains in the EXECUTING state, and the next transport order remains 'DISPATCHABLE.'

Additional information

The VDA5050 vehicle we use sends its state along with horizon nodes and edges. When a parking order is interrupted, the vehicle retains only the horizon path and waits for the 'released' transfer to be set to 'true.' Since the nodeState is not empty, the statemapping in commadapter-vda5050 shows as EXECUTING.

However, in TCS, the parking order is marked as completed, and the next transport order is waiting for the vehicle to be in the IDLE state.

Sending a 'cancelOrder' instant action can clear the nodeState and edgeState on the AGV, returning it to the IDLE state and allowing the AGV to resume operation.

swltr commented 1 month ago

@z29591259 Confirmed! When checking remaining nodeState and edgeState entries, the horizon should be ignored.

z29591259 commented 1 month ago

The following thoughts are provided for your reference. Thank you for confirming the issue.

If, during state mapping, the horizon is ignored and the state is set to IDLE, the AGV might simply be waiting for a resource. Once the resource becomes available, it will continue executing the current transportorder.

I believe the key is ensuring that the AGV recognizes when its order has been stopped. There needs to be a mechanism to clear the horizon when a transportorder is interrupted; otherwise, if the AGV believes the current order is still in progress, it will reject new orders. I'm inclined to use cancelOrder instantAction to address this issue.

Currently, my workaround is to have the VDA5050Adapter send a cancelOrder instantAction when it detects that the AGV only has horizon nodes and edges left, and the transportorder has already concluded, causing the AGV to return to the IDLE state.

swltr commented 1 month ago

@z29591259 Yes, we had a similar solution in mind, which has now been implemented in 0.22.0 - see 72aaa280a9671e55d0a8e5f3f3187acf5c3cb95d. If you still notice anything wrong with that version, do let us know!