-
Notifications
You must be signed in to change notification settings - Fork 26
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
Insert in-place rotation waypoint if missing #111
Conversation
Signed-off-by: Xiyu Oh <[email protected]>
Hi @xiyuoh , as mentioned in open-rmf/rmf#556, this problem consistently occurs in the following scenarios:
Your PR has resolved the issue for the first scenario, but the problem still persists after the robot done waiting for traffic where in-place rotation commands for certain paths are missing.
|
Hi @osama-z-salah , thanks for testing this PR! I've tried out what you're describing in sim and it doesn't seem like its related to traffic, but I do see in-place rotations being skipped from within the EasyFullControl fleet adapter. I've opened another PR for that since the code lives in another repo, feel free to try that out and let me know if the issue persists. |
Signed-off-by: Xiyu Oh <[email protected]>
const bool same_stack = | ||
prev_wp.graph_index.has_value() && current_wp.has_value() | ||
&& *prev_wp.graph_index == *current_wp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this condition a subset of the position check? Would two waypoints that are exactly the same always return true for:
const bool same_pos = (prev_pos - node->position).norm() < 1e-3;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think same graph index always mean same position, but same (or sufficiently close) positions don't always mean same graph index. Having !(same_stack || same_pos)
was to include any locations that either have the same graph index, or a different graph index but sufficiently close within the threshold of 0.001m. I can see cases where two separate waypoints are added close to one another to manage the lane direction and traffic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yap that's what I meant, if two waypoints have the same index they will always have the exact same position, so would checking only for the position be sufficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see what you mean, gotcha removed in 67ae677
const auto prev_candidate = candidates.back(); | ||
const auto prev_wp = prev_candidate.waypoint; | ||
const auto current_wp = node->waypoint; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, we should use references for more complex types to avoid copying const auto&
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Xiyu Oh <[email protected]>
Signed-off-by: Xiyu Oh <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for iterating! Someone with admin access needs to go through the required workflows for this repo though, or this will be blocked on CI settings
…-place insertions Signed-off-by: Michael X. Grey <[email protected]>
Signed-off-by: Michael X. Grey <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After fixing the CI with #112 it turns out that there were some test failures in the PR. There were two root causes:
- The "same orientation" calculation wasn't taking into account overflow at 2*pi
- We weren't matching the plan waypoint with a checkpoint in the trajectory
Both issues are fixed by 344559c. (2) probably doesn't matter much to be honest, but I thought of a semi-reasonable way to make it work, and that spares us from needing to put fudge into the assumptions of the unit tests.
I'd appreciate if someone can take some time to test these changes on a demo world before merging. I don't think (2) should have any detrimental effects, but it's better to do a smoke test on that than to assume.
Thanks for fixing the remaining issues! Ran this PR a couple times in office world and things are looking good, will merge it in. |
This PR targets open-rmf/rmf#556 where in-place rotation commands for certain paths are missing. After tracing the fleet adapter and
rmf_traffic
planner, it seems the planner sometimes fails to provide these waypoints. These in-place rotation waypoints may be essential for AGVs that rely entirely on RMF to align towards their next destination. The fix implemented is to check for such gaps insidereconstruct_waypoints
and insert the rotation command as needed.Test the fix
The issue can be consistently reproduced in the Office demos world by sending a patrol command for
tinyRobot1
tohardware_2
. Do set theskip_rotation_commands
param toFalse
when testing.When the robot is returning from
hardware_2
to its charger, it would provide the following path:Notice the consecutive commands provided to the fleet adapter with
cmd_id
19 and 20 have neither the same location nor yaw. path provided to the fleet adapter goes fromWith this PR, an intermediate rotation waypoint (
cmd_id
20) will be inserted and provided to the fleet adapter: