From 06bf92eb6f17f21ac2ebdda795cdca82319baf6e Mon Sep 17 00:00:00 2001 From: Thorsten Bar <52098068+thorstenbar@users.noreply.github.com> Date: Sun, 16 Feb 2020 11:12:57 +0200 Subject: [PATCH] Fixed gimbal target location --- dronekit/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dronekit/__init__.py b/dronekit/__init__.py index 4f3613906..bc2cf89ef 100644 --- a/dronekit/__init__.py +++ b/dronekit/__init__.py @@ -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.')