Hi, Everybody
Can someone help me? I have a script in Python and I have the question:
How to import the flight parameters from Mission Planner (latitude, longitude, altitude) during the flight and show this?
This is my script:
import sys
import clr
import time
import math
import MissionPlanner #import *
clr.AddReference(“MissionPlanner.Utilities”) # includes the Utilities class
time.sleep(10) # wait 10 seconds before starting
print 'Starting Mission’
Script.ChangeMode(“Guided”) # changes mode to “Guided"
print 'Guided Mode’
item = MissionPlanner.Utilities.Locationwp() # creating waypoint
lat1=-3.780854
lon1=-38.541491
lat2=-3.779830
lon2=-38.541590 # Longitude value
alt = 100 # altitude value
dla=(lat1-lat2)601852
dlo=(lon1-lon2)601852
dist=math.sqrt(dla2+dlo2)
MissionPlanner.Utilities.Locationwp.lat.SetValue(item,lat2) # sets latitude
MissionPlanner.Utilities.Locationwp.lng.SetValue(item,lon2) # sets longitude
MissionPlanner.Utilities.Locationwp.alt.SetValue(item,alt) # sets altitude
print (dist,” meters")
MAV.setGuidedModeWP(item) # tells UAV “go to” the set lat/long @ alt
print 'Going to Point 1’
Script.ChangeMode(“RTL”) # Return to Launch point
print ‘Returning to Launch’