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

Fix TF when global plan is not updated #44

Merged
merged 1 commit into from
Jul 6, 2023

Conversation

tonynajjar
Copy link

@tonynajjar tonynajjar commented Jul 4, 2023

Inspired from rst-tu-dortmund#408

@tonynajjar tonynajjar requested review from HovorunB and jplapp July 4, 2023 11:15
Copy link

@jplapp jplapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be tested on AMR before backporting

Comment on lines -724 to -726
global_frame, tf2_ros::fromMsg(plan_pose.header.stamp),
plan_pose.header.frame_id, tf2::timeFromSec(0),
plan_pose.header.frame_id, tf2::durationFromSec(0.5));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the global_plan is not updated then plan_pose.header.stamp is not updated, and since the TF buffer has a fixed cache time (5-10s), then this throws an Extrapolation error in the past.

The current approach gets the global_frame, which is odom, at the timestamp of the plan creation, however if the AMR is relocalized and odom changes, I think that this new odom should be used.

The fix is to simply get the latest odom->map (global_frame->plan_pose.header.frame_id) TF.

@tonynajjar tonynajjar merged commit 9427908 into ros2-master Jul 6, 2023
@tonynajjar
Copy link
Author

No need to backport as this isn't an issue seen in release, just a preventive fix

tonynajjar pushed a commit that referenced this pull request Aug 16, 2023
…an-not-updated"

This reverts commit 9427908, reversing
changes made to 4a18739.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants