Do not skip waypoint if orientation is not aligned #398
+27
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a follow-up to open-rmf/rmf_traffic#111 targeting issue open-rmf/rmf#556.
When a new path is provided to EasyFullControl from the traffic planner,
follow_new_path
would look for a connection between the path waypoints and the robot's current location in order to determine an overlapping starting point. EFC would then skip any unnecessary waypoints before the starting point to prevent the robot from backtracking. However, if the fleet config'sskip_rotation_commands
is set to False, these waypoints should not be skipped if they are responsible for in-place rotation.In the proposed fix, if
skip_rotation_commands
flag is set to False, it would check for the orientation difference between the robot and potential starting point. It ensures in-place rotation waypoints are not skipped if the difference is too large (threshold is measured at 0.01, taken from another portion of the same code here).For example, if the following path is provided, with the robot's current pose
[18.8078, -10.3719, 0.0306]
andskip_rotation_commands
set to False:Without the fix, the fleet adapter would skip waypoints
wp_0
andwp_1
, and request the robot to move directly from its current pose towp_2
.With the fix applied, the new path would only skip waypoint
wp_0
and commands the robot to move towp_1
from its current pose, which is an in-place rotation, before moving on towp_2
.Another minor change includes changing
max_merge_lane_distance
tomax_merge_waypoint_distance
here, since this condition block deals with waypoints in the same stack rather than the robot being on a lane.