I’m currently trying to use WPIcal to create a custom AprilTag field setup and I’m not sure how to set it up. I’ve tried following the instructions on how to run WPIcal from source, but I have no experience managing C++ extensions and I keep getting errors. My latest error is with configuring the cmake project, as whenever I run cmake -S . -B build -G "Visual Studio 17 2022" -T ClangCl -A x64 -DVCPKG_ROOT=<path/to/vcpkg>
I get errors saying “Could not find toolchain file: <path/to/vcpkg>/scripts/buildsystems/vcpkg.cmake
”. Does anyone know how to install WPIcal from source? Or better yet, is there a way to install a WPILib beta with WPIcal as a built-in Tool?
1 Like
It’s not in a WPILib release yet, as it’s still in development and the PR is still being worked on.
wpilibsuite:main
← ElliotScher:main
opened 01:24PM - 02 Aug 24 UTC
# WPIcal
WPIcal is a tool used to “calibrate” or empirically measure the posi… tion and orientation of the Apriltags on FRC fields. This tool was inspired by team 1538, The Holy Cows, who created a command-line tool to perform this field calibration: https://github.com/TheHolyCows/cowlibration-field. WPIcal aims to streamline field calibration by combining the needed camera calibration with the field calibration process into a user-friendly application.
## Overview
WPIcal performs camera calibration using a video of either a ChArUco board (using OpenCV calibration) or a chessboard (using MRcal). Users can also upload their own camera intrinsics JSON if they so choose. The tool then measures the positions of the Apriltags on the field relative to each other. By selecting a tag to “pin” or use the default position for, WPIcal will create a field map, in which the other tags on the field will be moved to their measured positions relative to the pinned tag.
## Proposal
Integrating this tool into WPILib will ensure that all teams have access to a good calibration technique for:
* Field calibration at events
* Calibration of practice fields (which are very often imperfect)
* Apriltag "sanity check" for FTAs (tag position readout is provided with both position and rotation deltas)
## Dependencies
WPIcal uses some dependencies that will need to be added to WPILib:
- [x] [mrcal-java](https://github.com/PhotonVision/mrcal-java) is a wrapper for the mrcal library
- [x] [mrcal](https://github.com/dkogan/mrcal) is a robust camera calibration library
- [x] [libdogleg](https://github.com/dkogan/libdogleg) is a optimization library that mrcal depends on (there may be license issues with this library)
- [x] [SuiteSparse](https://github.com/DrTimothyAldenDavis/SuiteSparse?tab=License-1-ov-file#readme) (this library is not explicitly used by WPIcal but is a dependency of mrcal-java)
- [x] [Ceres](http://ceres-solver.org/) is a numerical optimization library used to solve for the locations of each apriltag
## Tasks
WPIcal still has a couple of things that need to happen before it is ready:
- [x] Possible rename. WPIcal was the working title and suggestions are always appreciated!
- [x] Tool icon
- [x] Tool documentation
working version of WPIcal: https://github.com/ElliotScher/wpical
5 Likes