MCPcopy
hub / github.com/dronekit/dronekit-python / test_set_home

Function test_set_home

dronekit/test/sitl/test_waypoints.py:23–42  ·  view source on GitHub ↗
(connpath)

Source from the content-addressed store, hash-verified

21
22@with_sitl
23def test_set_home(connpath):
24 vehicle = connect(connpath, wait_ready=True)
25
26 # Wait for home position to be real and not 0, 0, 0
27 # once we request it via cmds.download()
28 time.sleep(10)
29 vehicle.commands.download()
30 vehicle.commands.wait_ready()
31 assert_not_equals(vehicle.home_location, None)
32
33 # Note: If the GPS values differ heavily from EKF values, this command
34 # will basically fail silently. This GPS coordinate is tailored for that
35 # the with_sitl initializer uses to not fail.
36 vehicle.home_location = LocationGlobal(-35, 149, 600)
37 vehicle.commands.download()
38 vehicle.commands.wait_ready()
39
40 assert_equals(vehicle.home_location.lat, -35)
41 assert_equals(vehicle.home_location.lon, 149)
42 assert_equals(vehicle.home_location.alt, 600)
43
44
45@with_sitl

Callers

nothing calls this directly

Calls 4

connectFunction · 0.90
LocationGlobalClass · 0.90
downloadMethod · 0.80
wait_readyMethod · 0.45

Tested by

no test coverage detected