Public Types | Public Member Functions | Protected Attributes | Private Types | List of all members
gtsam::SmartProjectionPoseFactor< CALIBRATION > Class Template Reference

#include <SmartProjectionPoseFactor.h>

Inheritance diagram for gtsam::SmartProjectionPoseFactor< CALIBRATION >:
Inheritance graph
[legend]

Public Types

typedef std::shared_ptr< Thisshared_ptr
 shorthand for a smart pointer to a factor More...
 
- Public Types inherited from gtsam::SmartProjectionFactor< PinholePose< CALIBRATION > >
typedef PinholePose< CALIBRATION > Camera
 shorthand for a set of cameras More...
 
typedef CameraSet< PinholePose< CALIBRATION > > Cameras
 
typedef std::shared_ptr< Thisshared_ptr
 shorthand for a smart pointer to a factor More...
 
- Public Types inherited from gtsam::SmartFactorBase< PinholePose< CALIBRATION > >
typedef CameraSet< PinholePose< CALIBRATION > > Cameras
 The CameraSet data structure is used to refer to a set of cameras. More...
 
typedef std::vector< MatrixZD, Eigen::aligned_allocator< MatrixZD > > FBlocks
 
typedef Eigen::Matrix< double, ZDim, DimMatrixZD
 
- Public Types inherited from gtsam::NonlinearFactor
typedef std::shared_ptr< Thisshared_ptr
 
- Public Types inherited from gtsam::Factor
typedef KeyVector::const_iterator const_iterator
 Const iterator over keys. More...
 
typedef KeyVector::iterator iterator
 Iterator over keys. More...
 

Public Member Functions

const std::shared_ptr< CALIBRATION > calibration () const
 
Base::Cameras cameras (const Values &values) const override
 
bool equals (const NonlinearFactor &p, double tol=1e-9) const override
 equals More...
 
double error (const Values &values) const override
 
void print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
 
 SmartProjectionPoseFactor ()
 
 SmartProjectionPoseFactor (const SharedNoiseModel &sharedNoiseModel, const std::shared_ptr< CALIBRATION > K, const SmartProjectionParams &params=SmartProjectionParams())
 
 SmartProjectionPoseFactor (const SharedNoiseModel &sharedNoiseModel, const std::shared_ptr< CALIBRATION > K, const std::optional< Pose3 > body_P_sensor, const SmartProjectionParams &params=SmartProjectionParams())
 
 ~SmartProjectionPoseFactor () override
 
- Public Member Functions inherited from gtsam::SmartProjectionFactor< PinholePose< CALIBRATION > >
void computeJacobiansWithTriangulatedPoint (typename Base::FBlocks &Fs, Matrix &E, Vector &b, const Cameras &cameras) const
 
std::shared_ptr< RegularHessianFactor< Base::Dim > > createHessianFactor (const Cameras &cameras, const double lambda=0.0, bool diagonalDamping=false) const
 Create a Hessianfactor that is an approximation of error(p). More...
 
std::shared_ptr< JacobianFactorQ< Base::Dim, 2 > > createJacobianQFactor (const Cameras &cameras, double lambda) const
 Create JacobianFactorQ factor. More...
 
std::shared_ptr< JacobianFactorQ< Base::Dim, 2 > > createJacobianQFactor (const Values &values, double lambda) const
 Create JacobianFactorQ factor, takes values. More...
 
std::shared_ptr< JacobianFactorcreateJacobianSVDFactor (const Cameras &cameras, double lambda) const
 Different (faster) way to compute a JacobianFactorSVD factor. More...
 
std::shared_ptr< RegularImplicitSchurFactor< PinholePose< CALIBRATION > > > createRegularImplicitSchurFactor (const Cameras &cameras, double lambda) const
 
bool decideIfTriangulate (const Cameras &cameras) const
 Check if the new linearization point is the same as the one used for previous triangulation. More...
 
bool equals (const NonlinearFactor &p, double tol=1e-9) const override
 equals More...
 
