Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dronekit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2643,10 +2643,10 @@ def target_location(self, roi):
if isinstance(roi, LocationGlobalRelative):
alt = roi.alt
elif isinstance(roi, LocationGlobal):
if not self.home_location:
self.commands.download()
self.commands.wait_ready()
alt = roi.alt - self.home_location.alt
if not self._vehicle.home_location:
self._vehicle.commands.download()
self._vehicle.commands.wait_ready()
alt = roi.alt - self._vehicle.home_location.alt
else:
raise ValueError('Expecting location to be LocationGlobal or LocationGlobalRelative.')

Expand Down