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