2 PKG =
'test_tf2_web_republisher' 6 from tf2_web_republisher.msg
import TFSubscriptionAction, TFSubscriptionGoal, TFArray
7 from tf2_web_republisher.srv
import RepublishTFs, RepublishTFsRequest
21 Test the action interface for tf2_web_republisher. 26 client.wait_for_server(timeout=rospy.Duration(2))
27 goal = TFSubscriptionGoal(
28 source_frames=[
'foo',
'bar'],
34 client.send_goal(goal, done_cb=
None, active_cb=
None,
46 rospy.wait_for_service(
'republish_tfs', 2.0)
47 proxy = rospy.ServiceProxy(
'republish_tfs', RepublishTFs)
48 result = proxy(RepublishTFsRequest(source_frames=[
'foo',
'bar'],
53 timeout=rospy.Duration(1.0)))
54 sub = rospy.Subscriber(result.topic_name,
58 self.assertTrue(any([topic_tuple[0] == result.topic_name
59 for topic_tuple
in rospy.get_published_topics()]),
60 msg=str(rospy.get_published_topics()))
64 self.assertFalse(any([topic_tuple[0] == result.topic_name
65 for topic_tuple
in rospy.get_published_topics()]))
68 if __name__ ==
'__main__':
70 rospy.init_node(
'test_tf_web_republisher')
71 rostest.rosrun(PKG,
'test_tf2_web_republisher', TestTfRepublisher)
def transform_cb(self, _)