-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
use unique_ptr for map_update_thread #2977
use unique_ptr for map_update_thread #2977
Conversation
Signed-off-by: zhenpeng ge <[email protected]>
@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]() { |
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.
Why not bind?
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'd prefer that, if it works
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.
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.
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.
Given its a 1 time setup, I don't think the overhead is a big deal
Signed-off-by: zhenpeng ge <[email protected]>
* use unique_ptr for map_update_thread Signed-off-by: zhenpeng ge <[email protected]> * update Signed-off-by: zhenpeng ge <[email protected]>
replace raw pointer with unique_ptr.