From c6f04dd916bc97ff060c8ab353c33f1b0fd6f490 Mon Sep 17 00:00:00 2001 From: Dima Dorezyuk Date: Fri, 3 Apr 2020 08:36:53 +0200 Subject: [PATCH 1/5] explicitly destruct global root class --- mbf_costmap_nav/src/move_base_server_node.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mbf_costmap_nav/src/move_base_server_node.cpp b/mbf_costmap_nav/src/move_base_server_node.cpp index edec7d9d..880c86f4 100644 --- a/mbf_costmap_nav/src/move_base_server_node.cpp +++ b/mbf_costmap_nav/src/move_base_server_node.cpp @@ -75,5 +75,9 @@ int main(int argc, char **argv) #endif costmap_nav_srv_ptr = boost::make_shared(tf_listener_ptr); ros::spin(); + + // explicitly desctructor here, otherwise this class will be destructed + // after tearing down internally allocaled static variables + costmap_nav_srv_ptr.reset(); return EXIT_SUCCESS; } From 711418147b741a22a0168da5bf722befec29d106 Mon Sep 17 00:00:00 2001 From: Dima Dorezyuk Date: Fri, 3 Apr 2020 09:09:56 +0200 Subject: [PATCH 2/5] call ros::Timer::stop in the destructor --- mbf_costmap_nav/src/mbf_costmap_nav/costmap_wrapper.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mbf_costmap_nav/src/mbf_costmap_nav/costmap_wrapper.cpp b/mbf_costmap_nav/src/mbf_costmap_nav/costmap_wrapper.cpp index 05899bab..50d89bbb 100644 --- a/mbf_costmap_nav/src/mbf_costmap_nav/costmap_wrapper.cpp +++ b/mbf_costmap_nav/src/mbf_costmap_nav/costmap_wrapper.cpp @@ -64,6 +64,7 @@ CostmapWrapper::CostmapWrapper(const std::string &name, const TFPtr &tf_listener CostmapWrapper::~CostmapWrapper() { + shutdown_costmap_timer_.stop(); } From 1930a1cebcf751c381f60f524ad1172db4780fd1 Mon Sep 17 00:00:00 2001 From: Dima Dorezyuk Date: Tue, 7 Apr 2020 08:07:01 +0200 Subject: [PATCH 3/5] fix commend wording --- mbf_costmap_nav/src/move_base_server_node.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mbf_costmap_nav/src/move_base_server_node.cpp b/mbf_costmap_nav/src/move_base_server_node.cpp index 880c86f4..0c3dd4a5 100644 --- a/mbf_costmap_nav/src/move_base_server_node.cpp +++ b/mbf_costmap_nav/src/move_base_server_node.cpp @@ -76,8 +76,8 @@ int main(int argc, char **argv) costmap_nav_srv_ptr = boost::make_shared(tf_listener_ptr); ros::spin(); - // explicitly desctructor here, otherwise this class will be destructed - // after tearing down internally allocaled static variables + // call explicitly desctructor here, otherwise costmap_nav_srv_ptr will be + // destructed after tearing down internally allocaled static variables costmap_nav_srv_ptr.reset(); return EXIT_SUCCESS; } From db7f10d58768836639ceff3d4506f5fd8917f7c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Santos=20Sim=C3=B3n?= Date: Tue, 7 Apr 2020 18:20:44 +0900 Subject: [PATCH 4/5] Update move_base_server_node.cpp --- mbf_costmap_nav/src/move_base_server_node.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mbf_costmap_nav/src/move_base_server_node.cpp b/mbf_costmap_nav/src/move_base_server_node.cpp index 0c3dd4a5..4e0e482d 100644 --- a/mbf_costmap_nav/src/move_base_server_node.cpp +++ b/mbf_costmap_nav/src/move_base_server_node.cpp @@ -76,8 +76,8 @@ int main(int argc, char **argv) costmap_nav_srv_ptr = boost::make_shared(tf_listener_ptr); ros::spin(); - // call explicitly desctructor here, otherwise costmap_nav_srv_ptr will be - // destructed after tearing down internally allocaled static variables + // explicitly call desctructor here, otherwise costmap_nav_srv_ptr will be + // destructed after tearing down internally allocated static variables costmap_nav_srv_ptr.reset(); return EXIT_SUCCESS; } From 4d34e79040c57fec8a7201651f2610a3c5aba441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Santos=20Sim=C3=B3n?= Date: Tue, 7 Apr 2020 18:26:48 +0900 Subject: [PATCH 5/5] Update move_base_server_node.cpp --- mbf_costmap_nav/src/move_base_server_node.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mbf_costmap_nav/src/move_base_server_node.cpp b/mbf_costmap_nav/src/move_base_server_node.cpp index 4e0e482d..668b5b4a 100644 --- a/mbf_costmap_nav/src/move_base_server_node.cpp +++ b/mbf_costmap_nav/src/move_base_server_node.cpp @@ -76,7 +76,7 @@ int main(int argc, char **argv) costmap_nav_srv_ptr = boost::make_shared(tf_listener_ptr); ros::spin(); - // explicitly call desctructor here, otherwise costmap_nav_srv_ptr will be + // explicitly call destructor here, otherwise costmap_nav_srv_ptr will be // destructed after tearing down internally allocated static variables costmap_nav_srv_ptr.reset(); return EXIT_SUCCESS;