3 from sensor_msgs.msg
import Range
10 msg = rospy.wait_for_message(
'/sonar2', Range)
11 self.assertAlmostEqual(msg.range, msg.max_range)
14 msg = rospy.wait_for_message(
'/sonar', Range)
15 self.assertTrue(msg.range < 0.25
and msg.range > 0.22)
17 if __name__ ==
'__main__':
19 PKG_NAME =
'gazebo_plugins' 20 TEST_NAME = PKG_NAME +
'range_test' 21 rospy.init_node(TEST_NAME)
22 rostest.rosrun(PKG_NAME, TEST_NAME, TestRangePlugin)
def test_inside_range(self)