Skip to content
Snippets Groups Projects
Commit ecb4ebf5 authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

created a factor_landmark_dummy for processor_tracker_landmark_dummy

parent 922aa458
No related branches found
No related tags found
1 merge request!278Resolve "Revisit demos (formerly called examples) and update them"
...@@ -288,6 +288,7 @@ SET(HDRS_FACTOR ...@@ -288,6 +288,7 @@ SET(HDRS_FACTOR
include/core/factor/factor_block_absolute.h include/core/factor/factor_block_absolute.h
include/core/factor/factor_diff_drive.h include/core/factor/factor_diff_drive.h
include/core/factor/factor_feature_dummy.h include/core/factor/factor_feature_dummy.h
include/core/factor/factor_landmark_dummy.h
include/core/factor/factor_odom_2D.h include/core/factor/factor_odom_2D.h
include/core/factor/factor_odom_2D_analytic.h include/core/factor/factor_odom_2D_analytic.h
include/core/factor/factor_odom_3D.h include/core/factor/factor_odom_3D.h
......
#ifndef FACTOR_LANDMARK_DUMMY_H
#define FACTOR_LANDMARK_DUMMY_H
#include "core/factor/factor_base.h"
namespace wolf {
WOLF_PTR_TYPEDEFS(FactorLandmarkDummy);
class FactorLandmarkDummy : public FactorBase
{
public:
FactorLandmarkDummy(const FeatureBasePtr& _feature_ptr,
const LandmarkBasePtr& _landmark_other_ptr,
const ProcessorBasePtr& _processor_ptr = nullptr,
bool _apply_loss_function = false,
FactorStatus _status = FAC_ACTIVE);
virtual ~FactorLandmarkDummy() = default;
/** \brief Evaluate the factor given the input parameters and returning the residuals and jacobians
**/
virtual bool evaluate(Scalar const* const* parameters, Scalar* residuals, Scalar** jacobians) const override {return true;};
/** Returns a residual vector and a vector of Jacobian matrix corresponding to each state block evaluated in the point provided in _states_ptr
**/
virtual void evaluate(const std::vector<const Scalar*>& _states_ptr, Eigen::VectorXs& residual_, std::vector<Eigen::MatrixXs>& jacobians_) const override {};
/** \brief Returns the jacobians computation method
**/
virtual JacobianMethod getJacobianMethod() const override {return JAC_ANALYTIC;}
/** \brief Returns a vector of pointers to the states in which this factor depends
**/
virtual std::vector<StateBlockPtr> getStateBlockPtrVector() const override {return std::vector<StateBlockPtr>(0);}
/** \brief Returns the factor residual size
**/
virtual unsigned int getSize() const override {return 0;}
/** \brief Returns the factor states sizes
**/
virtual std::vector<unsigned int> getStateSizes() const override {return std::vector<unsigned int>({1});}
public:
static FactorBasePtr create(const FeatureBasePtr& _feature_ptr,
const NodeBasePtr& _correspondant_ptr,
const ProcessorBasePtr& _processor_ptr = nullptr);
};
inline FactorLandmarkDummy::FactorLandmarkDummy(const FeatureBasePtr& /*_feature_ptr*/, const LandmarkBasePtr& _landmark_other_ptr,
const ProcessorBasePtr& _processor_ptr,
bool _apply_loss_function, FactorStatus _status) :
FactorBase("FEATURE DUMMY", nullptr, nullptr, nullptr, _landmark_other_ptr, _processor_ptr, _apply_loss_function, _status)
{
//
}
inline FactorBasePtr FactorLandmarkDummy::create(const FeatureBasePtr& _feature_ptr, const NodeBasePtr& _correspondant_ptr,
const ProcessorBasePtr& _processor_ptr)
{
return std::make_shared<FactorLandmarkDummy>(_feature_ptr, std::static_pointer_cast<LandmarkBase>(_correspondant_ptr), _processor_ptr);
}
} // namespace wolf
#endif // FACTOR_LANDMARK_DUMMY_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment