-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_runner
executable file
·69 lines (57 loc) · 2.16 KB
/
test_runner
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
#!/usr/bin/env python3
import argparse
import os
parser = argparse.ArgumentParser()
parser.add_argument("-viz", type=int, help="Bool if visualization should be used")
def runner(
num_robots=2, world="v2_maze", method="combined", stop_time=400, tries=10, args=None
):
"""
sets the environment variables for the search and starts the search
"""
os.environ["tme_start_num"] = str(num_robots)
os.environ["tme_stop_time"] = str(stop_time)
print(method)
os.environ["tme_expl_method"] = str(method)
os.environ["tme_ROBOT_ENV"] = str(world)
os.environ["tme_ROBOT"] = "rto-1"
start_two = False
start_three = False
start_four = False
start_five = False
if num_robots >= 2:
start_two = True
if num_robots >= 3:
start_three = True
if num_robots >= 4:
start_four = True
if num_robots >= 5:
start_five = True
os.environ["tme_start_two"] = str(start_two)
os.environ["tme_start_three"] = str(start_three)
os.environ["tme_start_four"] = str(start_four)
os.environ["tme_start_five"] = str(start_five)
file_location = "catkin_ws/src/TU_Much_Exploration/tme_startup/launch"
file_name = "decentralized_launch.launch"
file_name = os.path.join(os.path.expanduser("~"), file_location, file_name)
for i in range(tries):
os.system(
f"roslaunch tme_startup decentralized_launch.launch arg_viz:={args.viz}"
)
if __name__ == "__main__":
# this is the main method for running multiple simulations without needing
# to roslaunch manually
args = parser.parse_args()
num_robots = [5] # [2, 3, 4, 5]
world = ["v2_maze"] # 'v2_maze', 'map_3', 'marty'
# ["nearest", 'minPos', 'nextFrontier', 'coExplore', 'co122']
method = ["coExplore"]
stop_time = [250] # [500, 400, 300, 250]
tries = [1]
for x in range(len(tries)):
for j in range(len(num_robots)):
for i in range(len(world)):
for y in range(len(method)):
runner(
num_robots[j], world[i], method[y], stop_time[j], tries[x], args
)