Added shutdown of publishers, subscribers and services at the robot shutdown

This commit is contained in:
Pioneer3 2018-10-01 11:57:21 +02:00
parent 0baeeca94b
commit 541262d849

View File

@ -406,6 +406,28 @@ RosAriaNode::~RosAriaNode()
robot->stopRunning(); robot->stopRunning();
robot->waitForRunExit(); 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(); Aria::shutdown();
} }