testsuite_widget.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 #       
00003 # License: BSD
00004 #   https://raw.github.com/yujinrobot/kobuki_desktop/master/kobuki_qtestsuite/LICENSE 
00005 #
00006 ##############################################################################
00007 # Imports
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 #from rqt_py_common.extended_combo_box import ExtendedComboBox
00017 
00018 from geometry_msgs.msg import Twist
00019 from nav_msgs.msg import Odometry
00020 
00021 # Local resource imports
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()
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         #self.cmd_vel_publisher = rospy.Publisher(self._ui.configuration_dock.cmd_vel_topic_name(), Twist)
00050         #self.odom_subscriber = rospy.Subscriber(self._ui.configuration_dock.odom_topic_name(), Odometry, self.odometry_callback)
00051     
00052     def shutdown(self):
00053         self._ui.battery_profile_frame.shutdown()
00054         self._ui.gyro_drift_frame.shutdown()
00055         self._ui.wandering_frame.shutdown()
00056         self._ui.payload_frame.shutdown()
00057         self._ui.cliff_sensor_frame.shutdown()
00058         self._ui.life_frame.shutdown()
00059         
00060     ##########################################################################
00061     # Slot Callbacks
00062     ##########################################################################
00063     @Slot(str)
00064     def on_cmd_vel_topic_combo_box_currentIndexChanged(self, topic_name):
00065         # This is probably a bit broken, need to test with more than just /cmd_vel so
00066         # there is more than one option.
00067         self.cmd_vel_publisher = rospy.Publisher(str(self.cmd_vel_topic_combo_box.currentText()), Twist)
00068 
00069     @Slot(str)
00070     def on_odom_topic_combo_box_currentIndexChanged(self, topic_name):
00071         # Need to redo the subscriber here
00072         pass
00073     
00074     @Slot(int)
00075     def on_testsuite_tab_widget_currentChanged(self, index):
00076         self._current_tab.hibernate()
00077         self._current_tab = self._tabs[self._ui.testsuite_tab_widget.currentIndex()]
00078         self._current_tab.restore()
00079 


kobuki_qtestsuite
Author(s): Daniel Stonier
autogenerated on Mon Oct 6 2014 01:31:16