7 from localizer_dwm1001.msg
import Anchor
28 rospy.init_node(
'test_anchor_2')
29 rospy.Subscriber(
"/dwm1001/anchor2", Anchor, self.
callback)
32 while not rospy.is_shutdown()
and counter < 5
and (
not self.
anchorData_ok):
35 rospy.loginfo(
"looping")
41 if isinstance(self.anchor2.id, str):
44 self.assertTrue(
False)
49 if isinstance(self.anchor2.x, float):
52 self.assertTrue(
False)
57 if isinstance(self.anchor2.y, float):
60 self.assertTrue(
False)
65 if isinstance(self.anchor2.z, float):
68 self.assertTrue(
False)
73 if isinstance(self.anchor2.distanceFromTag, float):
76 self.assertTrue(
False)
80 if __name__ ==
'__main__':
81 rosunit.unitrun(
'localizer_dwm1001',
'test_Anchor_2_Publisher', Anchor2TestCase)
def test_if_anchor_2_x_is_float(self)
def test_if_anchor_2_is_published(self)
def test_if_anchor_2_distanceFromTag_is_float(self)
def test_if_anchor_2_z_is_float(self)
def test_if_anchor_2_y_is_float(self)
def test_if_anchor_2_id_is_string(self)