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