|
Calico
A visual-inertial calibration library designed for rapid problem construction and debugging.
|
#include <multi_camera.h>


Public Member Functions | |
| MultiCamera (const absl::flat_hash_set< std::string > &imagers) | |
| MultiCamera (const MultiCamera &)=delete | |
| MultiCamera & | operator= (const MultiCamera &)=delete |
| void | SetName (const std::string &sensor_name) |
| const std::string & | GetName () const |
| absl::Status | SetModel (const std::string &imager, CameraIntrinsicsModel camera_model) |
| Setter for the camera model. | |
| absl::StatusOr< CameraIntrinsicsModel > | GetModel (const std::string &imager) const |
| Getter for the camera model. | |
| void | SetSensorExtrinsics (const Pose3d &pose_sensorrig_from_sensor) |
| const Pose3d & | GetSensorExtrinsics () const |
| absl::Status | SetImagerExtrinsics (const std::string &imager, const Pose3d &pose_sensor_from_imager) |
| absl::StatusOr< Pose3d > | GetImagerExtrinsics (const std::string &imager) const |
| absl::Status | SetIntrinsics (const std::string &imager, const Eigen::VectorXd &intrinsics) |
| absl::StatusOr< Eigen::VectorXd > | GetIntrinsics (const std::string &imager) const |
| absl::Status | SetLatency (const std::string &imager, double latency) |
| absl::StatusOr< double > | GetLatency (const std::string &imager) const |
| void | EnableExtrinsicsEstimation (bool enable) |
| absl::Status | EnableExtrinsicsEstimation (const std::string &imager, bool enable) |
| absl::Status | EnableIntrinsicsEstimation (const std::string &imager, bool enable) |
| absl::Status | EnableLatencyEstimation (const std::string &imager, bool enable) |
| void | SetLossFunction (utils::LossFunctionType loss, double scale) final |
| 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< absl::flat_hash_map< std::string, std::vector< CameraMeasurement > > > | Project (const std::vector< double > &interp_times, const Trajectory &sensorrig_trajectory, const WorldModel &world_model) const |
| absl::Status | AddMeasurement (const std::string &imager, const CameraMeasurement &measurement) |
| absl::Status | AddMeasurements (const std::string &imager, const std::vector< CameraMeasurement > &measurements) |
| const absl::flat_hash_map< std::string, absl::flat_hash_map< CameraObservationId, CameraMeasurement > > & | GetMeasurementIdToMeasurement () const |
| absl::StatusOr< absl::flat_hash_map< std::string, std::vector< std::pair< CameraMeasurement, Eigen::Vector2d > > > > | GetMeasurementResidualPairs () const |
| Returns a vector of measurement-residual pairs. More... | |
| void | ClearMeasurements () |
| This will also clear any internally stored residuals and marked outliers. | |
| int | NumberOfMeasurements (const std::string &imager) const |
| Get current number of measurements stored for a given imager. | |
Multi-camera class. This class can be used to calibrate multiple imagers on a single module, for example, stereo cameras.
| absl::Status calico::sensors::MultiCamera::AddMeasurement | ( | const std::string & | imager, |
| const CameraMeasurement & | measurement | ||
| ) |
Add a single camera measurement to the measurement list. Returns an error if the measurement's id is duplicated without adding.
| absl::Status calico::sensors::MultiCamera::AddMeasurements | ( | const std::string & | imager, |
| const std::vector< CameraMeasurement > & | measurements | ||
| ) |
Add multiple measurements to the measurement list. Returns an error status if any measurements are duplicates within its internally managed set of measurements.
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.
|
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.
|
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.
|
inline |
Getter for all measurements. Returns a map of observation ids to measurements. Will be empty if there are no measurements.
| absl::StatusOr< absl::flat_hash_map< std::string, std::vector< std::pair< CameraMeasurement, Eigen::Vector2d > > > > calico::sensors::MultiCamera::GetMeasurementResidualPairs | ( | ) | const |
Returns a vector of measurement-residual pairs.
Only returns for measurements that have residuals. Returns an error if there are more residuals than measurements, or if there are no measurements.
Note: This method will only return residuals for measurements that have NOT been marked as outliers.
| absl::StatusOr< absl::flat_hash_map< std::string, std::vector< CameraMeasurement > > > calico::sensors::MultiCamera::Project | ( | const std::vector< double > & | interp_times, |
| const Trajectory & | sensorrig_trajectory, | ||
| const WorldModel & | world_model | ||
| ) | const |
Compute synthetic camera measurements given a Trajectory and WorldModel. This method projects the world model through the kinematic chain at given timestamps. This method returns only valid synthetic measurements as would be observed by the actual sensor, complying with physicality such as features being in front of the camera. Returns measurements in the order of the interpolation timestamps.
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)\).
| absl::Status calico::sensors::MultiCamera::SetImagerExtrinsics | ( | const std::string & | imager, |
| const Pose3d & | pose_sensor_from_imager | ||
| ) |
Set the extrinsics for each internal sensor. This transform will be applied on top of pose_sensorrig_from_sensor which is held constant during optimization.
|
inlinefinalvirtual |
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.
|
inline |
Sets extrinsics for the camera module itself. Each sensor will internally have an additional extrinsics offset relative to this one. This can be set to a constant CAD value.
|
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.