forked from k2shah/wadl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stanford.py
72 lines (59 loc) · 1.63 KB
/
stanford.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!bin/bash/python3
# wadl
from wadl.survey import Survey
from wadl.mission import Mission
# paramters
from wadl.solver.solver import SolverParameters
from wadl.lib.route import RouteParameters
from wadl.mission import MissionParameters
# suvey design script
# get file name
# files are assumed geofences (ID, lat, long)
file = "example/data/stanford.csv"
# make survey
name = 'stanford'
survey = Survey(name)
# add the keypoints
keyPoints = {"oval": (37.4298541, -122.1694745),
"MSL": (37.4266113, -122.173492)
}
survey.setKeyPoints(keyPoints)
# route paramters
routeParams = RouteParameters()
routeParams["limit"] = 30*60, # s
routeParams["speed"] = 5 # m/s
routeParams["altitude"] = 50.0 # m
# add the tasks
survey.addTask(file,
step=100,
home=["oval", "MSL"],
routeParameters=routeParams,
)
# solver parameters
solverParams = SolverParameters()
solverParams["subGraph_size"] = 20
solverParams["SATBound_offset"] = 4
solverParams["timeout"] = 30
# set the solver parameters
survey.setSolverParamters(solverParams)
# plan the survey
view = 0
# view current plan
if view == 1:
survey.view()
else:
# run path solver to plan paths and write output
survey.plan()
# survey.plot()
# make mission
# mission paramters
missionParams = MissionParameters()
missionParams["N_bands"] = 3
missionParams["autoland"] = False
missionParams["assign"] = "sequence"
missionParams["offset_takeoff_dist"] = 10
missionParams["offset_land_dist"] = 10
mission = Mission(missionParams)
mission.fromSurvey(survey, showPlot=True)
mission.setVersion(4, 0, 187)
mission.write()