Send WMR calibration to SLAM tracker
This MR allows drivers to send cameras and IMU calibration to the SLAM tracker removing the need to make external calibration files. In particular, and considering !1291 (merged), SLAM tracking for WMR headsets now works without any manual input or configuration required from the user.
There are a couple of discussion points working on this MR brought:
-
Monado
xrt_matrix_*
are neither row nor column major and their layout depends on context. But some of our math functions use Eigen which, by default, is column major. For now, I'm just trying to be explicit about this in comments as WMR config matrices come in row major. But it might be good to standardize this. There are three alternatives I see:- Document each matrix field, parameter, and return value with the expected layout.
- Define
xrt_matrix_*
as column major: OpenGL and Eigen are column major and we usually use Eigen for matrix operations. - Define
xrt_matrix_*
as row major: OpenCV, C nested arrays, WMR are row major. We will need to make Eigen operations use row major types so things likeMatrix3f
need to be migrated toMatrix<float, 3, 3, RowMajor>
. The last paragraph from this Eigen documentation page made me doubt the usage of Eigen RowMajor though.
-
In this MR I introduced
t_imu_calibration
which is very similar tot_stereo_camera_calibration
. The size of the latter is about 700 bytes and uses reference counting. I'm not sure if that's a good idea given that most of the time you can just pass a pointer to a stack-allocated version of the struct or passing it by value is not that heavy if you only need to do it once or twice.t_imu_calibration
is around 300 bytes and for now I didn't implement reference counting on it. I have code for reference counting it but wasn't sure if I should use it. What do you think? -
There are some properties needed by SLAM systems that do not fit well in our calibration structs. I decided to add a small
t_slam_calib_extras
for passing those.