Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 import roslib
00011 roslib.load_manifest('kobuki_qtestsuite')
00012 import rospy
00013
00014 from python_qt_binding.QtCore import Signal,Slot
00015 from python_qt_binding.QtGui import QWidget
00016
00017
00018 from geometry_msgs.msg import Twist
00019 from nav_msgs.msg import Odometry
00020
00021
00022 import detail.common_rc
00023 from detail.testsuite_ui import Ui_testsuite_widget
00024
00025 class TestSuiteWidget(QWidget):
00026
00027 def __init__(self, parent=None):
00028 super(TestSuiteWidget, self).__init__(parent)
00029 self._ui = Ui_testsuite_widget()
00030 self._tabs = []
00031
00032 def setupUi(self):
00033 self._ui.setupUi(self)
00034 self._tabs = [self._ui.battery_profile_frame,
00035 self._ui.gyro_drift_frame,
00036 self._ui.payload_frame,
00037 self._ui.cliff_sensor_frame,
00038 self._ui.life_frame,
00039 self._ui.wandering_frame
00040 ]
00041 self._current_tab = self._tabs[self._ui.testsuite_tab_widget.currentIndex()]
00042 self._ui.configuration_dock.setupUi()
00043 self._ui.battery_profile_frame.setupUi(self._ui.configuration_dock.cmd_vel_topic_name())
00044 self._ui.gyro_drift_frame.setupUi()
00045 self._ui.payload_frame.setupUi()
00046 self._ui.cliff_sensor_frame.setupUi()
00047 self._ui.life_frame.setupUi()
00048 self._ui.wandering_frame.setupUi()
00049
00050
00051
00052
00053
00054 self._ui.configuration_dock._ui.cmd_vel_topic_combo_box.currentIndexChanged[str].connect(
00055 self._ui.battery_profile_frame.on_cmd_vel_topic_combo_box_currentIndexChanged)
00056
00057 def shutdown(self):
00058 self._ui.battery_profile_frame.shutdown()
00059 self._ui.gyro_drift_frame.shutdown()
00060 self._ui.wandering_frame.shutdown()
00061 self._ui.payload_frame.shutdown()
00062 self._ui.cliff_sensor_frame.shutdown()
00063 self._ui.life_frame.shutdown()
00064
00065
00066
00067
00068 @Slot(str)
00069 def on_cmd_vel_topic_combo_box_currentIndexChanged(self, topic_name):
00070
00071
00072 print("Dude")
00073 self.cmd_vel_publisher = rospy.Publisher(str(self.cmd_vel_topic_combo_box.currentText()), Twist)
00074
00075 @Slot(str)
00076 def on_odom_topic_combo_box_currentIndexChanged(self, topic_name):
00077
00078 pass
00079
00080 @Slot(int)
00081 def on_testsuite_tab_widget_currentChanged(self, index):
00082 self._current_tab.hibernate()
00083 self._current_tab = self._tabs[self._ui.testsuite_tab_widget.currentIndex()]
00084 self._current_tab.restore()
00085