Ejemplo n.º 1
0
 def test_distance_calculation(self):
     wp = Waypoint(x=0, y=2, z=0)
     self.assertEquals(wp.dist([0, 4, 0]), 2,
                       'Distance calculation is wrong')
     self.assertEquals(wp.dist([2, 2, 0]), 2,
                       'Distance calculation is wrong')
     self.assertEquals(wp.dist([0, 2, 2]), 2,
                       'Distance calculation is wrong')
Ejemplo n.º 2
0
 def test_add_repeated_waypoint(self):
     wp = Waypoint(x=1, y=2, z=3, max_forward_speed=1)
     wp_set = WaypointSet()
     self.assertTrue(wp_set.add_waypoint(wp),
                     'Error occured while adding waypoint to empty set')
     self.assertFalse(wp_set.add_waypoint(wp),
                      'Repeated waypoint wrongfully added')
Ejemplo n.º 3
0
 def test_to_message(self):
     wp0 = Waypoint(x=1, y=2, z=3)
     wp1 = Waypoint()
     wp1.from_message(wp0.to_message())
     self.assertEquals(wp0, wp1, "Waypoint to message conversion failed")
Ejemplo n.º 4
0
 def test_distance_calculation(self):
     wp = Waypoint(x=0, y=2, z=0)
     self.assertEquals(wp.dist([0, 4, 0]), 2, 'Distance calculation is wrong')
     self.assertEquals(wp.dist([2, 2, 0]), 2, 'Distance calculation is wrong')
     self.assertEquals(wp.dist([0, 2, 2]), 2, 'Distance calculation is wrong')
Ejemplo n.º 5
0
 def test_violate_constraint_flag(self):
     wp = Waypoint()
     wp.violates_constraint = True
     self.assertTrue(wp.violates_constraint, 'Constraint violation flag not correctly set')
Ejemplo n.º 6
0
 def test_to_message(self):
     wp0 = Waypoint(x=1, y=2, z=3)
     wp1 = Waypoint()
     wp1.from_message(wp0.to_message())
     self.assertEquals(wp0, wp1, "Waypoint to message conversion failed")
Ejemplo n.º 7
0
 def test_violate_constraint_flag(self):
     wp = Waypoint()
     wp.violates_constraint = True
     self.assertTrue(wp.violates_constraint,
                     'Constraint violation flag not correctly set')
Ejemplo n.º 8
0
 def test_unequal_waypoints(self):
     wp0 = Waypoint(x=1, y=2, z=3)
     wp1 = Waypoint(x=6, y=5, z=4)
     self.assertNotEquals(wp0, wp1, 'Waypoints unequal operator failed')
Ejemplo n.º 9
0
 def test_equal_waypoints(self):
     wp0 = Waypoint(x=1, y=2, z=3)
     wp1 = Waypoint(x=1, y=2, z=3)
     self.assertEquals(wp0, wp1, 'Waypoints equal operator failed')