openTCS / opentcs-commadapter-vda5050

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

Integration level can't be changed properly by operatingMode #9

Closed maxwang001 closed 2 months ago

maxwang001 commented 2 months ago

Affected version

The latest commit of Format code via Spotless

Steps to reproduce

  1. Setup commadapter.vehicle.vda5050.onOpModeChangeDoUpdateIntegrationLevel with AUTOMATIC=TO_BE_UTILIZED
  2. When AGV is online and publish MQ 'state' with "operatingMode" : "AUTOMATIC", Integration level can't be changed. (The reason is because the default value of OperatingMode of AGV is "AUTOMATIC" too and will be ignore https://github.com/openTCS/opentcs-commadapter-vda5050/blob/0e07ac5d43d5b952281ce259115bec73db662ded/src/main/java/org/opentcs/commadapter/vehicle/vda5050/v2_0/CommAdapterImpl.java#L638
  3. The Integration level can't be changed When AGV disconnect also.

Expected behaviour

Integration level should be changed properly when AGV is online and offline.

Actual behaviour

Additional information

swltr commented 2 months ago

@maxwang001 I wouldn't consider this a defect, as we don't know of any previous operating mode when the vehicle initially connects, and changing the integration level when the vehicle disconnects is simply not a feature that the implementation offers at this point. But it can certainly be beneficial to have a way to (optionally) update the integration level when the vehicle connects or disconnects, so it's a valid feature request.

As always, contributions are welcome, but I'd suggest discussing potential implementations here before creating a PR.

maxwang001 commented 2 months ago

@swltr Thanks for the comment. I agree your opinion to update the integration level when the vehicle connects or disconnects. Below is what we do now and do you think it is appropriate to change integration level under these 2 functions?

image

swltr commented 2 months ago

@maxwang001 connectVehicle() and disconnectVehicle() are called when the driver is supposed to connect/disconnect - not to the vehicle, but to the broker. That doesn't mean the connection to the broker can actually be established, and it also doesn't mean that communication with the vehicle is possible.

In the VDA5050 driver, the place where we know whether there's a communication connection to the vehicle or not is when we receive a Connection message. And the place where we can decide whether the vehicle is in a usable state is when receive a State message.

maxwang001 commented 2 months ago

@swltr Yes, I find the side effect too that the exception happens when I disable the vehicle which has been assigned transport orders. And Using MQ messages to make a judgment has a risk about the MQ service sometimes experiences brief interruptions. Maybe use operatingMode to control is a good way but can't handle the vehicle is offline suddenly.

I can understand now why using operation desk to control manually and have no more quesitons.