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

Do not skip waypoint if orientation is not aligned #398

Merged
merged 2 commits into from
Dec 13, 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
34 changes: 27 additions & 7 deletions rmf_fleet_adapter/src/rmf_fleet_adapter/agv/EasyFullControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1055,9 +1055,21 @@ void EasyCommandHandle::follow_new_path(
for (std::size_t i = 0; i < waypoints.size(); ++i)
{
const auto& wp = waypoints[i];
if (wp.graph_index().has_value())
for (const auto& l : current_location)
{
for (const auto& l : current_location)
if (!nav_params->skip_rotation_commands)
{
// If the waypoint and robot orientations are not aligned with
// skip rotation command set to False, we will not consider this as
// a connection
if (std::abs(wp.position()[2] -
l.orientation())*180.0 / M_PI > 1e-2)
{
continue;
luca-della-vedova marked this conversation as resolved.
Show resolved Hide resolved
}
}

if (wp.graph_index().has_value())
luca-della-vedova marked this conversation as resolved.
Show resolved Hide resolved
{
if (nav_params->in_same_stack(*wp.graph_index(),
l.waypoint()) && !l.lane().has_value())
Expand All @@ -1073,7 +1085,7 @@ void EasyCommandHandle::follow_new_path(
{
const double dist =
(*l.location() - wp.position().block<2, 1>(0, 0)).norm();
if (dist <= nav_params->max_merge_lane_distance)
if (dist <= nav_params->max_merge_waypoint_distance)
{
found_connection = true;
i0 = 0;
Expand Down Expand Up @@ -1108,10 +1120,7 @@ void EasyCommandHandle::follow_new_path(
}
}
}
}
else
{
for (const auto& l : current_location)
else
{
Eigen::Vector2d p_l;
if (l.location().has_value())
Expand All @@ -1137,6 +1146,17 @@ void EasyCommandHandle::follow_new_path(
{
for (const auto& l : current_location)
{
if (!nav_params->skip_rotation_commands)
{
// If the waypoint and robot orientations are not aligned with
// skip rotation command set to False, we will not consider this as
// a connection
if (std::abs(wp.position()[2] -
l.orientation())*180.0 / M_PI > 1e-2)
{
continue;
}
}
if (l.lane().has_value())
{
if (lane == *l.lane())
Expand Down
Loading