-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
86 lines (81 loc) · 2.94 KB
/
test.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import argparse
import time
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--algo", default=False, action='store_true')
parser.add_argument("--env", default=False, action='store_true')
parser.add_argument("--sim", default=False, action='store_true')
parser.add_argument("--ar", default=False, action='store_true')
parser.add_argument("--clock", default=False, action='store_true')
parser.add_argument("--nn", default=False, action='store_true')
parser.add_argument("--mirror", default=False, action='store_true')
parser.add_argument("--render", default=False, action='store_true')
parser.add_argument("--timing", default=False, action='store_true')
parser.add_argument("--all", default=False, action='store_true')
parser.add_argument("--CI", default=False, action='store_true')
args = parser.parse_args()
if not any(vars(args).values()):
parser.print_help()
exit()
if args.all:
args.algo = True
args.env = True
args.sim = True
args.clock = True
args.nn = True
args.mirror = True
args.render = True
args.timing = True
elif args.CI: # Tests run by CI
args.algo = True
args.env = True
args.sim = False
args.clock = True
args.nn = True
args.mirror = True
args.render = False
args.timing = True
args.train = False # GLFW error on CI
if args.algo:
from testing.test_algo import test_all_algos
test_all_algos()
if args.env:
import testing.test_env as test_env
test_env.test_all_env()
if args.sim:
import testing.test_sim as test_sim
test_sim.test_all_sim()
if args.render:
from testing.test_offscreen_render import test_offscreen_rendering, test_pointcloud_rendering
test_offscreen_rendering()
test_pointcloud_rendering()
if args.ar:
import asyncio
from testing.test_ar_sim import (
test_ar_connect,
test_ar_api_goto,
test_ar_sim_forward,
test_ar_sim_llapi_walking_handover,
test_ar_sim_llapi_teststand
)
asyncio.run(test_ar_connect())
asyncio.run(test_ar_api_goto())
asyncio.run(test_ar_sim_forward())
asyncio.run(test_ar_sim_llapi_teststand())
asyncio.run(test_ar_sim_llapi_walking_handover())
if args.clock:
from testing.test_clock import test_all_clocks
test_all_clocks()
if args.nn:
from testing.test_nn import test_nn
test_nn()
if args.mirror:
from testing.test_mirror import test_mirror
test_mirror()
if args.timing:
from testing.tracker_test import tracker_test
from testing.sampling_speed import sampling_speed, run_PD_env_compare, run_model_compare
sampling_speed()
# run_PD_env_compare()
# tracker_test()
# run_model_compare()