Actually detect apriltags
This does the line fits for the borders, finds the best up to 10
candidate corners, and picks the best one. It then does the final
filtering to pick which quads to evaluate, evaluates them, and then uses
aprilrobotics to refine and report out the solution.
There's a small (1e-3) discrepency on some of the tags to track down,
but overall it works pretty well. Takes 4ms to process the imx296
images.
Change-Id: I6cff5654252897f46def422c021b1dce74036476
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/frc971/orin/cuda.h b/frc971/orin/cuda.h
index e386aa6..2cc8f44 100644
--- a/frc971/orin/cuda.h
+++ b/frc971/orin/cuda.h
@@ -139,12 +139,15 @@
// Copies data to host memory from this memory asynchronously on the provided
// stream.
- void MemcpyAsyncTo(T *host_memory, CudaStream *stream) const {
+ void MemcpyAsyncTo(T *host_memory, size_t size, CudaStream *stream) const {
CHECK_CUDA(cudaMemcpyAsync(reinterpret_cast<void *>(host_memory),
reinterpret_cast<void *>(memory_),
- sizeof(T) * size_, cudaMemcpyDeviceToHost,
+ sizeof(T) * size, cudaMemcpyDeviceToHost,
stream->get()));
}
+ void MemcpyAsyncTo(T *host_memory, CudaStream *stream) const {
+ MemcpyAsyncTo(host_memory, size_, stream);
+ }
void MemcpyAsyncTo(HostMemory<T> *host_memory, CudaStream *stream) const {
MemcpyAsyncTo(host_memory->get(), stream);
}
@@ -195,11 +198,12 @@
};
// Synchronizes and CHECKs for success the last CUDA operation.
-void CheckAndSynchronize();
+void CheckAndSynchronize(std::string_view message = "");
// Synchronizes and CHECKS iff --sync is passed on the command line. Makes it
// so we can leave debugging in the code.
void MaybeCheckAndSynchronize();
+void MaybeCheckAndSynchronize(std::string_view message);
} // namespace apriltag
} // namespace frc971