GTSAM factor for FRC

For folks experimenting with GTSAM for pose estimation:

I contributed some factors to the project, and I’d like your feedback.

One of them, “PlanarProjectionFactor1,” estimates Pose2d given constant landmarks, camera calibration and offset. The use case here is “smoothing,” e.g. using one of the Fixed Lag Smoother classes. Another, “PlanarProjectionFactor3,” uses constant landmarks to estimate pose, calibration, and offset simultaneously – the use case here is automatic camera calibration. There’s also an SFM factor, but since our landmarks are fixed, it’s not as useful.

Anyway, I’d like these to be generally useful to FRC, so please comment on this PR!

16 Likes

Lit, thanks! Good to see that the maintainers are excited about FRC (mom get the camera we famous)
image

7 Likes

Pushing FRC controls tech forward, one PR at a time.

6 Likes

Prof Dellaert has been incredibly patient and helpful. :slight_smile:

Can someone ELI5 this to me?

1 Like

A 5 year old might be too advanced for me as the technology has pushed the entry age down to age 3 years (and I saw one game for 2 year olds). Ages 3 to 5 robot navigation programming

GTSAM implements the “Factor Graph” approach to estimation. The general idea is to decompose the global estimation problem into a number of local terms (“factors”) representing residuals (e.g. camera re-projection error), and then iteratively solve the resulting (sparse) nonlinear system. If the errors are Gaussian, then this is a maximum-likelihood estimator.

A nice property of this estimator is that it optimizes over the factor residuals in measurement space, e.g. camera pixels. (Today we specify a pose-isotropic uncertainty of the camera-derived pose estimate, which is definitely wrong.)

GTSAM includes many factors useful in the robotics domain, e.g. representing odometry, or the bearing to a target, etc, and also variable types like 2d and 3d poses, cameras with distortion, etc. Much of this system is aimed at more-difficult problems than we encounter in FRC, e.g. airborne SLAM. The system is written in C++ with Matlab and python wrappers: we use python on Raspberry Pi.

The specific thing I made is a factor that represents the camera residual for 2d poses but 3d targets, which happened not to have been written before.

2 Likes