Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove undefined behavior from the startup conditions #132

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 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,12 @@ 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
Loading