Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 1 | #include "absl/flags/flag.h" |
Philipp Schrader | 790cb54 | 2023-07-05 21:06:52 -0700 | [diff] [blame] | 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 | |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 7 | ABSL_FLAG(std::string, target_map, "y2023/vision/maps/target_map.json", |
| 8 | "Path to the target map JSON file."); |
| 9 | ABSL_FLAG(std::string, relative_map, |
| 10 | "y2023/constants/relative_scoring_map.json", |
| 11 | "Path to the relative scoring map JSON file."); |
| 12 | ABSL_FLAG(std::string, output, "y2023/constants/scoring_map.json", |
| 13 | "Path to the output scoring map JSON file."); |
James Kuszmaul | 18008f8 | 2023-02-23 20:52:50 -0800 | [diff] [blame] | 14 | |
| 15 | int main(int argc, char *argv[]) { |
| 16 | aos::InitGoogle(&argc, &argv); |
| 17 | aos::FlatbufferDetachedBuffer<y2023::localizer::ScoringMap> map = |
| 18 | y2023::localizer::ExpandMap( |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 19 | aos::util::ReadFileToStringOrDie(absl::GetFlag(FLAGS_relative_map)), |
| 20 | aos::util::ReadFileToStringOrDie(absl::GetFlag(FLAGS_target_map))); |
James Kuszmaul | 18008f8 | 2023-02-23 20:52:50 -0800 | [diff] [blame] | 21 | aos::util::WriteStringToFileOrDie( |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 22 | absl::GetFlag(FLAGS_output), |
James Kuszmaul | 18008f8 | 2023-02-23 20:52:50 -0800 | [diff] [blame] | 23 | aos::FlatbufferToJson(map, {.multi_line = true, .max_multi_line = true})); |
| 24 | return EXIT_SUCCESS; |
| 25 | } |