Posted by @cwrx777:
related discussion: open-rmf#454
Occasionally we have encountered that robot enters lift when the door is open but the lift is not yet in AGV mode.
Should this code also check if the lift is already in AGV mode? e.g.
LegacyTask::StatusMsg RequestLift::ActivePhase::_get_status(
const rmf_lift_msgs::msg::LiftState::SharedPtr& lift_state)
{
using rmf_lift_msgs::msg::LiftState;
using rmf_lift_msgs::msg::LiftRequest;
LegacyTask::StatusMsg status{};
status.state = LegacyTask::StatusMsg::STATE_ACTIVE;
if (!_rewaiting &&
lift_state->lift_name == _lift_name &&
lift_state->current_floor == _destination &&
lift_state->door_state == LiftState::DOOR_OPEN &&
lift_state->current_mode == LiftState::MODE_AGV && //check if the lift is AGV mode
lift_state->session_id == _context->requester_id())
{
RCLCPP_INFO(
_context->node()->get_logger(),
"Lift has arrived on floor [%s] and opened its doors for robot [%s]",
lift_state->current_floor.c_str(),
lift_state->session_id.c_str());
...