-
Notifications
You must be signed in to change notification settings - Fork 241
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 frame jitter by splitting map and fixed-frame transforms #72
Conversation
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.
Massive props, this both makes it much more readable and fixes the annoying jitter bug :)
I know you said that the you want to work on the description but I'll give you just a few thoughts on this already:
- The name of this PR and the commit should also contain that it fixes the map jittering
- The commit message should contains some insights what the fix of the jittering was, which is 1. we had to lookup the transforms in
update()
because otherwise the map "lags behind" when the nav sat fix frequency is low and 2. some lookups have to be done with Ros::Time() and not the timestamp of the nav sat fix message because we want to query the current position of the robot and not an old one. - In the source file there should be a summary of what is happening. For example you put something like this at the top of the source file: "The navSatFixCallback calls the updateCenterTile function, which then caches the center tile (as an attribute) and calls transformTileToMapFrame. On each frame, update() is called, which calls transformMapTileToFixedFrame, which calculates t_map_center_tile which is (exclusively) used in transformMapTileToFixedFrame."
Btw please don't force push and just create new commits when updating this PR, so it's easier to review in GitHub. In the end we will squash-merge it.
Also /cc @m-naumann and @RonaldEnsing you might be interested in this fix
I tested your PR finally. Here is what I did (I changed your test plan a little bit):
|
There is a specific error in the console. But feel free to open up a ticket :)
Lets do that in #79.
Its no regression, is it? If not, lets do it in #51 |
anything left to do? |
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.
LGTM
\o/ would you do a release? major or minor? |
ack |
Fixes #56:
The jitter exists if the frequency of the NavSatFix callback is lower than RViz' framerate and the transform update rate. This is usually the case, GPS often comes with only 1Hz, while RViz" fps are usually 30-60Hz, localization transforms have usually a high frequency (>50Hz).
It origins from unsynchronized transforms: The scene node's pose is only updated on callback, but in-between callbacks, the robot might move. I.e.: the map-repaint lags behind.
In order to synchronize this, we need to transform the scene-node on every render-frame with the latest information, as usual with RViz Display plugins rendering data that is attached to a tf-frame.
So we split the transform from the tile map to the fixed-frame into two transforms, created at two locations:
Along with this change, we:
TODO:
Test Plan