12
12
13
13
def define_args (parser ):
14
14
parser .add_argument ("dataset_path" , type = pathlib .Path , help = "Path to dataset" )
15
- parser .add_argument ("--output_html" , type = pathlib .Path , help = "Path to calibration report HTML output." )
16
- parser .add_argument ("--output_json" , type = pathlib .Path , help = "Path to JSON output." )
15
+ parser .add_argument ("output_html" , type = pathlib .Path , help = "Path to calibration report HTML output." )
17
16
parser .add_argument ("--zero" , help = "Rescale time to start from zero" , action = 'store_true' )
18
17
parser .add_argument ("--skip" , type = float , help = "Skip N seconds from the start" )
19
18
parser .add_argument ("--max" , type = float , help = "Plot max N seconds from the start" )
@@ -38,10 +37,6 @@ def generateReport(args):
38
37
'dataset_path' : str (jsonlFile .parent )
39
38
}
40
39
41
- if not args .output_html and not args .output_json :
42
- print ("Either --output_html or --output_json is required" )
43
- return
44
-
45
40
data = {
46
41
'accelerometer' : {"v" : [], "t" : [], "td" : []},
47
42
'gyroscope' : {"v" : [], "t" : [], "td" : []},
@@ -138,18 +133,10 @@ def addMeasurement(type, t, v):
138
133
diagnoseGNSS (data , output )
139
134
diagnoseCpu (data , output )
140
135
141
- if args .output_json :
142
- if os .path .dirname (args .output_json ):
143
- os .makedirs (os .path .dirname (args .output_json ), exist_ok = True )
144
- with open (args .output_json , "w" ) as f :
145
- f .write (json .dumps (output , indent = 4 ))
146
- print ("Generated JSON report data at:" , args .output_json )
147
-
148
- if args .output_html :
149
- if os .path .dirname (args .output_html ):
150
- os .makedirs (os .path .dirname (args .output_html ), exist_ok = True )
151
- generateHtml (output , args .output_html )
152
- print ("Generated HTML report at:" , args .output_html )
136
+ if os .path .dirname (args .output_html ):
137
+ os .makedirs (os .path .dirname (args .output_html ), exist_ok = True )
138
+ generateHtml (output , args .output_html )
139
+ print ("Generated HTML report at:" , args .output_html )
153
140
154
141
if __name__ == '__main__' :
155
142
def parse_args ():
0 commit comments