Sundry extrinsics/target mapping fixes.
Notes:
* Rate-limit foxglove image converter.
* Don't log foxglove image channels.
* Make pose error more permissive to allow for better matches covering
gaps in field.
* Allow matching between more than just the immediately previous target
detection for situations where multiple cameras see multiple separate
targets.
* I mucked around with --outlier_std_devs; idk how much impact it has.
* Fix event loops & distributed clock calculation in extrinsics.
* Update box of orins calibration appropriately.
* Fix FindCameraCalibration call in y2024 target_mapper.
* Generate a misnamed map of the blue-side [6, 10] tags on the EPA field.
The variations from the nominal seem to largely reflect real variation
in the field.
* Bump up max distance to consider targets in target mapper; this seems
to have negligible impact.
Change-Id: I6b790568908beaba2bee5006c9e4fd58c5cc4e47
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/y2024/vision/calibrate_multi_cameras.cc b/y2024/vision/calibrate_multi_cameras.cc
index 35f01db..dee6646 100644
--- a/y2024/vision/calibrate_multi_cameras.cc
+++ b/y2024/vision/calibrate_multi_cameras.cc
@@ -478,7 +478,6 @@
std::vector<frc971::vision::ImageCallback *> image_callbacks;
std::vector<Eigen::Affine3d> default_extrinsics;
- uint camera_count = 0;
for (const CameraNode &camera_node : node_list) {
const aos::Node *pi = aos::configuration::GetNode(
reader.configuration(), camera_node.node_name.c_str());
@@ -486,8 +485,9 @@
detection_event_loops.emplace_back(
reader.event_loop_factory()->MakeEventLoop(
(camera_node.camera_name() + "_detection").c_str(), pi));
+ aos::EventLoop *const event_loop = detection_event_loops.back().get();
frc971::constants::ConstantsFetcher<y2024::Constants> constants_fetcher(
- detection_event_loops.back().get());
+ event_loop);
// Get the calibration for this orin/camera pair
const calibration::CameraCalibration *calibration =
y2024::vision::FindCameraCalibration(constants_fetcher.constants(),
@@ -506,14 +506,12 @@
VLOG(1) << "Got extrinsics for " << camera_node.camera_name() << " as\n"
<< default_extrinsics.back().matrix();
- detection_event_loops.back()->MakeWatcher(
+ event_loop->MakeWatcher(
camera_node.camera_name(),
- [&reader, &detection_event_loops, camera_node,
- camera_count](const TargetMap &map) {
+ [&reader, event_loop, camera_node](const TargetMap &map) {
aos::distributed_clock::time_point pi_distributed_time =
reader.event_loop_factory()
- ->GetNodeEventLoopFactory(
- detection_event_loops.at(camera_count).get()->node())
+ ->GetNodeEventLoopFactory(event_loop->node())
->ToDistributedClock(aos::monotonic_clock::time_point(
aos::monotonic_clock::duration(
map.monotonic_timestamp_ns())));
@@ -523,7 +521,6 @@
VLOG(1) << "Created watcher for using the detection event loop for "
<< camera_node.camera_name() << " and size "
<< detection_event_loops.size();
- camera_count++;
}
reader.event_loop_factory()->Run();