James Kuszmaul | 18008f8 | 2023-02-23 20:52:50 -0800 | [diff] [blame^] | 1 | #include "aos/init.h" |
| 2 | #include "aos/util/file.h" |
| 3 | #include "gflags/gflags.h" |
| 4 | #include "y2023/localizer/map_expander_lib.h" |
| 5 | |
| 6 | DEFINE_string(target_map, "y2023/vision/maps/target_map.json", |
| 7 | "Path to the target map JSON file."); |
| 8 | DEFINE_string(relative_map, "y2023/constants/relative_scoring_map.json", |
| 9 | "Path to the relative scoring map JSON file."); |
| 10 | DEFINE_string(output, "y2023/constants/scoring_map.json", |
| 11 | "Path to the output scoring map JSON file."); |
| 12 | |
| 13 | int 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 | } |