GTSAM  4.0.2
C++ library for smoothing and mapping (SAM)
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
gtsam::SmartStereoProjectionFactorPP Class Reference

#include <SmartStereoProjectionFactorPP.h>

Inheritance diagram for gtsam::SmartStereoProjectionFactorPP:
Inheritance graph
[legend]
Collaboration diagram for gtsam::SmartStereoProjectionFactorPP:
Collaboration graph
[legend]

Public Types

typedef SmartStereoProjectionFactorPP This
 shorthand for this class
 
typedef std::shared_ptr< Thisshared_ptr
 shorthand for a smart pointer to a factor
 
typedef Eigen::Matrix< double, ZDim, DimBlockMatrixZD
 
typedef std::vector< MatrixZD, Eigen::aligned_allocator< MatrixZD > > FBlocks
 
typedef CameraSet< StereoCameraCameras
 Vector of cameras.
 
typedef PinholeCamera< Cal3_S2MonoCamera
 Vector of monocular cameras (stereo treated as 2 monocular)
 
typedef CameraSet< MonoCameraMonoCameras
 
typedef MonoCamera::MeasurementVector MonoMeasurements
 
typedef KeyVector::iterator iterator
 Iterator over keys.
 
typedef KeyVector::const_iterator const_iterator
 Const iterator over keys.
 

Public Member Functions

 SmartStereoProjectionFactorPP (const SharedNoiseModel &sharedNoiseModel, const SmartStereoProjectionParams &params=SmartStereoProjectionParams())
 
void add (const StereoPoint2 &measured, const Key &world_P_body_key, const Key &body_P_cam_key, const std::shared_ptr< Cal3_S2Stereo > &K)
 
void add (const std::vector< StereoPoint2 > &measurements, const KeyVector &w_P_body_keys, const KeyVector &body_P_cam_keys, const std::vector< std::shared_ptr< Cal3_S2Stereo >> &Ks)
 
void add (const std::vector< StereoPoint2 > &measurements, const KeyVector &w_P_body_keys, const KeyVector &body_P_cam_keys, const std::shared_ptr< Cal3_S2Stereo > &K)
 
void print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
 
bool equals (const NonlinearFactor &p, double tol=1e-9) const override
 equals
 
const KeyVectorgetExtrinsicPoseKeys () const
 equals
 
double error (const Values &values) const override
 
std::vector< std::shared_ptr< Cal3_S2Stereo > > calibration () const
 
Base::Cameras cameras (const Values &values) const override
 
void computeJacobiansAndCorrectForMissingMeasurements (FBlocks &Fs, Matrix &E, Vector &b, const Values &values) const
 
std::shared_ptr< RegularHessianFactor< DimPose > > createHessianFactor (const Values &values, const double lambda=0.0, bool diagonalDamping=false) const
 linearize and return a Hessianfactor that is an approximation of error(p)
 
std::shared_ptr< GaussianFactorlinearizeDamped (const Values &values, const double lambda=0.0) const
 
std::shared_ptr< GaussianFactorlinearize (const Values &values) const override
 linearize
 
bool decideIfTriangulate (const Cameras &cameras) const
 Check if the new linearization point_ is the same as the one used for previous triangulation.
 
TriangulationResult triangulateSafe (const Cameras &cameras) const
 triangulateSafe
 
bool triangulateForLinearize (const Cameras &cameras) const
 triangulate
 
std::shared_ptr< RegularHessianFactor< Base::Dim > > createHessianFactor (const Cameras &cameras, const double lambda=0.0, bool diagonalDamping=false) const
 linearize returns a Hessianfactor that is an approximation of error(p)
 
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.
 
std::shared_ptr< JacobianFactorcreateJacobianSVDFactor (const Cameras &cameras, double lambda) const
 different (faster) way to compute Jacobian factor
 
std::shared_ptr< JacobianFactorcreateJacobianSVDFactor (const Cameras &cameras, const Point3 &point, double lambda=0.0) const
 
std::shared_ptr< GaussianFactorlinearizeDamped (const Cameras &cameras, const double lambda=0.0) const
 
bool triangulateAndComputeE (Matrix &E, const Cameras &cameras) const
 
bool triangulateAndComputeE (Matrix &E, const Values &values) const
 
