testsuite_widget.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 #
3 # License: BSD
4 # https://raw.github.com/yujinrobot/kobuki_desktop/master/kobuki_qtestsuite/LICENSE
5 #
6 ##############################################################################
7 # Imports
8 ##############################################################################
9 
10 import roslib
11 roslib.load_manifest('kobuki_qtestsuite')
12 import rospy
13 
14 from python_qt_binding.QtCore import Signal,Slot
15 try: # indigo
16  from python_qt_binding.QtGui import QWidget
17 except ImportError: # kinetic+ (pyqt5)
18  from python_qt_binding.QtWidgets import QWidget
19 #from rqt_py_common.extended_combo_box import ExtendedComboBox
20 
21 from geometry_msgs.msg import Twist
22 from nav_msgs.msg import Odometry
23 
24 # Local resource imports
25 import detail.common_rc
26 from detail.testsuite_ui import Ui_testsuite_widget
27 
28 class TestSuiteWidget(QWidget):
29 
30  def __init__(self, parent=None):
31  super(TestSuiteWidget, self).__init__(parent)
32  self._ui = Ui_testsuite_widget()
33  self._tabs = []
34 
35  def setupUi(self):
36  self._ui.setupUi(self)
37  self._tabs = [self._ui.battery_profile_frame,
38  self._ui.gyro_drift_frame,
39  self._ui.payload_frame,
40  self._ui.cliff_sensor_frame,
41  self._ui.life_frame,
42  self._ui.wandering_frame
43  ]
44  self._current_tab = self._tabs[self._ui.testsuite_tab_widget.currentIndex()]
45  self._ui.configuration_dock.setupUi()
46  self._ui.battery_profile_frame.setupUi(self._ui.configuration_dock.cmd_vel_topic_name())
47  self._ui.gyro_drift_frame.setupUi()
48  self._ui.payload_frame.setupUi()
49  self._ui.cliff_sensor_frame.setupUi()
50  self._ui.life_frame.setupUi()
51  self._ui.wandering_frame.setupUi()
52  #self.cmd_vel_publisher = rospy.Publisher(self._ui.configuration_dock.cmd_vel_topic_name(), Twist)
53  #self.odom_subscriber = rospy.Subscriber(self._ui.configuration_dock.odom_topic_name(), Odometry, self.odometry_callback)
54  ####################
55  # Slot Callbacks
56  ####################
57  self._ui.configuration_dock._ui.cmd_vel_topic_combo_box.currentIndexChanged[str].connect(
58  self._ui.battery_profile_frame.on_cmd_vel_topic_combo_box_currentIndexChanged)
59 
60  def shutdown(self):
61  self._ui.battery_profile_frame.shutdown()
62  self._ui.gyro_drift_frame.shutdown()
63  self._ui.payload_frame.shutdown()
64  self._ui.cliff_sensor_frame.shutdown()
65  self._ui.life_frame.shutdown()
66  self._ui.wandering_frame.shutdown()
67 
68  ##########################################################################
69  # Slot Callbacks
70  ##########################################################################
71  @Slot(str)
73  # This is probably a bit broken, need to test with more than just /cmd_vel so
74  # there is more than one option.
75  print("Dude")
76  self.cmd_vel_publisher = rospy.Publisher(str(self.cmd_vel_topic_combo_box.currentText()), Twist, queue_size=10)
77 
78  @Slot(str)
80  # Need to redo the subscriber here
81  pass
82 
83  @Slot(int)
85  self._current_tab.hibernate()
86  self._current_tab = self._tabs[self._ui.testsuite_tab_widget.currentIndex()]
87  self._current_tab.restore()
88 
def on_cmd_vel_topic_combo_box_currentIndexChanged(self, topic_name)
Slot Callbacks.


kobuki_qtestsuite
Author(s): Daniel Stonier
autogenerated on Mon Jun 10 2019 13:53:02