Adding ability to read config file for target_mapping

Change-Id: I0e682b5dd1051967c3752e8684d9fd258e6e1893
Signed-off-by: Jim Ostrowski <yimmy13@gmail.com>
diff --git a/y2023/vision/target_mapping.cc b/y2023/vision/target_mapping.cc
index a941923..8861e2e 100644
--- a/y2023/vision/target_mapping.cc
+++ b/y2023/vision/target_mapping.cc
@@ -1,3 +1,4 @@
+#include "aos/configuration.h"
 #include "aos/events/logging/log_reader.h"
 #include "aos/events/simulated_event_loop.h"
 #include "aos/init.h"
@@ -18,6 +19,8 @@
 
 DEFINE_string(json_path, "y2023/vision/maps/target_map.json",
               "Specify path for json with initial pose guesses.");
+DEFINE_string(config, "y2023/aos_config.json",
+              "Path to the config file to use.");
 DEFINE_string(constants_path, "y2023/constants/constants.json",
               "Path to the constant file");
 DEFINE_string(output_dir, "y2023/vision/maps",
@@ -112,8 +115,12 @@
 
   std::vector<DataAdapter::TimestampedDetection> timestamped_target_detections;
 
+  aos::FlatbufferDetachedBuffer<aos::Configuration> config =
+      aos::configuration::ReadConfig(FLAGS_config);
+
   // open logfiles
-  aos::logger::LogReader reader(aos::logger::SortParts(unsorted_logfiles));
+  aos::logger::LogReader reader(aos::logger::SortParts(unsorted_logfiles),
+                                &config.message());
   // Send new april tag poses. This allows us to take a log of images, then play
   // with the april detection code and see those changes take effect in mapping
   constexpr size_t kNumPis = 4;