void computeJacobiansWithTriangulatedPoint (FBlocks &Fs, Matrix &E, Vector &b, const Cameras &cameras) const
 
bool triangulateAndComputeJacobians (FBlocks &Fs, Matrix &E, Vector &b, const Values &values) const
 Version that takes values, and creates the point.
 
bool triangulateAndComputeJacobiansSVD (FBlocks &Fs, Matrix &Enull, Vector &b, const Values &values) const
 takes values
 
Vector reprojectionErrorAfterTriangulation (const Values &values) const
 Calculate vector of re-projection errors, before applying noise model.
 
double totalReprojectionError (const Cameras &cameras, std::optional< Point3 > externalPoint={}) const
 
double totalReprojectionError (const Cameras &cameras, const POINT &point) const
 
void correctForMissingMeasurements (const Cameras &cameras, Vector &ue, typename Cameras::FBlocks *Fs=nullptr, Matrix *E=nullptr) const override
 
void correctForMissingMeasurements (const Cameras &cameras, Vector &ue, OptArgs &&... optArgs) const
 
TriangulationResult point () const
 
TriangulationResult point (const Values &values) const
 
bool isValid () const
 Is result valid?
 
bool isDegenerate () const
 
bool isPointBehindCamera () const
 
bool isOutlier () const
 
bool isFarPoint () const
 
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.
 
void add (const SFM_TRACK &trackToAdd)
 
size_t dim () const override
 Return the dimension (number of rows!) of the factor.
 
const ZVector & measured () const
 Return the 2D measurements (ZDim, in general).
 
Vector unwhitenedError (const Cameras &cameras, const POINT &point, typename Cameras::FBlocks *Fs=nullptr, Matrix *E=nullptr) const
 
Vector unwhitenedError (const Cameras &cameras, const POINT &point, OptArgs &&... optArgs) const
 
Vector whitenedError (const Cameras &cameras, const POINT &point) 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 updateAugmentedHessian (const Cameras &cameras, const Point3 &point, const double lambda, bool diagonalDamping, SymmetricBlockMatrix &augmentedHessian, const KeyVector allKeys) const
 
void whitenJacobians (FBlocks &F, Matrix &E, Vector &b) const
 Whiten the Jacobians computed by computeJacobians using noiseModel_.
 
std::shared_ptr< RegularImplicitSchurFactor< StereoCamera > > createRegularImplicitSchurFactor (const Cameras &cameras, const Point3 &point, double lambda=0.0, bool diagonalDamping=false) const
 Return Jacobians as RegularImplicitSchurFactor with raw access.
 
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.
 
Pose3 body_P_sensor () const
 
Testable
bool equals (const This &other, double tol=1e-9) const
 check equality
 
