The current home location (:py:class:`LocationGlobal`). To get the attribute you must first download the :py:func:`Vehicle.commands`. The attribute has a value of ``None`` until :py:func:`Vehicle.commands` has been downloaded **and** the autopilot has set an initial
(self)
| 1879 | |
| 1880 | @property |
| 1881 | def home_location(self): |
| 1882 | """ |
| 1883 | The current home location (:py:class:`LocationGlobal`). |
| 1884 | |
| 1885 | To get the attribute you must first download the :py:func:`Vehicle.commands`. |
| 1886 | The attribute has a value of ``None`` until :py:func:`Vehicle.commands` has been downloaded |
| 1887 | **and** the autopilot has set an initial home location (typically where the vehicle first gets GPS lock). |
| 1888 | |
| 1889 | .. code-block:: python |
| 1890 | |
| 1891 | #Connect to a vehicle object (for example, on com14) |
| 1892 | vehicle = connect('com14', wait_ready=True) |
| 1893 | |
| 1894 | # Download the vehicle waypoints (commands). Wait until download is complete. |
| 1895 | cmds = vehicle.commands |
| 1896 | cmds.download() |
| 1897 | cmds.wait_ready() |
| 1898 | |
| 1899 | # Get the home location |
| 1900 | home = vehicle.home_location |
| 1901 | |
| 1902 | The ``home_location`` is not observable. |
| 1903 | |
| 1904 | The attribute can be written (in the same way as any other attribute) after it has successfully |
| 1905 | been populated from the vehicle. The value sent to the vehicle is cached in the attribute |
| 1906 | (and can potentially get out of date if you don't re-download ``Vehicle.commands``): |
| 1907 | |
| 1908 | .. warning:: |
| 1909 | |
| 1910 | Setting the value will fail silently if the specified location is more than 50km from the EKF origin. |
| 1911 | |
| 1912 | |
| 1913 | """ |
| 1914 | return copy.copy(self._home_location) |
| 1915 | |
| 1916 | @home_location.setter |
| 1917 | def home_location(self, pos): |
nothing calls this directly
no test coverage detected