From 541262d8497b772312d9494950a9958bc2c49517 Mon Sep 17 00:00:00 2001 From: Pioneer3 Date: Mon, 1 Oct 2018 11:57:21 +0200 Subject: [PATCH] Added shutdown of publishers, subscribers and services at the robot shutdown --- RosAria.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/RosAria.cpp b/RosAria.cpp index 5e86ef2..d10700e 100644 --- a/RosAria.cpp +++ b/RosAria.cpp @@ -406,6 +406,28 @@ RosAriaNode::~RosAriaNode() robot->stopRunning(); robot->waitForRunExit(); + + // Unregister all publishers, subscribers and services + pose_pub.shutdown(); + bumpers_pub.shutdown(); + wheel_pub.shutdown(); + recharge_state_pub.shutdown(); + state_of_charge_pub.shutdown(); + cmdvel_sub.shutdown(); + restrictions_sub.shutdown(); + userstop_sub.shutdown(); + masterstop_sub.shutdown(); + clutch_sub.shutdown(); + robot_info_pub.shutdown(); + + sonar_pub.shutdown(); + sonar_pointcloud2_pub.shutdown(); + + gripper_open_srv.shutdown(); + gripper_close_srv.shutdown(); + gripper_up_srv.shutdown(); + gripper_down_srv.shutdown(); + Aria::shutdown(); }