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

Method destroy

leaderboard/leaderboard/autoagents/ros_agent.py:163–182  ·  view source on GitHub ↗

Cleanup of all ROS publishers

(self)

Source from the content-addressed store, hash-verified

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

Callers 2

_cleanupMethod · 0.45
cleanupMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected