Knowing lift destination before robot enters the lift (#496)

Posted by @cwrx777:

Hi,

I have a use case whereby a robot must always move forward in order to exit lift. My current deployment has lift with doors on both sides, and it is possible that robot needs to go out from the other side or the same side, on different floors.
Is it possible for fleet adapter to know the lift destination so that it will instruct the robot whether to reverse or to move forward to enter the lift?

Posted by @mxgrey:

This is a very tricky one, and I don’t immediately have a recommendation, but I’d like to figure out what we can tweak to make the situation manageable.

To clarify, is it ever possible for one floor to open both doors, so you not only need to know the destination floor but also the door that the robot will exit through?

I’m thinking we might be able to add a field to RobotUpdateHandle that says what the intended destination of the lift is, starting from the time that the lift is initially summoned, lasting until the lift session has ended.

Posted by @cwrx777:

To clarify, is it ever possible for one floor to open both doors, so you not only need to know the destination floor but also the door that the robot will exit through?

For the current deployment, the door only open on one side.

Posted by @mxgrey:

I’ve opened up a PR to address this need: Provide an API that says the robot's lift destination by mxgrey · Pull Request #376 · open-rmf/rmf_ros2 · GitHub

If you can give that a try and let me know if the solution works for you, we can get that merged into main.

Posted by @cwrx777:

@mxgrey ,

When is the right time to call this API? can it be called inside the dock method, of RobotCommandHandle?

Posted by @mxgrey:

The information from that function will be available from the point in time that the fleet adapter has begun requesting a session with the lift until the session has ended. The fleet adapter will not command a robot to enter a lift until after the session has started, so the function will definitely be ready with the correct information from whatever point in time your robot has been commanded to enter the lift.

can it be called inside the dock method, of RobotCommandHandle?

Your dock method will need to have access to a reference to the RobotUpdateHandle, but yes, it would make sense to call the API from inside the dock method when you know that the robot is docking into a lift.