2016-06-30 7 views
0

Ich möchte, dass mein Hubschrauber auf einer bestimmten Höhe startet, denn ich fahre jetzt alles auf ArduPilot SITL. Zuerst habe ich versucht, simple_goto()DroneKit - Einstellung der RTL-Höhe

vehicle.commands.download() 
vehicle.commands.wait_ready() 
finish_location = deepcopy(vehicle.home_location) 
finish_location.alt = flight_altitude 
vehicle.simple_goto(finish_location) 

simple_goto() funktioniert gut für andere Lage zu verwenden, aber wenn ich vehicle.home_location verwenden, kommt es mit Copter auf Höhe -7.5m absteigend. Was ist mehr Kopter ist nur absteigend, es fliegt nicht zu finish_location.

So habe ich versucht,

self.vehicle.mode = VehicleMode("RTL") 

Es funktioniert gut, RTL-Modus zu verwenden, aber ich kann mit Standard-15m nicht Art und Weise RTL Höhe zu meinen gewünschten flight_altitude Parametern einstellen finden, es läuft.

Antwort

0

Code unten funktioniert gut.

vehicle.commands.download() 
vehicle.commands.wait_ready() 
target_location = LocationGlobalRelative(0, 0, 0) 
target_location.lat = vehicle.home_location.lat 
target_location.lon = vehicle.home_location.lon 
target_location.alt = target_altitude 

Noch verstehe ich nicht, warum

vehicle.commands.download() 
vehicle.commands.wait_ready() 
finish_location = deepcopy(vehicle.home_location) 
finish_location.alt = flight_altitude 
vehicle.simple_goto(finish_location) 

funktioniert nicht.

Verwandte Themen