dcsam
Factored inference for discrete-continuous smoothing and mapping
dcsam::SemanticBearingRangeFactor< PoseType, PointType, BearingType, RangeType > Class Template Reference

Factor that represents bearing and range measurements that incorporate a semantic class measurement. More...

#include <SemanticBearingRangeFactor.h>

Inheritance diagram for dcsam::SemanticBearingRangeFactor< PoseType, PointType, BearingType, RangeType >:
Collaboration diagram for dcsam::SemanticBearingRangeFactor< PoseType, PointType, BearingType, RangeType >:

Public Types

using Base = DCFactor
 
- Public Types inherited from dcsam::DCFactor
using Base = gtsam::Factor
 

Public Member Functions

 SemanticBearingRangeFactor ()=default
 
 SemanticBearingRangeFactor (const gtsam::Key &poseKey, const gtsam::Key &pointKey, const gtsam::DiscreteKey &discreteKey, const std::vector< double > measuredProbs, const BearingType &measuredBearing, const RangeType &measuredRange, const gtsam::SharedNoiseModel &model)
 
virtual ~SemanticBearingRangeFactor ()=default
 
SemanticBearingRangeFactoroperator= (const SemanticBearingRangeFactor &rhs)
 
double error (const gtsam::Values &continuousVals, const DiscreteValues &discreteVals) const override
 
size_t dim () const override
 
boost::shared_ptr< gtsam::GaussianFactor > linearize (const gtsam::Values &continuousVals, const DiscreteValues &discreteVals) const override
 
bool equals (const DCFactor &other, double tol=1e-9) const override
 
double logNormalizingConstant (const gtsam::Values &values) const override
 
- Public Member Functions inherited from dcsam::DCFactor
 DCFactor ()=default
 
 DCFactor (const gtsam::KeyVector &continuousKeys, const gtsam::DiscreteKeys &discreteKeys)
 
 DCFactor (const gtsam::DiscreteKeys &discreteKeys)
 
DCFactoroperator= (const DCFactor &rhs)
 
virtual ~DCFactor ()=default
 
gtsam::DiscreteKeys discreteKeys () const
 
virtual gtsam::DecisionTreeFactor toDecisionTreeFactor (const gtsam::Values &continuousVals, const DiscreteValues &discreteVals) const
 
template<typename NonlinearFactorType >
double nonlinearFactorLogNormalizingConstant (const NonlinearFactorType &factor, const gtsam::Values &values) const
 
std::vector< double > evalProbs (const gtsam::DiscreteKey &dk, const gtsam::Values &continuousVals) const
 
gtsam::DecisionTreeFactor conditionalTimes (const gtsam::DecisionTreeFactor &f, const gtsam::Values &continuousVals, const DiscreteValues &discreteVals) const
 

Additional Inherited Members

- Protected Attributes inherited from dcsam::DCFactor
gtsam::DiscreteKeys discreteKeys_
 

Detailed Description

template<typename PoseType, typename PointType, typename BearingType = typename gtsam::Bearing<PoseType, PointType>::result_type, typename RangeType = typename gtsam::Range<PoseType, PointType>::result_type>
class dcsam::SemanticBearingRangeFactor< PoseType, PointType, BearingType, RangeType >

Factor that represents bearing and range measurements that incorporate a semantic class measurement.

Member Typedef Documentation

◆ Base

template<typename PoseType , typename PointType , typename BearingType = typename gtsam::Bearing<PoseType, PointType>::result_type, typename RangeType = typename gtsam::Range<PoseType, PointType>::result_type>
using dcsam::SemanticBearingRangeFactor< PoseType, PointType, BearingType, RangeType >::Base = DCFactor

Constructor & Destructor Documentation

◆ SemanticBearingRangeFactor() [1/2]

template<typename PoseType , typename PointType , typename BearingType = typename gtsam::Bearing<PoseType, PointType>::result_type, typename RangeType = typename gtsam::Range<PoseType, PointType>::result_type>
dcsam::SemanticBearingRangeFactor< PoseType, PointType, BearingType, RangeType >::SemanticBearingRangeFactor ( )
default

◆ SemanticBearingRangeFactor() [2/2]

template<typename PoseType , typename PointType , typename BearingType = typename gtsam::Bearing<PoseType, PointType>::result_type, typename RangeType = typename gtsam::Range<PoseType, PointType>::result_type>
dcsam::SemanticBearingRangeFactor< PoseType, PointType, BearingType, RangeType >::SemanticBearingRangeFactor ( const gtsam::Key &  poseKey,
const gtsam::Key &  pointKey,
const gtsam::DiscreteKey &  discreteKey,
const std::vector< double >  measuredProbs,
const BearingType &  measuredBearing,
const RangeType &  measuredRange,
const gtsam::SharedNoiseModel &  model 
)
inline

◆ ~SemanticBearingRangeFactor()

