Skip to content

Commit

Permalink
Improve arrival time predictions for lanes with speed limits
Browse files Browse the repository at this point in the history
Signed-off-by: Michael X. Grey <[email protected]>
  • Loading branch information
mxgrey committed Jan 20, 2025
1 parent bee9778 commit 4f24cbe
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions rmf_fleet_adapter/src/rmf_fleet_adapter/agv/EasyFullControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1245,10 +1245,19 @@ void EasyCommandHandle::follow_new_path(
}

std::optional<double> speed_limit;
if (!wp1.approach_lanes().empty())
for (const auto arrival_lane : wp1.approach_lanes())
{
const auto arrival_lane = wp1.approach_lanes().back();
speed_limit = graph.get_lane(arrival_lane).properties().speed_limit();
if (const auto lane_speed_limit = graph.get_lane(arrival_lane).properties().speed_limit())
{
if (!speed_limit.has_value())
{
speed_limit = lane_speed_limit;
}
else if (*lane_speed_limit < *speed_limit)
{
speed_limit = lane_speed_limit;
}
}
}

Eigen::Vector3d target_position = wp1.position();
Expand Down

0 comments on commit 4f24cbe

Please sign in to comment.