Closed epkeefe123 closed 1 week ago
@epkeefe123 The best place to ask DroneKit questions is in the discussion board for your flight stack - presumably Ardupilot. That may see unintuitive, but this project has only limited maintenance, and there are more people looking at those forums that here.
idk im just trying to set simulated vehicle to land here is the script if anyone wants to help: ` from dronekit import connect, VehicleMode, LocationGlobalRelative, LocationGlobal, Command import time import argparse import dronekit_sitl from pymavlink import mavutil
############################FUNCTION####################### def connectMyCopter(): parser = argparse.ArgumentParser(description='commands') parser.add_argument('--connect') args = parser.parse_args()
def arm_and_takeoff(aTargetAltitude): """ Arms vehicle and flies to aTargetAltitude. """ print("Basic pre-arm checks")
Don't try to arm until autopilot is ready
MAIN
vehicle = connectMyCopter() cmds = vehicle.commands cmds.download() cmds.wait_ready() arm_and_takeoff(4) vehicle.airspeed = 3 time.sleep(10) print("Going towards first point for 30 seconds ...") point1 = LocationGlobalRelative(-35.3626835,149.1651455 , 20) vehicle.simple_goto(point1)
sleep so we can see the change in map
time.sleep(40)
print("Rlanding") vehicle.simple_goto (vehicle.home_location, -5) vehicle.simple_goto ("LAND")
Close vehicle object before exiting script
print("Close vehicle object") vehicle.close()
`