double error (const Values &values) const override
 Calculate total reprojection error. More...
 
bool isDegenerate () const
 
bool isFarPoint () const
 
bool isOutlier () const
 
bool isPointBehindCamera () const
 
bool isValid () const
 Is result valid? More...
 
std::shared_ptr< GaussianFactorlinearize (const Values &values) const override
 linearize More...
 
std::shared_ptr< GaussianFactorlinearizeDamped (const Cameras &cameras, const double lambda=0.0) const
 
std::shared_ptr< GaussianFactorlinearizeDamped (const Values &values, const double lambda=0.0) const
 
virtual std::shared_ptr< RegularHessianFactor< Base::Dim > > linearizeToHessian (const Values &values, double lambda=0.0) const
 Linearize to a Hessianfactor. More...
 
virtual std::shared_ptr< RegularImplicitSchurFactor< PinholePose< CALIBRATION > > > linearizeToImplicit (const Values &values, double lambda=0.0) const
 Linearize to an Implicit Schur factor. More...
 
virtual std::shared_ptr< JacobianFactorQ< Base::Dim, 2 > > linearizeToJacobian (const Values &values, double lambda=0.0) const
 Linearize to a JacobianfactorQ. More...
 
TriangulationResult point () const
 
TriangulationResult point (const Values &values) const
 
void print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
 
Vector reprojectionErrorAfterTriangulation (const Values &values) const
 Calculate vector of re-projection errors, before applying noise model. More...
 
 SmartProjectionFactor ()
 
 SmartProjectionFactor (const SharedNoiseModel &sharedNoiseModel, const SmartProjectionParams &params=SmartProjectionParams())
 
double totalReprojectionError (const Cameras &cameras, std::optional< Point3 > externalPoint={}) const
 
bool triangulateAndComputeE (Matrix &E, const Cameras &cameras) const
 
bool triangulateAndComputeE (Matrix &E, const Values &values) const
 
bool triangulateAndComputeJacobians (typename Base::FBlocks &Fs, Matrix &E, Vector &b, const Values &values) const
 Version that takes values, and creates the point. More...
 
bool triangulateAndComputeJacobiansSVD (typename Base::FBlocks &Fs, Matrix &Enull, Vector &b, const Values &values) const
 takes values More...
 
bool triangulateForLinearize (const Cameras &cameras) const
 Possibly re-triangulate before calculating Jacobians. More...
 
TriangulationResult triangulateSafe (const Cameras &cameras) const
 Call gtsam::triangulateSafe iff we need to re-triangulate. More...
 
 ~SmartProjectionFactor () override
 
- Public Member Functions inherited from gtsam::SmartFactorBase< PinholePose< CALIBRATION > >
void add (const SFM_TRACK &trackToAdd)
 
void add (const Z &measured, const Key &key)
 
void add (const ZVector &measurements, const KeyVector &cameraKeys)
 Add a bunch of measurements, together with the camera keys. More...
 
Pose3 body_P_sensor () const
 
void computeJacobians (FBlocks &Fs, Matrix &E, Vector &b, const Cameras &cameras, const POINT &point) const
 
void computeJacobiansSVD (FBlocks &Fs, Matrix &Enull, Vector &b, const Cameras &cameras, const POINT &point) const
 
void correctForMissingMeasurements (const Cameras &cameras, Vector &ue, OptArgs &&... optArgs) const
 
virtual void correctForMissingMeasurements (const Cameras &cameras, Vector &ue, typename Cameras::FBlocks *Fs=nullptr, Matrix *E=nullptr) const
 
std::shared_ptr< RegularHessianFactor< Dim > > createHessianFactor (const Cameras &cameras, const Point3 &point, const double lambda=0.0, bool diagonalDamping=false) const
 Linearize to a Hessianfactor. More...
 
std::shared_ptr< JacobianFactorQ< Dim, ZDim > > createJacobianQFactor (const Cameras &cameras, const Point3 &point, double lambda=0.0, bool diagonalDamping=false) const
 Return Jacobians as JacobianFactorQ. More...
 