virtual void printKeys (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const
 print only keys
 
Standard Interface
double error (const HybridValues &c) const override
 
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
 
Standard Interface
bool empty () const
 Whether the factor is empty (involves zero variables).
 
Key front () const
 First key.
 
Key back () const
 Last key.
 
const_iterator find (Key key) const
 find
 
const KeyVectorkeys () const
 Access the factor's involved variable keys.
 
const_iterator begin () const
 
const_iterator end () const
 
size_t size () const
 
Advanced Interface
KeyVectorkeys ()
 
iterator begin ()
 
iterator end ()
 

Static Public Member Functions

static Matrix PointCov (const Matrix &E)
 Computes Point Covariance P from the "point Jacobian" E.
 
static void FillDiagonalF (const FBlocks &Fs, Matrix &F)
 Create BIG block-diagonal matrix F from Fblocks.
 

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef SmartStereoProjectionFactor Base
 shorthand for base class type
 

Static Public Attributes

static const int DimBlock = 12
 Camera dimension: 6 for body pose, 6 for extrinsic pose.
 
static const int DimPose = 6
 Pose3 dimension.
 
static const int ZDim = 3
 Measurement dimension (for a StereoPoint2 measurement)
 
static const int Dim
 Camera dimension.
 

Static Protected Member Functions

Standard Constructors
template<typename CONTAINER >
static Factor FromKeys (const CONTAINER &keys)
 
template<typename ITERATOR >
static Factor FromIterators (ITERATOR first, ITERATOR last)
 

Protected Attributes

std::vector< std::shared_ptr< Cal3_S2Stereo > > K_all_
 shared pointer to calibration object (one for each camera)
 
KeyVector world_P_body_keys_
 The keys corresponding to the pose of the body (with respect to an external world frame) for each view.
 
KeyVector body_P_cam_keys_
 The keys corresponding to the extrinsic pose calibration for each view (pose that transform from camera to body)
 
SharedIsotropic noiseModel_
 
ZVector measured_
 
std::optional< Pose3body_P_sensor_
 Pose of the camera in the body frame.
 
FBlocks Fs
 
KeyVector keys_
 The keys involved in this factor.
 
Parameters
const SmartStereoProjectionParams params_
 
Caching triangulation
TriangulationResult result_
 result from triangulateSafe
 
std::vector< Pose3cameraPosesTriangulation_
 current triangulation poses
 

Detailed Description

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 optimizes the pose of the body as well as the extrinsic camera calibration (pose of camera wrt body). Each camera may have its own extrinsic calibration or the same calibration can be shared by multiple cameras. This factor requires that values contain the involved poses and extrinsics (both are Pose3 variables).

Constructor & Destructor Documentation

◆ SmartStereoProjectionFactorPP()

gtsam::SmartStereoProjectionFactorPP::SmartStereoProjectionFactorPP ( const SharedNoiseModel sharedNoiseModel,
const SmartStereoProjectionParams params = SmartStereoProjectionParams() 
)

Constructor

Parameters
Isotropicmeasurement noise
paramsinternal parameters of the smart factors

Member Function Documentation

◆ active()

virtual bool gtsam::NonlinearFactor::active ( const Values ) const
inlinevirtualinherited

Checks whether a factor should be used based on a set of values. This is primarily used to implement inequality constraints that require a variable active set. For all others, the default implementation returning true solves this problem.

In an inequality/bounding constraint, this active() returns true when the constraint is NOT fulfilled.

Returns
true if the constraint is active

Reimplemented in gtsam::BoundingConstraint2< VALUE1, VALUE2 >, gtsam::AntiFactor, and gtsam::BoundingConstraint1< VALUE >.

◆ add() [1/5]

void gtsam::SmartStereoProjectionFactorPP::add ( const StereoPoint2 measured,
const Key world_P_body_key,
const Key body_P_cam_key,
const std::shared_ptr< Cal3_S2Stereo > &  K 
)

add a new measurement, with a pose key, and an extrinsic pose key

Parameters
measuredis the 3-dimensional location of the projection of a single landmark in the a single (stereo) view (the measurement)
world_P_body_keyis the key corresponding to the body poses observing the same landmark
body_P_cam_keyis the key corresponding to the extrinsic camera-to-body pose calibration
Kis the (fixed) camera intrinsic calibration

◆ add() [2/5]

void gtsam::SmartStereoProjectionFactorPP::add ( const std::vector< StereoPoint2 > &  measurements,
const KeyVector w_P_body_keys,
const KeyVector body_P_cam_keys,
const std::vector< std::shared_ptr< Cal3_S2Stereo >> &  Ks 
)

Variant of the previous one in which we include a set of measurements

Parameters
measurementsvector of the 3m dimensional location of the projection of a single landmark in the m (stereo) view (the measurements)
w_P_body_keysare the ordered keys corresponding to the body poses observing the same landmark
body_P_cam_keysare the ordered keys corresponding to the extrinsic camera-to-body poses calibration (note: elements of this vector do not need to be unique: 2 camera views can share the same calibration)
Ksvector of intrinsic calibration objects

◆ add() [3/5]

void gtsam::SmartStereoProjectionFactorPP::add ( const std::vector< StereoPoint2 > &  measurements,
const KeyVector w_P_body_keys,
const KeyVector body_P_cam_keys,
const std::shared_ptr< Cal3_S2Stereo > &  K 
)

Variant of the previous one in which we include a set of measurements with the same noise and calibration

Parameters
measurementsvector of the 3m dimensional location of the projection of a single landmark in the m (stereo) view (the measurements)
w_P_body_keysare the ordered keys corresponding to the body poses observing the same landmark
body_P_cam_keysare the ordered keys corresponding to the extrinsic camera-to-body poses calibration (note: elements of this vector do not need to be unique: 2 camera views can share the same calibration)
Kthe (known) camera calibration (same for all measurements)

◆ add() [4/5]

void gtsam::SmartFactorBase< StereoCamera >::add ( const Z &  measured,
const Key key 
)
inlineinherited

Add a new measurement and pose/camera key.

Parameters
measuredis the 2m dimensional projection of a single landmark
keyis the index corresponding to the camera observing the landmark

◆ add() [5/5]

void gtsam::SmartFactorBase< StereoCamera >::add ( const SFM_TRACK &  trackToAdd)
inlineinherited

Add an entire SfM_track (collection of cameras observing a single point). The noise is assumed to be the same for all measurements.

◆ begin() [1/2]

const_iterator gtsam::Factor::begin ( ) const
inlineinherited

Iterator at beginning of involved variable keys

◆ begin() [2/2]

iterator gtsam::Factor::begin ( )
inlineinherited

Iterator at beginning of involved variable keys

◆ calibration()

std::vector<std::shared_ptr<Cal3_S2Stereo> > gtsam::SmartStereoProjectionFactorPP::calibration ( ) const
inline

return the calibration object

◆ cameras()

Base::Cameras gtsam::SmartStereoProjectionFactorPP::cameras ( const Values values) const
overridevirtual

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< StereoCamera >.

◆ clone()

virtual shared_ptr gtsam::NonlinearFactor::clone ( ) const
inlinevirtualinherited

Creates a shared_ptr clone of the factor - needs to be specialized to allow for subclasses

By default, throws exception if subclass does not implement the function.

Reimplemented in gtsam::EssentialMatrixFactor4< CALIBRATION >, gtsam::NonlinearEquality2< T >, gtsam::CombinedImuFactor, gtsam::ImuFactor2, gtsam::EssentialMatrixFactor3, gtsam::NonlinearEquality1< VALUE >, gtsam::GeneralSFMFactor2< CALIBRATION >, gtsam::ImuFactor, gtsam::LinearizedHessianFactor, gtsam::PendulumFactorPk1, gtsam::FunctorizedFactor2< R, T1, T2 >, gtsam::MagFactor3, gtsam::Pose3AttitudeFactor, gtsam::SmartRangeFactor, gtsam::NonlinearEquality< VALUE >, gtsam::AHRSFactor, gtsam::EssentialMatrixFactor2, gtsam::ExpressionFactor< T >, gtsam::ExpressionFactor< BearingRange< A1, A2 > >, gtsam::ExpressionFactor< double >, gtsam::MagFactor2, gtsam::PendulumFactorPk, gtsam::GPSFactor2, gtsam::ProjectionFactorRollingShutter, gtsam::RangeFactorWithTransform< A1, A2, T >, gtsam::LinearContainerFactor, gtsam::LinearizedJacobianFactor, gtsam::Rot3AttitudeFactor, gtsam::MagFactor1, gtsam::GenericProjectionFactor< POSE, LANDMARK, CALIBRATION >, gtsam::DiscreteEulerPoincareHelicopter, gtsam::MultiProjectionFactor< POSE, LANDMARK, CALIBRATION >, gtsam::GeneralSFMFactor< CAMERA, LANDMARK >, gtsam::ProjectionFactorPPP< POSE, LANDMARK, CALIBRATION >, gtsam::TransformBtwRobotsUnaryFactorEM< VALUE >, gtsam::GenericStereoFactor< POSE, LANDMARK >, gtsam::TriangulationFactor< CAMERA >, gtsam::RotateDirectionsFactor, gtsam::PendulumFactor2, gtsam::ReferenceFrameFactor< POINT, TRANSFORM >, gtsam::FunctorizedFactor< R, T >, gtsam::PartialPriorFactor< VALUE >, gtsam::FunctorizedFactor< Vector, ParameterMatrix< M > >, gtsam::FunctorizedFactor< double, BASIS::Parameters >, gtsam::FunctorizedFactor< double, Vector >, gtsam::FunctorizedFactor< T, ParameterMatrix< traits< T >::dimension > >, gtsam::FunctorizedFactor< double, ParameterMatrix< P > >, gtsam::PartialPriorFactor< PoseRTV >, gtsam::MagPoseFactor< POSE >, gtsam::ProjectionFactorPPPC< POSE, LANDMARK, CALIBRATION >, gtsam::TransformBtwRobotsUnaryFactor< VALUE >, gtsam::BetweenFactor< VALUE >, gtsam::EssentialMatrixFactor, gtsam::VelocityConstraint, gtsam::PriorFactor< VALUE >, gtsam::GPSFactor, gtsam::PoseToPointFactor< POSE, POINT >, gtsam::BarometricFactor, gtsam::EssentialMatrixConstraint, gtsam::DummyFactor, gtsam::PoseBetweenFactor< POSE >, gtsam::BearingRangeFactor< A1, A2, B, R >, gtsam::PosePriorFactor< POSE >, gtsam::MagFactor, gtsam::PoseTranslationPrior< POSE >, gtsam::PoseRotationPrior< POSE >, gtsam::FullIMUFactor< POSE >, gtsam::AntiFactor, gtsam::RangeFactor< A1, A2, T >, gtsam::IMUFactor< POSE >, gtsam::RelativeElevationFactor, gtsam::PendulumFactor1, gtsam::Reconstruction, gtsam::RotateFactor, and gtsam::VelocityConstraint3.

◆ computeJacobians()

void gtsam::SmartFactorBase< StereoCamera >::computeJacobians ( FBlocks &  Fs,
Matrix &  E,
Vector &  b,
const Cameras cameras,
const POINT &  point 
) const
inlineinherited

Compute F, E, and b (called below in both vanilla and SVD versions), where F is a vector of derivatives wrpt the cameras, and E the stacked derivatives with respect to the point. The value of cameras/point are passed as parameters.

◆ computeJacobiansAndCorrectForMissingMeasurements()

void gtsam::SmartStereoProjectionFactorPP::computeJacobiansAndCorrectForMissingMeasurements ( FBlocks &  Fs,
Matrix &  E,
Vector &  b,
const Values values 
) const
inline

Compute jacobian F, E and error vector at a given linearization point

Parameters
valuesValues structure which must contain camera poses corresponding to keys involved in this factor
Returns
Return arguments are the camera jacobians Fs (including the jacobian with respect to both the body pose and extrinsic pose), the point Jacobian E, and the error vector b. Note that the jacobians are computed for a given point.

◆ computeJacobiansSVD()

void gtsam::SmartFactorBase< StereoCamera >::computeJacobiansSVD ( FBlocks &  Fs,
Matrix &  Enull,
Vector &  b,
const Cameras cameras,
const POINT &  point 
) const
inlineinherited

SVD version that produces smaller Jacobian matrices by doing an SVD decomposition on E, and returning the left nulkl-space of E. See JacobianFactorSVD for more documentation.

◆ computeJacobiansWithTriangulatedPoint()

void gtsam::SmartStereoProjectionFactor::computeJacobiansWithTriangulatedPoint ( FBlocks &  Fs,
Matrix &  E,
Vector &  b,
const Cameras cameras 
) const
inlineinherited

Compute F, E only (called below in both vanilla and SVD versions) Assumes the point has been computed Note E can be 2m*3 or 2m*2, in case point is degenerate

◆ correctForMissingMeasurements() [1/2]

void gtsam::SmartFactorBase< StereoCamera >::correctForMissingMeasurements ( const Cameras cameras,
Vector &  ue,
OptArgs &&...  optArgs 
) const
inlineinherited

An overload of correctForMissingMeasurements. This allows end users to provide optional arguments that are l-value references to the matrices and vectors that will be used to store the results instead of pointers.

◆ correctForMissingMeasurements() [2/2]

void gtsam::SmartStereoProjectionFactor::correctForMissingMeasurements ( const Cameras cameras,
Vector &  ue,
typename Cameras::FBlocks *  Fs = nullptr,
Matrix *  E = nullptr 
) const
inlineoverridevirtualinherited

This corrects the Jacobians and error vector for the case in which the right 2D measurement in the monocular camera is missing (nan).

Reimplemented from gtsam::SmartFactorBase< StereoCamera >.

◆ createJacobianSVDFactor()

std::shared_ptr<JacobianFactor> gtsam::SmartFactorBase< StereoCamera >::createJacobianSVDFactor ( const Cameras cameras,
const Point3 point,
double  lambda = 0.0 
) const
inlineinherited

Return Jacobians as JacobianFactorSVD. TODO(dellaert): lambda is currently ignored

◆ end() [1/2]

const_iterator gtsam::Factor::end ( ) const
inlineinherited

Iterator at end of involved variable keys

◆ end() [2/2]

iterator gtsam::Factor::end ( )
inlineinherited

Iterator at end of involved variable keys

◆ error() [1/2]

double gtsam::NonlinearFactor::error ( const HybridValues c) const
overridevirtualinherited

All factor types need to implement an error function. In factor graphs, this is the negative log-likelihood.

Reimplemented from gtsam::Factor.

◆ error() [2/2]

double gtsam::SmartStereoProjectionFactorPP::error ( const Values values) const
overridevirtual

error calculates the error of the factor.

Reimplemented from gtsam::SmartStereoProjectionFactor.

◆ FromIterators()

template<typename ITERATOR >
static Factor gtsam::Factor::FromIterators ( ITERATOR  first,
ITERATOR  last 
)
inlinestaticprotectedinherited

Construct factor from iterator keys. This is called internally from derived factor static factor methods, as a workaround for not being able to call the protected constructors above.

◆ FromKeys()

template<typename CONTAINER >
static Factor gtsam::Factor::FromKeys ( const CONTAINER &  keys)
inlinestaticprotectedinherited

Construct factor from container of keys. This is called internally from derived factor static factor methods, as a workaround for not being able to call the protected constructors above.

◆ isDegenerate()

bool gtsam::SmartStereoProjectionFactor::isDegenerate ( ) const
inlineinherited

return the degenerate state

◆ isFarPoint()

bool gtsam::SmartStereoProjectionFactor::isFarPoint ( ) const
inlineinherited

return the farPoint state

◆ isOutlier()

bool gtsam::SmartStereoProjectionFactor::isOutlier ( ) const
inlineinherited

return the outlier state

◆ isPointBehindCamera()

bool gtsam::SmartStereoProjectionFactor::isPointBehindCamera ( ) const
inlineinherited

return the cheirality status flag

◆ keys()

KeyVector& gtsam::Factor::keys ( )
inlineinherited
Returns
keys involved in this factor

◆ linearizeDamped() [1/2]

std::shared_ptr<GaussianFactor> gtsam::SmartStereoProjectionFactorPP::linearizeDamped ( const Values values,
const double  lambda = 0.0 
) const
inline

Linearize to Gaussian Factor (possibly adding a damping factor Lambda for LM)

Parameters
valuesValues structure which must contain camera poses and extrinsic pose for this factor
Returns
a Gaussian factor

◆ linearizeDamped() [2/2]

std::shared_ptr<GaussianFactor> gtsam::SmartStereoProjectionFactor::linearizeDamped ( const Cameras cameras,
const double  lambda = 0.0 
) const
inlineinherited

Linearize to Gaussian Factor

Parameters
valuesValues structure which must contain camera poses for this factor
Returns
a Gaussian factor

◆ point() [1/2]

TriangulationResult gtsam::SmartStereoProjectionFactor::point ( ) const
inlineinherited

return the landmark

◆ point() [2/2]

TriangulationResult gtsam::SmartStereoProjectionFactor::point ( const Values values) const
inlineinherited

COMPUTE the landmark

◆ print()

void gtsam::SmartStereoProjectionFactorPP::print ( const std::string &  s = "",
const KeyFormatter keyFormatter = DefaultKeyFormatter 
) const
overridevirtual

print

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

Reimplemented from gtsam::SmartStereoProjectionFactor.

◆ rekey() [1/2]

virtual shared_ptr gtsam::NonlinearFactor::rekey ( const std::map< Key, Key > &  rekey_mapping) const
virtualinherited

Creates a shared_ptr clone of the factor with different keys using a map from old->new keys

Reimplemented in gtsam::LinearContainerFactor.

◆ rekey() [2/2]

virtual shared_ptr gtsam::NonlinearFactor::rekey ( const KeyVector new_keys) const
virtualinherited

Clones a factor and fully replaces its keys

Parameters
new_keysis the full replacement set of keys

Reimplemented in gtsam::LinearContainerFactor.

◆ sendable()

virtual bool gtsam::NonlinearFactor::sendable ( ) const
inlinevirtualinherited

Should the factor be evaluated in the same thread as the caller This is to enable factors that has shared states (like the Python GIL lock)

Reimplemented in gtsam::CustomFactor.

◆ size()

size_t gtsam::Factor::size ( ) const
inlineinherited
Returns
the number of variables involved in this factor

◆ totalReprojectionError() [1/2]

double gtsam::SmartFactorBase< StereoCamera >::totalReprojectionError ( const Cameras cameras,
const POINT &  point 
) const
inlineinherited

Calculate the error of the factor. This is the log-likelihood, e.g. \( 0.5(h(x)-z)^2/\sigma^2 \) in case of Gaussian. In this class, we take the raw prediction error \( h(x)-z \), ask the noise model to transform it to \( (h(x)-z)^2/\sigma^2 \), and then multiply by 0.5. Will be used in "error(Values)" function required by NonlinearFactor base class

◆ totalReprojectionError() [2/2]

double gtsam::SmartStereoProjectionFactor::totalReprojectionError ( const Cameras cameras,
std::optional< Point3 externalPoint = {} 
) const
inlineinherited

Calculate the error of the factor. This is the log-likelihood, e.g. \( 0.5(h(x)-z)^2/\sigma^2 \) in case of Gaussian. In this class, we take the raw prediction error \( h(x)-z \), ask the noise model to transform it to \( (h(x)-z)^2/\sigma^2 \), and then multiply by 0.5.

◆ triangulateAndComputeE() [1/2]

bool gtsam::SmartStereoProjectionFactor::triangulateAndComputeE ( Matrix &  E,
const Cameras cameras 
) const
inlineinherited

Triangulate and compute derivative of error with respect to point

Returns
whether triangulation worked

◆ triangulateAndComputeE() [2/2]

bool gtsam::SmartStereoProjectionFactor::triangulateAndComputeE ( Matrix &  E,
const Values values 
) const
inlineinherited

Triangulate and compute derivative of error with respect to point

Returns
whether triangulation worked

◆ unwhitenedError() [1/2]

Vector gtsam::SmartFactorBase< StereoCamera >::unwhitenedError ( const Cameras cameras,
const POINT &  point,
typename Cameras::FBlocks *  Fs = nullptr,
Matrix *  E = nullptr 
) const
inlineinherited

Compute reprojection errors [h(x)-z] = [cameras.project(p)-z] and derivatives. This is the error before the noise model is applied. The templated version described above must finally get resolved to this function.

◆ unwhitenedError() [2/2]

Vector gtsam::SmartFactorBase< StereoCamera >::unwhitenedError ( const Cameras cameras,
const POINT &  point,
OptArgs &&...  optArgs 
) const
inlineinherited

An overload of unwhitenedError. This allows end users to provide optional arguments that are l-value references to the matrices and vectors that will be used to store the results instead of pointers.

◆ updateAugmentedHessian()

void gtsam::SmartFactorBase< StereoCamera >::updateAugmentedHessian ( const Cameras cameras,
const Point3 point,
const double  lambda,
bool  diagonalDamping,
SymmetricBlockMatrix augmentedHessian,
const KeyVector  allKeys 
) const
inlineinherited

Add the contribution of the smart factor to a pre-allocated Hessian, using sparse linear algebra. More efficient than the creation of the Hessian without preallocation of the SymmetricBlockMatrix

◆ whitenedError()

Vector gtsam::SmartFactorBase< StereoCamera >::whitenedError ( const Cameras cameras,
const POINT &  point 
) const
inlineinherited

Calculate vector of re-projection errors [h(x)-z] = [cameras.project(p) - z], with the noise model applied.

Member Data Documentation

◆ measured_

ZVector gtsam::SmartFactorBase< StereoCamera >::measured_
protectedinherited

Measurements for each of the m views. We keep a copy of the measurements for I/O and computing the error. The order is kept the same as the keys that we use to create the factor.

◆ noiseModel_

SharedIsotropic gtsam::SmartFactorBase< StereoCamera >::noiseModel_
protectedinherited

As of Feb 22, 2015, the noise model is the same for all measurements and is isotropic. This allows for moving most calculations of Schur complement etc. to be easily moved to CameraSet, and also agrees pragmatically with what is normally done.


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