Conversation
…proper merging into the master costmap
There was a problem hiding this comment.
Pull request overview
This PR addresses rolling-window costmap “flicker” by caching the last received GridMap-derived costs in the plugin’s internal costmap buffer and re-merging that buffer into the master costmap every update cycle (even when no new GridMap message arrives).
Changes:
- Stop gating
updateCosts()onhas_updated_data_so the layer contributes every cycle. - On new GridMap data, copy interpreted costs into the layer’s internal buffer via
setCost(). - Merge the internal buffer into the master costmap each cycle using
updateWithMax()orupdateWithTrueOverwrite().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ConnorNeed
left a comment
There was a problem hiding this comment.
Makes complete sense to me.
The only thing I will say is we might still want to guard against writing to master until we have recieved at least one map. That's how it looks like the other plugins do it. In terms of the second AI comment I am okay with throwing and crashing the system with a very detailed error rather than trying to continue without our main vision mapping.
The build machine might not be plugged into the router. I'll plug it back in when I get there tonight but feel free to merge in when you are ready.
ConnorNeed
left a comment
There was a problem hiding this comment.
Sorry thought of this after I approved the first time
| if (cost == NO_INFORMATION) { | ||
| continue; | ||
| // When new grid map data has arrived, copy it into the internal buffer | ||
| if (has_updated_data_) { |
There was a problem hiding this comment.
| if (has_updated_data_) { | |
| if (has_updated_data_ || layered_costmap_->isRolling()) { |
How much does this hurt performance?
When costmap is located at (x1, y1) then translated to the costmap frame and copied over to the intenal layer. Then the next iteration happens and no new message has come in. We don't copy over to the intenal layer since no new map has happened. Internal layer is still based on (x1, y1) even though the robot has moved to (x2, y2). We don't move fast enough to really notice it but if we stop recieving data (very possible if the zed crashes) then the rolling costmap will stay the same even if the rover moves for a long time.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8afae6e to
03fe79c
Compare
I had an issue where both costmaps were flickering out for like 0.2 seconds every second on rviz. It also saw that the planner was planner through obstacles when this happening meaning what I saw was truly the costmap plugin show a fully unknown costmap. When I turn off rolling costmap, the issue goes away. So I'm pretty confident this issue is because the rolling window config is clearing the map and so we need the gridmaplayer plugin to track the costmap state and handle remembering obstacles.
@ConnorNeed can you look through this code and let me know if it makes sense with your knowledge of the costmap plugin system?