Skip to content

Commit

Permalink
Fix priority assignment
Browse files Browse the repository at this point in the history
Signed-off-by: Yadunund <yadunund@gmail.com>
  • Loading branch information
Yadunund committed Mar 24, 2023
1 parent 84f96d1 commit 10f1afe
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ std::shared_ptr<rmf_task::Request> FleetUpdateHandle::Implementation::convert(
rmf_traffic::Time(std::chrono::milliseconds(t_it->get<uint64_t>()));
}

rmf_task::ConstPriorityPtr priority;
rmf_task::ConstPriorityPtr priority = nullptr;
const auto p_it = request_msg.find("priority");
if (p_it != request_msg.end())
{
Expand All @@ -252,10 +252,14 @@ std::shared_ptr<rmf_task::Request> FleetUpdateHandle::Implementation::convert(
if (p_value.is_number_integer())
{
if (p_value.is_number_integer() && p_value.get<uint64_t>() > 0)
{
priority = rmf_task::BinaryPriorityScheme::make_high_priority();
}
else
{
priority = rmf_task::BinaryPriorityScheme::make_low_priority();
}
}

priority = rmf_task::BinaryPriorityScheme::make_low_priority();
}
}

Expand Down

0 comments on commit 10f1afe

Please sign in to comment.