Calico
A visual-inertial calibration library designed for rapid problem construction and debugging.
Public Member Functions | List of all members
calico::sensors::Accelerometer Class Reference

Accelerometer class. More...

#include <accelerometer.h>

Inheritance diagram for calico::sensors::Accelerometer:
Inheritance graph
[legend]
Collaboration diagram for calico::sensors::Accelerometer:
Collaboration graph
[legend]

Public Member Functions

 Accelerometer (const Accelerometer &)=delete
 
Accelerometeroperator= (const Accelerometer &)=delete
 
void SetName (const std::string &name)
 
const std::string & GetName () const
 
void SetExtrinsics (const Pose3d &T_sensorrig_sensor)
 
const Pose3dGetExtrinsics () const
 
absl::Status SetIntrinsics (const Eigen::VectorXd &intrinsics)
 
const Eigen::VectorXd & GetIntrinsics () const
 
absl::Status SetLatency (double latency)
 
double GetLatency () const
 
void EnableExtrinsicsEstimation (bool enable)
 
void EnableIntrinsicsEstimation (bool enable)
 
void EnableLatencyEstimation (bool enable)
 
void SetLossFunction (utils::LossFunctionType loss, double scale)
 Setter for loss function and scale.
 
absl::StatusOr< int > AddParametersToProblem (ceres::Problem &problem) final
 Add this sensor's calibration parameters to the ceres problem. More...
 
absl::StatusOr< int > AddResidualsToProblem (ceres::Problem &problem, Trajectory &sensorrig_trajectory, WorldModel &world_model) final
 Contribue this sensor's residuals to the ceres problem. More...
 
absl::Status SetMeasurementNoise (double sigma) final
 Set the measurement noise \(\sigma\). More...
 
absl::Status UpdateResiduals (ceres::Problem &problem) final
 Update residuals for this sensor. More...
 
void ClearResidualInfo () final
 Clear all stored info about residuals.
 
absl::StatusOr< std::vector< AccelerometerMeasurement > > Project (const std::vector< double > &interp_times, const Trajectory &sensorrig_trajectory, const WorldModel &world_model) const
 
absl::Status SetModel (AccelerometerIntrinsicsModel accelerometer_model)
 Setter for accelerometer model.
 
AccelerometerIntrinsicsModel GetModel () const
 Getter for accelerometer model.
 
absl::Status AddMeasurement (const AccelerometerMeasurement &measurement)
 Add an accelerometer measurement to the measurement list. More...
 
absl::Status AddMeasurements (const std::vector< AccelerometerMeasurement > &measurements)
 Add multiple measurements to the measurement list. More...
 
void ClearMeasurements ()
 Clear all measurements.
 
int NumberOfMeasurements () const
 Get current number of measurements stored.
 

Detailed Description

Accelerometer class.

Member Function Documentation

◆ AddMeasurement()

absl::Status calico::sensors::Accelerometer::AddMeasurement ( const AccelerometerMeasurement measurement)

Add an accelerometer measurement to the measurement list.

Returns an error if the measurement's id is duplicated without adding.

◆ AddMeasurements()

absl::Status calico::sensors::Accelerometer::AddMeasurements ( const std::vector< AccelerometerMeasurement > &  measurements)

Add multiple measurements to the measurement list.

Returns an error status if any measurements are duplicates. This method will add the entire vector, but skips any duplicates. Note: If this method encounters any duplicates, it will STILL attempt to add the entire vector. If it returns an error status, it means that all unique measurements have been added, but duplicates have been skipped.

◆ AddParametersToProblem()

absl::StatusOr< int > calico::sensors::Accelerometer::AddParametersToProblem ( ceres::Problem &  problem)
finalvirtual

Add this sensor's calibration parameters to the ceres problem.

Returns the number of parameters added to the problem, which should be intrinsics + extrinsics + latency. If the sensor's model hasn't been set yet, it will return an invalid argument error.

Implements calico::sensors::Sensor.

◆ AddResidualsToProblem()

absl::StatusOr< int > calico::sensors::Accelerometer::AddResidualsToProblem ( ceres::Problem &  problem,
Trajectory sensorrig_trajectory,
WorldModel world_model 
)
finalvirtual

Contribue this sensor's residuals to the ceres problem.

sensorrig_trajectory is the world-from-sensorrig trajectory \(\mathbf{T}^w_r(t)\).

Implements calico::sensors::Sensor.

◆ Project()

absl::StatusOr< std::vector< AccelerometerMeasurement > > calico::sensors::Accelerometer::Project ( const std::vector< double > &  interp_times,
const Trajectory sensorrig_trajectory,
const WorldModel world_model 
) const

Compute synthetic accelerometer measurements at given a sensorrig trajectory. This method interpolates the sensorrig trajectory at given timestamps and generates synthetic measurements as would be observed by the actual sensor at those timestamps. Gravity points in the direction as defined by WorldModel.

interp_times is a vector of timestamps in seconds at which sensorrig_trajectory will be interpolated. No assumptions are made about timestamp uniqueness or order.

sensorrig_trajectory is the world-from-sensorrig trajectory \(\mathbf{T}^w_r(t)\).

◆ SetMeasurementNoise()

absl::Status calico::sensors::Accelerometer::SetMeasurementNoise ( double  sigma)
finalvirtual

Set the measurement noise \(\sigma\).

This value is used to weight the sensor's residuals such that:

\[ \boldsymbol{\Sigma} = \sigma^2\mathbf{I}\\ \boldsymbol{\epsilon} = \boldsymbol{\Sigma}^{-1/2}\left(\mathbf{y} - \mathbf{\hat{y}}\left(\mathbf{x}, \boldsymbol{\beta}\right)\right)\\ \mathbf{J} = \frac{\partial\boldsymbol{\epsilon}}{\partial\delta\boldsymbol{\beta}}\\ \delta\boldsymbol{\beta} = \left(\mathbf{J}^T\mathbf{J}\right)^{-1}\mathbf{J}^T\boldsymbol{\epsilon} \]

Implements calico::sensors::Sensor.

◆ UpdateResiduals()

absl::Status calico::sensors::Accelerometer::UpdateResiduals ( ceres::Problem &  problem)
finalvirtual

Update residuals for this sensor.

This will only apply to measurements not marked as outliers.

Note: This method is meant to be invoked by BatchOptimizer ONLY. It is not recommended that you invoke this method manually.

Implements calico::sensors::Sensor.


The documentation for this class was generated from the following files: