-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
57 lines (49 loc) · 1.83 KB
/
app.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
import yaml
import argparse
from rosproject.rosproject import Project
from rostasks.csvtask import CsvTask
from rostasks.pointcloudtask import PointcloudTask
from rostasks.mocaptask import MocapTask
from rostasks.rgbtask import RgbTask
from rostasks.thermaltask import ThermalTask
from rostasks.odomtask import OdomTask
from rostasks.csvoldtask import CsvOldTask
from rostasks.groundtruthtask import GroundTruthTask
from rostasks.odomcolortask import OdomColorTask
def get_properties(filename):
with open(filename) as f:
properties = yaml.load(f, Loader=yaml.FullLoader)
return properties
def get_tasks(properties):
tasks = []
if properties.get("csv_task") == "true":
tasks.append(CsvTask())
if properties.get("pointcloud_task") == "true":
tasks.append(PointcloudTask())
if properties.get("mocap_task") == "true":
tasks.append(MocapTask())
if properties.get("rgb_task") == "true":
tasks.append(RgbTask())
if properties.get("thermal_task") == "true":
tasks.append(ThermalTask())
if properties.get("odom_task") == "true":
tasks.append(OdomTask())
if properties.get("csv_old_task") == "true":
tasks.append(CsvOldTask())
if properties.get("groundtruth_task") == "true":
tasks.append(GroundTruthTask())
if properties.get("odomcolor_task") == "true":
tasks.append(OdomColorTask())
return tasks
def main(config_file):
properties = get_properties(config_file)
rosproject = Project(properties=properties)
rosproject.processAllRuns(get_tasks(properties))
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="ROS dataset processor")
parser.add_argument("-c", "--config", help="Config file")
args = parser.parse_args()
if args.config:
main(args.config)
else:
parser.print_help()