def _rqt_shutdown(self): ''' Shutdown handler coming from the rqt subprocess shutting down. This needs to be handled differently depending on whether it's us shutting it down because a ros master shut down (in which case we need to stay alive) or otherwise. ''' if not self._rqt_subprocess_shutdown_by_us: self._ros_master_monitor.shutdown() QCoreApplication.instance().quit() else: self._rqt_subprocess_shutdown_by_us = False
def shutdown(self): ''' Shutdowns from external signals or the abort button while waiting for a master. ''' print("Shutting down the ros master monitor") self._ros_master_monitor.shutdown() if self._rqt_subprocess is not None: print("Terminating subprocess") self._rqt_subprocess.send_signal(signal.SIGINT) # self._rqt_subprocess.terminate() # this is SIGTERM self._rqt_subprocess = None QCoreApplication.instance().quit()
def timerEvent(self, event): if rospy.is_shutdown(): QCoreApplication.instance().quit() # needed to move qt calls out of the ros callback, otherwise qt crashes because of inter-thread communication if self._set_window_visibility: self._set_window_visibility = False if not self.isVisible() and self._last_window_control_data == self._window: self.show() self.setGeometry(self._geometry) elif self.isVisible() and (not self._last_window_control_data or self._last_window_control_data == -self._window): self._geometry = self.geometry() self.hide()
def timerEvent(self, event): if rospy.is_shutdown(): QCoreApplication.instance().quit() # needed to move qt calls out of the ros callback, otherwise qt crashes because of inter-thread communication if self._set_window_visibility: self._set_window_visibility = False if not self.isVisible( ) and self._last_window_control_data == self._window: self.show() self.setGeometry(self._geometry) elif self.isVisible() and (not self._last_window_control_data or self._last_window_control_data == -self._window): self._geometry = self.geometry() self.hide()