std::shared_ptr< JacobianFactorcreateJacobianSVDFactor (const Cameras &cameras, const Point3 &point, double lambda=0.0) const
 
std::shared_ptr< RegularImplicitSchurFactor< PinholePose< CALIBRATION > > > createRegularImplicitSchurFactor (const Cameras &cameras, const Point3 &point, double lambda=0.0, bool diagonalDamping=false) const
 Return Jacobians as RegularImplicitSchurFactor with raw access. More...
 
size_t dim () const override
 Return the dimension (number of rows!) of the factor. More...
 
const ZVectormeasured () const
 Return the 2D measurements (ZDim, in general). More...
 
 SmartFactorBase ()
 Default Constructor, for serialization. More...
 
 SmartFactorBase (const SharedNoiseModel &sharedNoiseModel, std::optional< Pose3 > body_P_sensor={}, size_t expectedNumberCameras=10)
 Construct with given noise model and optional arguments. More...
 
double totalReprojectionError (const Cameras &cameras, const POINT &point) const
 
Vector unwhitenedError (const Cameras &cameras, const POINT &point, OptArgs &&... optArgs) const
 
Vector unwhitenedError (const Cameras &cameras, const POINT &point, typename Cameras::FBlocks *Fs=nullptr, Matrix *E=nullptr) const
 
void updateAugmentedHessian (const Cameras &cameras, const Point3 &point, const double lambda, bool diagonalDamping, SymmetricBlockMatrix &augmentedHessian, const KeyVector allKeys) const
 
Vector whitenedError (const Cameras &cameras, const POINT &point) const
 
void whitenJacobians (FBlocks &F, Matrix &E, Vector &b) const
 Whiten the Jacobians computed by computeJacobians using noiseModel_. More...
 
 ~SmartFactorBase () override
 Virtual destructor, subclasses from NonlinearFactor. More...
 
- Public Member Functions inherited from gtsam::NonlinearFactor
 NonlinearFactor ()
 
template<typename CONTAINER >
 NonlinearFactor (const CONTAINER &keys)
 
double error (const HybridValues &c) const override
 
virtual size_t dim () const =0
 
virtual bool active (const Values &) const
 
virtual shared_ptr clone () const
 
virtual shared_ptr rekey (const std::map< Key, Key > &rekey_mapping) const
 
virtual shared_ptr rekey (const KeyVector &new_keys) const
 
virtual bool sendable () const
 
- Public Member Functions inherited from gtsam::Factor
virtual ~Factor ()=default
 Default destructor. More...
 
bool empty () const
 Whether the factor is empty (involves zero variables). More...
 
Key front () const
 First key. More...
 
Key back () const
 Last key. More...
 
const_iterator find (Key key) const
 find More...
 
const KeyVectorkeys () const
 Access the factor's involved variable keys. More...
 
const_iterator begin () const
 
const_iterator end () const
 
size_t size () const
 
