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(); }