Set calibration visualizer image channel correctly
This makes the calibration visualizer take in a channel name, and
doesn't leave it hardcoded.
Signed-off-by: Maxwell Henderson <mxwhenderson@gmail.com>
Change-Id: I1fcc3058538a0bb93d15e1f1591b29b2aa1f62c6
diff --git a/frc971/vision/calibration_accumulator.cc b/frc971/vision/calibration_accumulator.cc
index 9c6222b..13481b4 100644
--- a/frc971/vision/calibration_accumulator.cc
+++ b/frc971/vision/calibration_accumulator.cc
@@ -114,12 +114,13 @@
}
CalibrationFoxgloveVisualizer::CalibrationFoxgloveVisualizer(
- aos::EventLoop *event_loop)
+ aos::EventLoop *event_loop, std::string_view camera_channel)
: event_loop_(event_loop),
- image_converter_(event_loop_, "/camera", "/camera",
+ image_converter_(event_loop_, camera_channel, camera_channel,
ImageCompression::kJpeg),
annotations_sender_(
- event_loop_->MakeSender<foxglove::ImageAnnotations>("/camera")) {}
+ event_loop_->MakeSender<foxglove::ImageAnnotations>(camera_channel)) {
+}
aos::FlatbufferDetachedBuffer<aos::Configuration>
CalibrationFoxgloveVisualizer::AddVisualizationChannels(
@@ -175,7 +176,7 @@
}),
data_(data),
visualizer_event_loop_(image_factory_->MakeEventLoop("visualization")),
- visualizer_(visualizer_event_loop_.get()) {
+ visualizer_(visualizer_event_loop_.get(), image_channel) {
imu_factory_->OnShutdown([]() { cv::destroyAllWindows(); });
// Check for IMUValuesBatch topic on both /localizer and /drivetrain channels,