Skip to content

Commit

Permalink
Warn users of unsupported speed limits
Browse files Browse the repository at this point in the history
Signed-off-by: Yadunund <[email protected]>
  • Loading branch information
Yadunund committed Jul 1, 2022
1 parent a43540f commit 06366c5
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1624,8 +1624,19 @@ auto FleetUpdateHandle::limit_lane_speeds(
{
// TODO: Check if planner supports negative speed limits.
if (request.lane_index() >= new_graph.num_lanes() ||
request.speed_limit() < 0.0)
request.speed_limit() <= 0.0)
{
RCLCPP_WARN(
self->_pimpl->node->get_logger(),
"Ignoring speed limit request %f for lane %d in fleet %s as it is "
"not greater than zero. If you would like to close the lane, use "
"the FleetUpdateHandle::close_lanes(~) API instead.",
request.speed_limit(),
request.lane_index(),
self->_pimpl->name.c_str()
);
continue;
}
auto& properties = new_graph.get_lane(
request.lane_index()).properties();
properties.speed_limit(request.speed_limit());
Expand Down

0 comments on commit 06366c5

Please sign in to comment.