In nonlinear factors, the error function returns the negative log-likelihood as a non-linear function of the values in a The idea is that Gaussian factors have a quadratic error function that locally approximates the negative log-likelihood, and are obtained by linearizing the nonlinear error function at a given linearization.
The derived class,