use unique_ptr for map_update_thread#2977
Merged
SteveMacenski merged 2 commits intoros-navigation:mainfrom Jun 1, 2022
Merged
Conversation
Signed-off-by: zhenpeng ge <zhenpeng.ge@qq.com>
Contributor
|
@gezp, please properly fill in PR template in the future. @SteveMacenski, use this instead.
|
| std::bind( | ||
| &Costmap2DROS::mapUpdateLoop, this, map_update_frequency_)); | ||
| map_update_thread_ = std::make_unique<std::thread>( | ||
| [this]() { |
Member
There was a problem hiding this comment.
I'd prefer that, if it works
Contributor
Author
There was a problem hiding this comment.
it seems that lambda is better than bind, you could see more detail here moveit/moveit2#872. but if you still think we should use bind, i can change back to bind.
Member
There was a problem hiding this comment.
Given its a 1 time setup, I don't think the overhead is a big deal
SteveMacenski
approved these changes
Jun 1, 2022
redvinaa
pushed a commit
to EnjoyRobotics/navigation2
that referenced
this pull request
Jun 30, 2022
* use unique_ptr for map_update_thread Signed-off-by: zhenpeng ge <zhenpeng.ge@qq.com> * update Signed-off-by: zhenpeng ge <zhenpeng.ge@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
replace raw pointer with unique_ptr.