virtual void printKeys (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const
 print only keys More...
 
bool equals (const This &other, double tol=1e-9) const
 check equality More...
 
KeyVectorkeys ()
 
iterator begin ()
 
iterator end ()
 

Protected Attributes

std::shared_ptr< CALIBRATION > K_
 calibration object (one for all cameras) More...
 
- Protected Attributes inherited from gtsam::SmartProjectionFactor< PinholePose< CALIBRATION > >
SmartProjectionParams params_
 
TriangulationResult result_
 result from triangulateSafe More...
 
std::vector< Pose3, Eigen::aligned_allocator< Pose3 > > cameraPosesTriangulation_
 current triangulation poses More...
 
- Protected Attributes inherited from gtsam::SmartFactorBase< PinholePose< CALIBRATION > >
std::optional< Pose3body_P_sensor_
 Pose of the camera in the body frame. More...
 
FBlocks Fs
 
ZVector measured_
 
SharedIsotropic noiseModel_
 
- Protected Attributes inherited from gtsam::Factor
KeyVector keys_
 The keys involved in this factor. More...
 

Private Types

typedef SmartProjectionFactor< CameraBase
 
typedef PinholePose< CALIBRATION > Camera
 
typedef SmartProjectionPoseFactor< CALIBRATION > This
 

Additional Inherited Members

- Static Public Member Functions inherited from gtsam::SmartFactorBase< PinholePose< CALIBRATION > >
static void FillDiagonalF (const FBlocks &Fs, Matrix &F)
 Create BIG block-diagonal matrix F from Fblocks. More...
 
static Matrix PointCov (const Matrix &E)
 Computes Point Covariance P from the "point Jacobian" E. More...
 
- Public Attributes inherited from gtsam::SmartFactorBase< PinholePose< CALIBRATION > >
GTSAM_MAKE_ALIGNED_OPERATOR_NEW typedef std::shared_ptr< Thisshared_ptr
 shorthand for a smart pointer to a factor. More...
 
- Static Public Attributes inherited from gtsam::SmartFactorBase< PinholePose< CALIBRATION > >
static const int Dim
 Camera dimension. More...
 
static const int ZDim
 Measurement dimension. More...
 
- Protected Types inherited from gtsam::NonlinearFactor
typedef Factor Base
 
typedef NonlinearFactor This
 
- Protected Member Functions inherited from gtsam::Factor
 Factor ()
 
template<typename CONTAINER >
 Factor (const CONTAINER &keys)
 
template<typename ITERATOR >
 Factor (ITERATOR first, ITERATOR last)
 
- Static Protected Member Functions inherited from gtsam::Factor
template<typename CONTAINER >
static Factor FromKeys (const CONTAINER &keys)
 
template<typename ITERATOR >
static Factor FromIterators (ITERATOR first, ITERATOR last)
 

Detailed Description

template<class CALIBRATION>
class gtsam::SmartProjectionPoseFactor< CALIBRATION >

If you are using the factor, please cite: L. Carlone, Z. Kira, C. Beall, V. Indelman, F. Dellaert, Eliminating conditionally independent sets in factor graphs: a unifying perspective based on smart factors, Int. Conf. on Robotics and Automation (ICRA), 2014. This factor assumes that camera calibration is fixed, and that the calibration is the same for all cameras involved in this factor. The factor only constrains poses (variable dimension is 6). This factor requires that values contains the involved poses (Pose3). If the calibration should be optimized, as well, use SmartProjectionFactor instead!

Definition at line 45 of file SmartProjectionPoseFactor.h.

Member Typedef Documentation

◆ Base

template<class CALIBRATION >
typedef SmartProjectionFactor<Camera> gtsam::SmartProjectionPoseFactor< CALIBRATION >::Base
private

Definition at line 49 of file SmartProjectionPoseFactor.h.

◆ Camera

template<class CALIBRATION >
typedef PinholePose<CALIBRATION> gtsam::SmartProjectionPoseFactor< CALIBRATION >::Camera
private

Definition at line 48 of file SmartProjectionPoseFactor.h.

◆ shared_ptr

template<class CALIBRATION >
typedef std::shared_ptr<This> gtsam::SmartProjectionPoseFactor< CALIBRATION >::shared_ptr

shorthand for a smart pointer to a factor

Definition at line 59 of file SmartProjectionPoseFactor.h.

◆ This

template<class CALIBRATION >
typedef SmartProjectionPoseFactor<CALIBRATION> gtsam::SmartProjectionPoseFactor< CALIBRATION >::This
private

Definition at line 50 of file SmartProjectionPoseFactor.h.

Constructor & Destructor Documentation

◆ SmartProjectionPoseFactor() [1/3]

template<class CALIBRATION >
gtsam::SmartProjectionPoseFactor< CALIBRATION >::SmartProjectionPoseFactor ( )
inline

Default constructor, only for serialization

Definition at line 64 of file SmartProjectionPoseFactor.h.

◆ SmartProjectionPoseFactor() [2/3]

template<class CALIBRATION >
gtsam::SmartProjectionPoseFactor< CALIBRATION >::SmartProjectionPoseFactor ( const SharedNoiseModel sharedNoiseModel,
const std::shared_ptr< CALIBRATION >  K,
const SmartProjectionParams params = SmartProjectionParams() 
)
inline

Constructor

Parameters
sharedNoiseModelisotropic noise model for the 2D feature measurements
K(fixed) calibration, assumed to be the same for all cameras
paramsparameters for the smart projection factors

Definition at line 72 of file SmartProjectionPoseFactor.h.

◆ SmartProjectionPoseFactor() [3/3]

template<class CALIBRATION >
gtsam::SmartProjectionPoseFactor< CALIBRATION >::SmartProjectionPoseFactor ( const SharedNoiseModel sharedNoiseModel,
const std::shared_ptr< CALIBRATION >  K,
const std::optional< Pose3 body_P_sensor,
const SmartProjectionParams params = SmartProjectionParams() 
)
inline

Constructor

Parameters
sharedNoiseModelisotropic noise model for the 2D feature measurements
K(fixed) calibration, assumed to be the same for all cameras
body_P_sensorpose of the camera in the body frame (optional)
paramsparameters for the smart projection factors

Definition at line 86 of file SmartProjectionPoseFactor.h.

◆ ~SmartProjectionPoseFactor()

template<class CALIBRATION >
gtsam::SmartProjectionPoseFactor< CALIBRATION >::~SmartProjectionPoseFactor ( )
inlineoverride

Virtual destructor

Definition at line 96 of file SmartProjectionPoseFactor.h.

Member Function Documentation

◆ calibration()

template<class CALIBRATION >
const std::shared_ptr<CALIBRATION> gtsam::SmartProjectionPoseFactor< CALIBRATION >::calibration ( ) const
inline

return calibration shared pointers

Definition at line 128 of file SmartProjectionPoseFactor.h.

◆ cameras()

template<class CALIBRATION >
Base::Cameras gtsam::SmartProjectionPoseFactor< CALIBRATION >::cameras ( const Values values) const
inlineoverridevirtual

Collect all cameras involved in this factor

Parameters
valuesValues structure which must contain camera poses corresponding to keys involved in this factor
Returns
vector of Values

Reimplemented from gtsam::SmartFactorBase< PinholePose< CALIBRATION > >.

Definition at line 138 of file SmartProjectionPoseFactor.h.

◆ equals()

template<class CALIBRATION >
bool gtsam::SmartProjectionPoseFactor< CALIBRATION >::equals ( const NonlinearFactor p,
double  tol = 1e-9 
) const
inlineoverridevirtual

equals

Reimplemented from gtsam::NonlinearFactor.

Definition at line 111 of file SmartProjectionPoseFactor.h.

◆ error()

template<class CALIBRATION >
double gtsam::SmartProjectionPoseFactor< CALIBRATION >::error ( const Values values) const
inlineoverridevirtual

error calculates the error of the factor.

Reimplemented from gtsam::NonlinearFactor.

Definition at line 119 of file SmartProjectionPoseFactor.h.

◆ print()

template<class CALIBRATION >
void gtsam::SmartProjectionPoseFactor< CALIBRATION >::print ( const std::string &  s = "",
const KeyFormatter keyFormatter = DefaultKeyFormatter 
) const
inlineoverridevirtual

print

Parameters
soptional string naming the factor
keyFormatteroptional formatter useful for printing Symbols

Reimplemented from gtsam::NonlinearFactor.

Definition at line 104 of file SmartProjectionPoseFactor.h.

Member Data Documentation

◆ K_

template<class CALIBRATION >
std::shared_ptr<CALIBRATION> gtsam::SmartProjectionPoseFactor< CALIBRATION >::K_
protected

calibration object (one for all cameras)

Definition at line 54 of file SmartProjectionPoseFactor.h.


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


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:16:28