template<typename PoseType , typename PointType , typename BearingType = typename gtsam::Bearing<PoseType, PointType>::result_type, typename RangeType = typename gtsam::Range<PoseType, PointType>::result_type>
virtual dcsam::SemanticBearingRangeFactor< PoseType, PointType, BearingType, RangeType >::~SemanticBearingRangeFactor ( )
virtualdefault

Member Function Documentation

◆ dim()

template<typename PoseType , typename PointType , typename BearingType = typename gtsam::Bearing<PoseType, PointType>::result_type, typename RangeType = typename gtsam::Range<PoseType, PointType>::result_type>
size_t dcsam::SemanticBearingRangeFactor< PoseType, PointType, BearingType, RangeType >::dim ( ) const
inlineoverridevirtual

Returns the number of rows in the Jacobian with respect to the continuous variables for this factor. Internally this is used in the conversion to a gtsam::NonlinearFactor

TODO(kevin): not sure if needed???

This will be specific to the model being implemented, so it is a pure virtual function and must be overridden

Returns
the dimension (number of rows) in the Jacobian of the error function with respect to continuous variables for

Implements dcsam::DCFactor.

◆ equals()

template<typename PoseType , typename PointType , typename BearingType = typename gtsam::Bearing<PoseType, PointType>::result_type, typename RangeType = typename gtsam::Range<PoseType, PointType>::result_type>
bool dcsam::SemanticBearingRangeFactor< PoseType, PointType, BearingType, RangeType >::equals ( const DCFactor other,
double  tol = 1e-9 
) const
inlineoverridevirtual

Returns true when the DCFactor is equal to other

This will be specific to the model being implemented, so it is a pure virtual function and must be overridden.

Parameters
other- the DCFactor for which to test equality.
tol= 1e-9 - numerical tolerance for any floating point comparisons.

Implements dcsam::DCFactor.

◆ error()

template<typename PoseType , typename PointType , typename BearingType = typename gtsam::Bearing<PoseType, PointType>::result_type, typename RangeType = typename gtsam::Range<PoseType, PointType>::result_type>
double dcsam::SemanticBearingRangeFactor< PoseType, PointType, BearingType, RangeType >::error ( const gtsam::Values &  continuousVals,
const DiscreteValues discreteVals 
) const
inlineoverridevirtual

Return the error for the DCFactor given an assignment to the variables referenced by the discrete keys and the continuous keys (keys_).

This will be specific to the model being implemented, so it is a pure virtual function and must be overridden.

NOTE: Depending on the application, it may be important that the error function is normalized, i.e. it corresponds to a proper negative log-likelihood, rather than the negative log-likelihood with normalization constants discarded.

Parameters
continuousVals- the values assigned to the continuous variables, must contain keys in keys_ member variable
discreteVals- likewise, the values assigned to discrete variables, must contain keys in discreteKeys_
Returns
error (usually the negative log-likelihood) for the measurement model as a double.

Implements dcsam::DCFactor.

◆ linearize()

template<typename PoseType , typename PointType , typename BearingType = typename gtsam::Bearing<PoseType, PointType>::result_type, typename RangeType = typename gtsam::Range<PoseType, PointType>::result_type>
boost::shared_ptr<gtsam::GaussianFactor> dcsam::SemanticBearingRangeFactor< PoseType, PointType, BearingType, RangeType >::linearize ( const gtsam::Values &  continuousVals,
const DiscreteValues discreteVals 
) const
inlineoverridevirtual

Linearize the error function with respect to the continuous variables (given in keys_) at the point specified by continuousVals. Since this Jacobian can be dependent on the assignment to discrete variables as well, they are required as a parameter.

This will be specific to the model being implemented, so it is a pure virtual function and must be overridden.

Parameters
continuousVals- Assignment to the continuous variables in keys_
discreteVals- Likewise, assignment to the discrete variables in discreteKeys__.

Implements dcsam::DCFactor.

◆ logNormalizingConstant()

template<typename PoseType , typename PointType , typename BearingType = typename gtsam::Bearing<PoseType, PointType>::result_type, typename RangeType = typename gtsam::Range<PoseType, PointType>::result_type>
double dcsam::SemanticBearingRangeFactor< PoseType, PointType, BearingType, RangeType >::logNormalizingConstant ( const gtsam::Values &  values) const
inlineoverridevirtual

Calculate a normalizing constant for this DCFactor. Most implementations will be able to use the helper function nonlinearFactorLogNormalizingConstant provided below for most of the calculation. TODO(Kurran) is this the cleanest way to do this? Seems necessary for the DCMaxMixtureFactor implementations etc...

Reimplemented from dcsam::DCFactor.

◆ operator=()

template<typename PoseType , typename PointType , typename BearingType = typename gtsam::Bearing<PoseType, PointType>::result_type, typename RangeType = typename gtsam::Range<PoseType, PointType>::result_type>
SemanticBearingRangeFactor& dcsam::SemanticBearingRangeFactor< PoseType, PointType, BearingType, RangeType >::operator= ( const SemanticBearingRangeFactor< PoseType, PointType, BearingType, RangeType > &  rhs)
inline

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