10 from std_msgs.msg
import Bool
11 from std_msgs.msg
import Float32
13 from std_msgs.msg
import Time
16 from jsk_recognition_msgs.msg
import HistogramWithRange
17 from jsk_recognition_msgs.msg
import PlotData
19 NAME =
"test_rqt_plugins" 26 unittest.TestCase.__init__(self, *args)
31 rospy.wait_for_message(topic_name, topic_type, WAIT_TIMEOUT)
32 except rospy.ROSException:
34 False,
'Could not subscribe topic ({}) in {} seconds'.
35 format(topic_name, WAIT_TIMEOUT))
38 while subs == []
and i < 10:
39 pubs, subs, _ = rosgraph.Master(
'/rostopic').getSystemState()
40 subs = [x[1]
for x
in subs
if x[0] == topic_name]
45 False,
'No node subscribes topic ({})'.format(topic_name))
46 if sub_node_name
not in subs[0]:
48 False,
'Node ({}) does not subscribe topic ({}), but {} does'.
49 format(sub_node_name, topic_name, subs))
55 '/pub_sample_2d_data/output', PlotData,
'/rqt_2d_plot'))
60 '/pub_sample_3d_data/output1', Float32,
'/rqt_3d_plot'))
65 '/rqt_drc_mini_maxwell'))
68 '/rqt_drc_mini_maxwell'))
71 '/drc_2015_environment/next_whiteout_time', Time,
72 '/rqt_drc_mini_maxwell'))
77 '/rqt_histogram_plot'))
106 rospy.wait_for_service(
'rqt_yn_btn', WAIT_TIMEOUT)
107 self.assertTrue(
True)
108 except rospy.ROSException:
109 self.assertTrue(
False,
'Could not find service (rqt_yn_btn)')
112 if __name__ ==
'__main__':
113 rosunit.unitrun(NAME, sys.argv[0], TestRqtPlugins)
def test_rqt_3d_plot(self)
def test_rqt_drc_mini_maxwell(self)
def test_rqt_histogram_plot(self)
def test_rqt_image_view2(self)
def test_rqt_2d_plot(self)
def test_rqt_status_light(self)
def test_rqt_yn_btn(self)
def test_rqt_string_label(self)
def is_subscribed(self, topic_name, topic_type, sub_node_name)
def test_rqt_service_buttons(self)