Skip to content

Commit

Permalink
Check if lane request's fleet_name is equal to the fleet's fleet_name (
Browse files Browse the repository at this point in the history
…#95)

Signed-off-by: lkw303 <lkw303@gmail.com>
Signed-off-by: Arjo Chakravarty <arjo@openrobotics.org>
  • Loading branch information
lkw303 authored and arjo129 committed Oct 12, 2021
1 parent 50ebc5a commit f1af0b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rmf_fleet_adapter/src/close_lanes/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ int main(int argc, char* argv[])
[&request_complete, fleet_name, close_lanes = std::move(close_lanes)](
std::unique_ptr<rmf_fleet_msgs::msg::ClosedLanes> msg)
{
if (msg->fleet_name != fleet_name)
if (msg->fleet_name != fleet_name && !fleet_name.empty())
return;

auto still_open = close_lanes;
Expand Down
4 changes: 4 additions & 0 deletions rmf_fleet_adapter/src/full_control/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,10 @@ std::shared_ptr<Connections> make_fleet(
if (!connections)
return;

if (request_msg->fleet_name != fleet_name &&
!request_msg->fleet_name.empty())
return;

connections->fleet->open_lanes(request_msg->open_lanes);
connections->fleet->close_lanes(request_msg->close_lanes);

Expand Down

0 comments on commit f1af0b4

Please sign in to comment.