Class NormalPriorOrientation2D

Inheritance Relationships

Base Type

  • public ceres::SizedCostFunction< 1, 1 >

Class Documentation

class NormalPriorOrientation2D : public ceres::SizedCostFunction<1, 1>

Implements a cost function that models a direct measurement or prior on a 2D orientation variable.

The cost function is of the form:

cost(x) = ||A(x - b)||^2

where, the matrix A and the vector b are fixed and x is the 2D orientation variable. In case the user is interested in implementing a cost function of the form

cost(x) = (x - mu)^T S^{-1} (x - mu)

where, mu is a vector and S is a covariance matrix, then, A = S^{-1/2}, i.e the matrix A is the square root information matrix (the inverse of the covariance). This is a specialization of the generic “normal prior” provided by the Ceres library that handles the 2*pi roll-over that occurs with rotations.

Public Functions

NormalPriorOrientation2D(const double A, const double b)

Constructor.

The number of rows in vector b must be the same as the number of columns of matrix A.

Parameters:
  • A[in] The residual weighting matrix, most likely the square root information matrix

  • b[in] The measured difference between variable x0 and variable x1. It is assumed that these are the same type of variable. At a minimum, they must have the same dimensions and the per-element subtraction operator must be valid.

virtual ~NormalPriorOrientation2D() = default

Destructor.

virtual bool Evaluate(double const *const *parameters, double *residuals, double **jacobians) const

Compute the cost values/residuals, and optionally the Jacobians, using the provided variable/parameter values.