(connpath)
| 21 | |
| 22 | @with_sitl |
| 23 | def 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 |
nothing calls this directly
no test coverage detected