Skip to content

Commit

Permalink
Remove undefined behavior from the startup conditions
Browse files Browse the repository at this point in the history
Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
  • Loading branch information
mxgrey committed Sep 23, 2024
1 parent a39e658 commit 2afb548
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions rmf_building_sim_gz_plugins/src/lift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ class LiftPlugin
}
}
lift_command.destination_floor = initial_floor;
lift_command.door_state = DoorModeCmp::CLOSE;
_last_lift_command[entity] = lift_command;

std::vector<double> joint_position = {target_elevation};
Expand Down Expand Up @@ -338,6 +339,7 @@ class LiftPlugin
{
continue;
}

if (door_state_comp->Data() != cmd)
return false;
}
Expand Down Expand Up @@ -455,8 +457,11 @@ class LiftPlugin
cur_lift_cmd.request_type != msg->request_type ||
cur_lift_cmd.session_id != msg->session_id)
{
gzwarn << "Discarding request: [" << msg->lift_name <<
"] is busy at the moment" << std::endl;
gzwarn << "Discarding request to go to [" << msg->destination_floor
<< "] for [" << msg->session_id << "]. Lift ["
<< msg->lift_name << "] is busy going to ["
<< cur_lift_cmd.destination_floor << "] for ["
<< cur_lift_cmd.session_id << "]" << std::endl;
return;
}
}
Expand Down

0 comments on commit 2afb548

Please sign in to comment.