blob: e13c0a1974dd5cc3921891c6543ad25387994056 [file] [log] [blame]
James Kuszmaul18008f82023-02-23 20:52:50 -08001#include "aos/init.h"
2#include "aos/util/file.h"
3#include "gflags/gflags.h"
4#include "y2023/localizer/map_expander_lib.h"
5
6DEFINE_string(target_map, "y2023/vision/maps/target_map.json",
7 "Path to the target map JSON file.");
8DEFINE_string(relative_map, "y2023/constants/relative_scoring_map.json",
9 "Path to the relative scoring map JSON file.");
10DEFINE_string(output, "y2023/constants/scoring_map.json",
11 "Path to the output scoring map JSON file.");
12
13int main(int argc, char *argv[]) {
14 aos::InitGoogle(&argc, &argv);
15 aos::FlatbufferDetachedBuffer<y2023::localizer::ScoringMap> map =
16 y2023::localizer::ExpandMap(
17 aos::util::ReadFileToStringOrDie(FLAGS_relative_map),
18 aos::util::ReadFileToStringOrDie(FLAGS_target_map));
19 aos::util::WriteStringToFileOrDie(
20 FLAGS_output,
21 aos::FlatbufferToJson(map, {.multi_line = true, .max_multi_line = true}));
22 return EXIT_SUCCESS;
23}