Skip to content
Snippets Groups Projects
Commit aa48277f authored by Tommy Persson's avatar Tommy Persson
Browse files

Work on search

parent c8b6deed
Branches
No related tags found
No related merge requests found
Pipeline #48816 passed
...@@ -77,6 +77,7 @@ parser.add_option ("", "--pathtest", action="store_true", dest="pathtest", help= ...@@ -77,6 +77,7 @@ parser.add_option ("", "--pathtest", action="store_true", dest="pathtest", help=
parser.add_option ("", "--pathtest2", action="store_true", dest="pathtest2", help="Debug path flying") parser.add_option ("", "--pathtest2", action="store_true", dest="pathtest2", help="Debug path flying")
parser.add_option ("", "--pathtest3", action="store_true", dest="pathtest3", help="Debug path flying") parser.add_option ("", "--pathtest3", action="store_true", dest="pathtest3", help="Debug path flying")
parser.add_option ("", "--pathtest4", action="store_true", dest="pathtest4", help="Debug path flying") parser.add_option ("", "--pathtest4", action="store_true", dest="pathtest4", help="Debug path flying")
parser.add_option ("", "--search-area", action="store_true", dest="search_area", help="Test search area")
parser.add_option ("", "--search-areas", action="store_true", dest="search_areas", help="Test search areas") parser.add_option ("", "--search-areas", action="store_true", dest="search_areas", help="Test search areas")
parser.add_option ("", "--n-areas", action="store", type="int", dest="n_areas", default=3, help="Specify number of areas to search") parser.add_option ("", "--n-areas", action="store", type="int", dest="n_areas", default=3, help="Specify number of areas to search")
parser.add_option ("", "--paper-scenario1", action="store_true", dest="paper_scenario1", help="Paper Scenario 1") parser.add_option ("", "--paper-scenario1", action="store_true", dest="paper_scenario1", help="Paper Scenario 1")
...@@ -368,6 +369,33 @@ def get_area(x0, y0, r): ...@@ -368,6 +369,33 @@ def get_area(x0, y0, r):
] ]
return res return res
def get_hang_path():
alt = 44.7
gps = [
GeoPoint(57.75966144938757, 16.68103467533825, alt),
GeoPoint(57.759489691043505, 16.68019771793411, alt),
GeoPoint(57.758384692843755, 16.68003676458714, alt),
GeoPoint(57.75612894701629, 16.680413100382026, alt),
GeoPoint(57.756107577478524, 16.681514382122586, alt),
GeoPoint(57.756257163977445, 16.682034988036325, alt),
GeoPoint(57.757282883292056, 16.683356526124967, alt),
GeoPoint(57.75844746680692, 16.683136269776885, alt),
GeoPoint(57.75967611515345, 16.682155127862572, alt),
GeoPoint(57.75982568688258, 16.681514382122586, alt)
]
return gps
def search_area(ns, unit):
alt = 29.8
gps = get_hang_path()
sa = Node("search-area", {"execunit": unit, "area": gps, "target-type": "human", "target-size": 4.0, "area-type": "field"})
tree = Node("seq", {"execution-ns": unit})
tree.add_child(sa)
mo = MissionObject("search_area", ns, options.display, options.verbose)
(res, reason, timing) = mo.delegation_process(tree, options.exectree)
return (res, reason, timing)
def search_areas(ns, unit): def search_areas(ns, unit):
abort = Node("abort", {"execunit": unit}) abort = Node("abort", {"execunit": unit})
a1 = get_area(-150, 0, 50) a1 = get_area(-150, 0, 50)
...@@ -382,7 +410,7 @@ def search_areas(ns, unit): ...@@ -382,7 +410,7 @@ def search_areas(ns, unit):
tree = Node("seq", {"execution-ns": unit}) tree = Node("seq", {"execution-ns": unit})
# tree.add_child(abort) # tree.add_child(abort)
tree.add_child(sa) tree.add_child(sa)
mo = MissionObject("search_area", ns, options.display, options.verbose) mo = MissionObject("search_areas", ns, options.display, options.verbose)
(res, reason, timing) = mo.delegation_process(tree, options.exectree) (res, reason, timing) = mo.delegation_process(tree, options.exectree)
return (res, reason, timing) return (res, reason, timing)
...@@ -630,6 +658,9 @@ if __name__ == "__main__": ...@@ -630,6 +658,9 @@ if __name__ == "__main__":
if options.pathtest4: if options.pathtest4:
res = pathtest4(ns) res = pathtest4(ns)
if options.search_area:
res = search_area(ns, unit)
if options.search_areas: if options.search_areas:
res = search_areas(ns, unit) res = search_areas(ns, unit)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment