Destination.dock is None on first task with docking waypoint used as final_request: park (#692)

Posted by @CatiaRomaniello:

Hi! :slight_smile:
I’m working with a fleet adapter that integrates with a robot requiring a custom API call to perform docking/charging. In my implementation, I check destination.dock, and if it’s not None, I trigger this docking API.

Here’s the situation:

  • I have a waypoint in the Traffic Editor that is used for both parking and charging.

  • This waypoint is marked as:

    • is_charger: true

    • is_parking_spot: true

    • dock_name: fetch_charger (which has the same name of the charger set in the config.yaml of the robot)

  • I’m using finishing_request: park in the task request.

When RMF first starts and sends the robot to that waypoint, destination.dock is None, even though the waypoint has a dock_name set. This prevents my adapter from triggering the docking API.

However, if I send any other task afterward, and the robot goes to the same waypoint again, destination.dock is now correctly populated, and my docking logic works.

I originally had the waypoint placed exactly at the location of the robot’s physical charger. However, this caused issues because the robot could not reach the exact position due to collision avoidance, since it requires its specific API call to approach and dock with the charger. (the robot sees the charger as an obstacle since it is not able to recognize it without its API)

To resolve this, I moved the waypoint slightly away from the physical charger. I did not change any of the waypoint’s properties—the dock_name remains the same, and it is still marked as a charger and parking spot.

After this change, RMF still sends the robot near the charger, but on the first task, destination.dock is unexpectedly None. On subsequent tasks, the correct dock_name is provided in destination.dock.
To summarize:

  • My docking logic depends on destination.dock being set.

  • On the first task, it’s None, even though the waypoint has dock_name.

  • On subsequent tasks, it’s correctly set.

  • The waypoint is used for both parking and charging and has the appropriate metadata.

Any idea why destination.dock is not being set during the first task?