MCPcopy Create free account
hub / github.com/OpenDriveLab/DriveAdapter / destroy

Method destroy

scenario_runner/srunner/autoagents/ros_agent.py:162–181  ·  view source on GitHub ↗

Cleanup of all ROS publishers

(self)

Source from the content-addressed store, hash-verified

160 # pylint: enable=line-too-long
161
162 def destroy(self):
163 """
164 Cleanup of all ROS publishers
165 """
166 if self.stack_process and self.stack_process.poll() is None:
167 rospy.loginfo("Sending SIGTERM to stack...")
168 os.killpg(os.getpgid(self.stack_process.pid), signal.SIGTERM)
169 rospy.loginfo("Waiting for termination of stack...")
170 self.stack_process.wait()
171 time.sleep(5)
172 rospy.loginfo("Terminated stack.")
173
174 rospy.loginfo("Stack is no longer running")
175 self.world_info_publisher.unregister()
176 self.map_file_publisher.unregister()
177 self.vehicle_status_publisher.unregister()
178 self.vehicle_info_publisher.unregister()
179 self.waypoint_publisher.unregister()
180 self.stack_process = None
181 rospy.loginfo("Cleanup finished")
182
183 def on_vehicle_control(self, data):
184 """

Callers 7

cleanupMethod · 0.45
remove_actor_by_idMethod · 0.45
updateMethod · 0.45
terminateMethod · 0.45
terminateMethod · 0.45
resetMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected