Exemplo n.º 1
0
 def __init__(self, parent=None):
     super(LifeFrame, self).__init__(parent)
     self._ui = Ui_life_frame()
     self._motion = Rotate('/mobile_base/commands/velocity')
     self._motion_thread = None
     self._timer = QTimer()
     #self._timer.setInterval(60000) #60s
     self._timer.setInterval(250) #60s
     self._timer.timeout.connect(self.update_progress_callback)
     self._state = LifeFrame.STATE_STOPPED
     self._is_alive = False # Used to indicate whether the frame is alive or not (see hibernate/restore methods)
Exemplo n.º 2
0
 def on_start_button_clicked(self):
     self._ui.start_button.setEnabled(False)
     self._ui.stop_button.setEnabled(True)
     if not self._motion: 
         self._motion = Rotate(self._cmd_vel_topic_name)
         self._motion.init(self._ui.angular_speed_spinbox.value())
     if not self.robot_state_subscriber:
         self.robot_state_subscriber = rospy.Subscriber("/mobile_base/events/robot_state", RobotStateEvent, self.robot_state_callback)
     rospy.sleep(0.5)
     self._plot_widget._start_time = rospy.get_time()
     self._plot_widget.enable_timer(True)
     try:
         self._plot_widget.remove_topic(self._battery_topic_name)
     except KeyError:
         pass
     self._plot_widget.add_topic(self._battery_topic_name)
     self._motion_thread = WorkerThread(self._motion.execute, self._run_finished)
     self._motion_thread.start()