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

Added ConstraintBase::apply_loss_function_ initiallized in the

constructor
parent 5ea0505c
No related branches found
No related tags found
No related merge requests found
...@@ -3,30 +3,30 @@ ...@@ -3,30 +3,30 @@
namespace wolf { namespace wolf {
ConstraintAnalytic::ConstraintAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, ConstraintStatus _status, ConstraintAnalytic::ConstraintAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, bool _apply_loss_function, ConstraintStatus _status,
StateBlock* _state0Ptr, StateBlock* _state1Ptr, StateBlock* _state2Ptr, StateBlock* _state3Ptr, StateBlock* _state4Ptr, StateBlock* _state0Ptr, StateBlock* _state1Ptr, StateBlock* _state2Ptr, StateBlock* _state3Ptr, StateBlock* _state4Ptr,
StateBlock* _state5Ptr, StateBlock* _state6Ptr, StateBlock* _state7Ptr, StateBlock* _state8Ptr, StateBlock* _state9Ptr ) : StateBlock* _state5Ptr, StateBlock* _state6Ptr, StateBlock* _state7Ptr, StateBlock* _state8Ptr, StateBlock* _state9Ptr ) :
ConstraintBase(_tp, _status), ConstraintBase(_tp, _apply_loss_function, _status),
state_ptr_vector_({_state0Ptr, _state1Ptr, _state2Ptr, _state3Ptr, _state4Ptr, state_ptr_vector_({_state0Ptr, _state1Ptr, _state2Ptr, _state3Ptr, _state4Ptr,
_state5Ptr, _state6Ptr, _state7Ptr, _state8Ptr, _state9Ptr}) _state5Ptr, _state6Ptr, _state7Ptr, _state8Ptr, _state9Ptr})
{ {
resizeVectors(); resizeVectors();
} }
ConstraintAnalytic::ConstraintAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, FrameBase* _frame_ptr, ConstraintStatus _status, ConstraintAnalytic::ConstraintAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, FrameBase* _frame_ptr, bool _apply_loss_function, ConstraintStatus _status,
StateBlock* _state0Ptr, StateBlock* _state1Ptr, StateBlock* _state2Ptr, StateBlock* _state3Ptr, StateBlock* _state4Ptr, StateBlock* _state0Ptr, StateBlock* _state1Ptr, StateBlock* _state2Ptr, StateBlock* _state3Ptr, StateBlock* _state4Ptr,
StateBlock* _state5Ptr, StateBlock* _state6Ptr, StateBlock* _state7Ptr, StateBlock* _state8Ptr, StateBlock* _state9Ptr ) : StateBlock* _state5Ptr, StateBlock* _state6Ptr, StateBlock* _state7Ptr, StateBlock* _state8Ptr, StateBlock* _state9Ptr ) :
ConstraintBase(_tp, _frame_ptr, _status), ConstraintBase(_tp, _frame_ptr, _apply_loss_function, _status),
state_ptr_vector_({_state0Ptr, _state1Ptr, _state2Ptr, _state3Ptr, _state4Ptr, state_ptr_vector_({_state0Ptr, _state1Ptr, _state2Ptr, _state3Ptr, _state4Ptr,
_state5Ptr, _state6Ptr, _state7Ptr, _state8Ptr, _state9Ptr}) _state5Ptr, _state6Ptr, _state7Ptr, _state8Ptr, _state9Ptr})
{ {
resizeVectors(); resizeVectors();
} }
ConstraintAnalytic::ConstraintAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, FeatureBase* _feature_ptr, ConstraintStatus _status, ConstraintAnalytic::ConstraintAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, FeatureBase* _feature_ptr, bool _apply_loss_function, ConstraintStatus _status,
StateBlock* _state0Ptr, StateBlock* _state1Ptr, StateBlock* _state2Ptr, StateBlock* _state3Ptr, StateBlock* _state4Ptr, StateBlock* _state0Ptr, StateBlock* _state1Ptr, StateBlock* _state2Ptr, StateBlock* _state3Ptr, StateBlock* _state4Ptr,
StateBlock* _state5Ptr, StateBlock* _state6Ptr, StateBlock* _state7Ptr, StateBlock* _state8Ptr, StateBlock* _state9Ptr ) : StateBlock* _state5Ptr, StateBlock* _state6Ptr, StateBlock* _state7Ptr, StateBlock* _state8Ptr, StateBlock* _state9Ptr ) :
ConstraintBase( _tp, _feature_ptr, _status), ConstraintBase( _tp, _feature_ptr, _apply_loss_function, _status),
state_ptr_vector_({_state0Ptr, _state1Ptr, _state2Ptr, _state3Ptr, _state4Ptr, state_ptr_vector_({_state0Ptr, _state1Ptr, _state2Ptr, _state3Ptr, _state4Ptr,
_state5Ptr, _state6Ptr, _state7Ptr, _state8Ptr, _state9Ptr}) _state5Ptr, _state6Ptr, _state7Ptr, _state8Ptr, _state9Ptr})
{ {
...@@ -34,10 +34,10 @@ ConstraintAnalytic::ConstraintAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp ...@@ -34,10 +34,10 @@ ConstraintAnalytic::ConstraintAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp
} }
ConstraintAnalytic::ConstraintAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, LandmarkBase* _landmark_ptr, ConstraintStatus _status, ConstraintAnalytic::ConstraintAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, LandmarkBase* _landmark_ptr, bool _apply_loss_function, ConstraintStatus _status,
StateBlock* _state0Ptr, StateBlock* _state1Ptr, StateBlock* _state2Ptr, StateBlock* _state3Ptr, StateBlock* _state4Ptr, StateBlock* _state0Ptr, StateBlock* _state1Ptr, StateBlock* _state2Ptr, StateBlock* _state3Ptr, StateBlock* _state4Ptr,
StateBlock* _state5Ptr, StateBlock* _state6Ptr, StateBlock* _state7Ptr, StateBlock* _state8Ptr, StateBlock* _state9Ptr ) : StateBlock* _state5Ptr, StateBlock* _state6Ptr, StateBlock* _state7Ptr, StateBlock* _state8Ptr, StateBlock* _state9Ptr ) :
ConstraintBase( _tp, _landmark_ptr, _status), ConstraintBase( _tp, _landmark_ptr, _apply_loss_function, _status),
state_ptr_vector_({_state0Ptr, _state1Ptr, _state2Ptr, _state3Ptr, _state4Ptr, state_ptr_vector_({_state0Ptr, _state1Ptr, _state2Ptr, _state3Ptr, _state4Ptr,
_state5Ptr, _state6Ptr, _state7Ptr, _state8Ptr, _state9Ptr}) _state5Ptr, _state6Ptr, _state7Ptr, _state8Ptr, _state9Ptr})
{ {
......
...@@ -21,7 +21,7 @@ class ConstraintAnalytic: public ConstraintBase ...@@ -21,7 +21,7 @@ class ConstraintAnalytic: public ConstraintBase
* Constructor of category CTR_ABSOLUTE * Constructor of category CTR_ABSOLUTE
* *
**/ **/
ConstraintAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, ConstraintStatus _status, ConstraintAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, bool _apply_loss_function, ConstraintStatus _status,
StateBlock* _state0Ptr, StateBlock* _state0Ptr,
StateBlock* _state1Ptr = nullptr, StateBlock* _state1Ptr = nullptr,
StateBlock* _state2Ptr = nullptr, StateBlock* _state2Ptr = nullptr,
...@@ -38,7 +38,7 @@ class ConstraintAnalytic: public ConstraintBase ...@@ -38,7 +38,7 @@ class ConstraintAnalytic: public ConstraintBase
* Constructor of category CTR_FRAME * Constructor of category CTR_FRAME
* *
**/ **/
ConstraintAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, FrameBase* _frame_ptr, ConstraintStatus _status, ConstraintAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, FrameBase* _frame_ptr, bool _apply_loss_function, ConstraintStatus _status,
StateBlock* _state0Ptr, StateBlock* _state0Ptr,
StateBlock* _state1Ptr = nullptr, StateBlock* _state1Ptr = nullptr,
StateBlock* _state2Ptr = nullptr, StateBlock* _state2Ptr = nullptr,
...@@ -55,7 +55,7 @@ class ConstraintAnalytic: public ConstraintBase ...@@ -55,7 +55,7 @@ class ConstraintAnalytic: public ConstraintBase
* Constructor of category CTR_FEATURE * Constructor of category CTR_FEATURE
* *
**/ **/
ConstraintAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, FeatureBase* _feature_ptr, ConstraintStatus _status, ConstraintAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, FeatureBase* _feature_ptr, bool _apply_loss_function, ConstraintStatus _status,
StateBlock* _state0Ptr, StateBlock* _state0Ptr,
StateBlock* _state1Ptr = nullptr, StateBlock* _state1Ptr = nullptr,
StateBlock* _state2Ptr = nullptr, StateBlock* _state2Ptr = nullptr,
...@@ -72,7 +72,7 @@ class ConstraintAnalytic: public ConstraintBase ...@@ -72,7 +72,7 @@ class ConstraintAnalytic: public ConstraintBase
* Constructor of category CTR_LANDMARK * Constructor of category CTR_LANDMARK
* *
**/ **/
ConstraintAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, LandmarkBase* _landmark_ptr, ConstraintStatus _status, ConstraintAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, LandmarkBase* _landmark_ptr, bool _apply_loss_function, ConstraintStatus _status,
StateBlock* _state0Ptr, StateBlock* _state0Ptr,
StateBlock* _state1Ptr = nullptr, StateBlock* _state1Ptr = nullptr,
StateBlock* _state2Ptr = nullptr, StateBlock* _state2Ptr = nullptr,
......
...@@ -7,12 +7,13 @@ namespace wolf { ...@@ -7,12 +7,13 @@ namespace wolf {
unsigned int ConstraintBase::constraint_id_count_ = 0; unsigned int ConstraintBase::constraint_id_count_ = 0;
ConstraintBase::ConstraintBase(ConstraintType _tp, ConstraintStatus _status) : ConstraintBase::ConstraintBase(ConstraintType _tp, bool _apply_loss_function, ConstraintStatus _status) :
NodeLinked(BOTTOM, "CONSTRAINT"), NodeLinked(BOTTOM, "CONSTRAINT"),
constraint_id_(++constraint_id_count_), constraint_id_(++constraint_id_count_),
type_id_(_tp), type_id_(_tp),
category_(CTR_ABSOLUTE), category_(CTR_ABSOLUTE),
status_(_status), status_(_status),
apply_loss_function_(_apply_loss_function),
frame_ptr_(nullptr), frame_ptr_(nullptr),
feature_ptr_(nullptr), feature_ptr_(nullptr),
landmark_ptr_(nullptr) landmark_ptr_(nullptr)
...@@ -21,12 +22,13 @@ ConstraintBase::ConstraintBase(ConstraintType _tp, ConstraintStatus _status) : ...@@ -21,12 +22,13 @@ ConstraintBase::ConstraintBase(ConstraintType _tp, ConstraintStatus _status) :
} }
ConstraintBase::ConstraintBase(ConstraintType _tp, FrameBase* _frame_ptr, ConstraintStatus _status) : ConstraintBase::ConstraintBase(ConstraintType _tp, FrameBase* _frame_ptr, bool _apply_loss_function, ConstraintStatus _status) :
NodeLinked(BOTTOM, "CONSTRAINT"), NodeLinked(BOTTOM, "CONSTRAINT"),
constraint_id_(++constraint_id_count_), constraint_id_(++constraint_id_count_),
type_id_(_tp), type_id_(_tp),
category_(CTR_FRAME), category_(CTR_FRAME),
status_(_status), status_(_status),
apply_loss_function_(_apply_loss_function),
frame_ptr_(_frame_ptr), frame_ptr_(_frame_ptr),
feature_ptr_(nullptr), feature_ptr_(nullptr),
landmark_ptr_(nullptr) landmark_ptr_(nullptr)
...@@ -36,12 +38,13 @@ ConstraintBase::ConstraintBase(ConstraintType _tp, FrameBase* _frame_ptr, Constr ...@@ -36,12 +38,13 @@ ConstraintBase::ConstraintBase(ConstraintType _tp, FrameBase* _frame_ptr, Constr
} }
ConstraintBase::ConstraintBase(ConstraintType _tp, FeatureBase* _feature_ptr, ConstraintStatus _status) : ConstraintBase::ConstraintBase(ConstraintType _tp, FeatureBase* _feature_ptr, bool _apply_loss_function, ConstraintStatus _status) :
NodeLinked(BOTTOM, "CONSTRAINT"), NodeLinked(BOTTOM, "CONSTRAINT"),
constraint_id_(++constraint_id_count_), constraint_id_(++constraint_id_count_),
type_id_(_tp), type_id_(_tp),
category_(CTR_FEATURE), category_(CTR_FEATURE),
status_(_status), status_(_status),
apply_loss_function_(_apply_loss_function),
frame_ptr_(nullptr), frame_ptr_(nullptr),
feature_ptr_(_feature_ptr), feature_ptr_(_feature_ptr),
landmark_ptr_(nullptr) landmark_ptr_(nullptr)
...@@ -51,12 +54,13 @@ ConstraintBase::ConstraintBase(ConstraintType _tp, FeatureBase* _feature_ptr, Co ...@@ -51,12 +54,13 @@ ConstraintBase::ConstraintBase(ConstraintType _tp, FeatureBase* _feature_ptr, Co
} }
ConstraintBase::ConstraintBase(ConstraintType _tp, LandmarkBase* _landmark_ptr, ConstraintStatus _status) : ConstraintBase::ConstraintBase(ConstraintType _tp, LandmarkBase* _landmark_ptr, bool _apply_loss_function, ConstraintStatus _status) :
NodeLinked(BOTTOM, "CONSTRAINT"), NodeLinked(BOTTOM, "CONSTRAINT"),
constraint_id_(++constraint_id_count_), constraint_id_(++constraint_id_count_),
type_id_(_tp), type_id_(_tp),
category_(CTR_LANDMARK), category_(CTR_LANDMARK),
status_(_status), status_(_status),
apply_loss_function_(_apply_loss_function),
frame_ptr_(nullptr), frame_ptr_(nullptr),
feature_ptr_(nullptr), feature_ptr_(nullptr),
landmark_ptr_(_landmark_ptr) landmark_ptr_(_landmark_ptr)
......
...@@ -24,9 +24,10 @@ class ConstraintBase : public NodeLinked<FeatureBase, NodeTerminus> ...@@ -24,9 +24,10 @@ class ConstraintBase : public NodeLinked<FeatureBase, NodeTerminus>
static unsigned int constraint_id_count_; static unsigned int constraint_id_count_;
protected: protected:
unsigned int constraint_id_; unsigned int constraint_id_;
ConstraintType type_id_; ///< type of constraint (types defined at wolf.h) ConstraintType type_id_; ///< type of constraint (types defined at wolf.h)
ConstraintCategory category_; ///< category of constraint (types defined at wolf.h) ConstraintCategory category_; ///< category of constraint (types defined at wolf.h)
ConstraintStatus status_; ///< status of constraint (types defined at wolf.h) ConstraintStatus status_; ///< status of constraint (types defined at wolf.h)
bool apply_loss_function_; ///< flag for applying loss function to this constraint
FrameBase* frame_ptr_; ///< FrameBase pointer (for category CTR_FRAME) FrameBase* frame_ptr_; ///< FrameBase pointer (for category CTR_FRAME)
FeatureBase* feature_ptr_; ///< FeatureBase pointer (for category CTR_FEATURE) FeatureBase* feature_ptr_; ///< FeatureBase pointer (for category CTR_FEATURE)
LandmarkBase* landmark_ptr_; ///< LandmarkBase pointer (for category CTR_LANDMARK) LandmarkBase* landmark_ptr_; ///< LandmarkBase pointer (for category CTR_LANDMARK)
...@@ -35,19 +36,19 @@ class ConstraintBase : public NodeLinked<FeatureBase, NodeTerminus> ...@@ -35,19 +36,19 @@ class ConstraintBase : public NodeLinked<FeatureBase, NodeTerminus>
/** \brief Constructor of category CTR_ABSOLUTE /** \brief Constructor of category CTR_ABSOLUTE
**/ **/
ConstraintBase(ConstraintType _tp, ConstraintStatus _status); ConstraintBase(ConstraintType _tp, bool _apply_loss_function, ConstraintStatus _status);
/** \brief Constructor of category CTR_FRAME /** \brief Constructor of category CTR_FRAME
**/ **/
ConstraintBase(ConstraintType _tp, FrameBase* _frame_ptr, ConstraintStatus _status); ConstraintBase(ConstraintType _tp, FrameBase* _frame_ptr, bool _apply_loss_function, ConstraintStatus _status);
/** \brief Constructor of category CTR_FEATURE /** \brief Constructor of category CTR_FEATURE
**/ **/
ConstraintBase(ConstraintType _tp, FeatureBase* _feature_ptr, ConstraintStatus _status); ConstraintBase(ConstraintType _tp, FeatureBase* _feature_ptr, bool _apply_loss_function, ConstraintStatus _status);
/** \brief Constructor of category CTR_LANDMARK /** \brief Constructor of category CTR_LANDMARK
**/ **/
ConstraintBase(ConstraintType _tp, LandmarkBase* _landmark_ptr, ConstraintStatus _status); ConstraintBase(ConstraintType _tp, LandmarkBase* _landmark_ptr, bool _apply_loss_function, ConstraintStatus _status);
/** \brief Default destructor (not recommended) /** \brief Default destructor (not recommended)
* *
...@@ -110,6 +111,14 @@ class ConstraintBase : public NodeLinked<FeatureBase, NodeTerminus> ...@@ -110,6 +111,14 @@ class ConstraintBase : public NodeLinked<FeatureBase, NodeTerminus>
*/ */
void setStatus(ConstraintStatus _status); void setStatus(ConstraintStatus _status);
/** \brief Gets the apply loss function flag
*/
bool getApplyLossFunction();
/** \brief Gets the apply loss function flag
*/
void setApplyLossFunction(const bool _apply);
/** \brief Returns a pointer to the frame constrained to /** \brief Returns a pointer to the frame constrained to
**/ **/
FrameBase* getFrameOtherPtr(); FrameBase* getFrameOtherPtr();
...@@ -150,6 +159,25 @@ inline ConstraintStatus ConstraintBase::getStatus() const ...@@ -150,6 +159,25 @@ inline ConstraintStatus ConstraintBase::getStatus() const
return status_; return status_;
} }
inline bool ConstraintBase::getApplyLossFunction()
{
return apply_loss_function_;
}
inline void ConstraintBase::setApplyLossFunction(const bool _apply)
{
if (apply_loss_function_ != _apply)
{
if (getProblem() == nullptr)
std::cout << "constraint not linked with Problem, apply loss function change not notified" << std::endl;
else
{
getProblem()->removeConstraintPtr(this);
getProblem()->addConstraintPtr(this);
}
}
}
inline FrameBase* ConstraintBase::getFrameOtherPtr() inline FrameBase* ConstraintBase::getFrameOtherPtr()
{ {
return frame_ptr_; return frame_ptr_;
......
...@@ -17,8 +17,8 @@ class ConstraintContainer: public ConstraintSparse<3,2,1,2,1> ...@@ -17,8 +17,8 @@ class ConstraintContainer: public ConstraintSparse<3,2,1,2,1>
public: public:
static const unsigned int N_BLOCKS = 4; static const unsigned int N_BLOCKS = 4;
ConstraintContainer(FeatureBase* _ftr_ptr, LandmarkContainer* _lmk_ptr, const unsigned int _corner, ConstraintStatus _status = CTR_ACTIVE) : ConstraintContainer(FeatureBase* _ftr_ptr, LandmarkContainer* _lmk_ptr, const unsigned int _corner, bool _apply_loss_function = false, ConstraintStatus _status = CTR_ACTIVE) :
ConstraintSparse<3,2,1,2,1>(_ftr_ptr, CTR_CONTAINER, _lmk_ptr, _status, _ftr_ptr->getFramePtr()->getPPtr(),_ftr_ptr->getFramePtr()->getOPtr(), _lmk_ptr->getPPtr(), _lmk_ptr->getOPtr()), ConstraintSparse<3,2,1,2,1>(_ftr_ptr, CTR_CONTAINER, _lmk_ptr, _apply_loss_function, _status, _ftr_ptr->getFramePtr()->getPPtr(),_ftr_ptr->getFramePtr()->getOPtr(), _lmk_ptr->getPPtr(), _lmk_ptr->getOPtr()),
lmk_ptr_(_lmk_ptr), lmk_ptr_(_lmk_ptr),
corner_(_corner) corner_(_corner)
{ {
......
...@@ -13,8 +13,8 @@ class ConstraintCorner2D: public ConstraintSparse<3,2,1,2,1> ...@@ -13,8 +13,8 @@ class ConstraintCorner2D: public ConstraintSparse<3,2,1,2,1>
public: public:
static const unsigned int N_BLOCKS = 4; static const unsigned int N_BLOCKS = 4;
ConstraintCorner2D(FeatureBase* _ftr_ptr, LandmarkCorner2D* _lmk_ptr, ConstraintStatus _status = CTR_ACTIVE) : ConstraintCorner2D(FeatureBase* _ftr_ptr, LandmarkCorner2D* _lmk_ptr, bool _apply_loss_function = false, ConstraintStatus _status = CTR_ACTIVE) :
ConstraintSparse<3,2,1,2,1>(_ftr_ptr, CTR_CORNER_2D, _lmk_ptr, _status, _ftr_ptr->getFramePtr()->getPPtr(),_ftr_ptr->getFramePtr()->getOPtr(), _lmk_ptr->getPPtr(), _lmk_ptr->getOPtr()) ConstraintSparse<3,2,1,2,1>(_ftr_ptr, CTR_CORNER_2D, _lmk_ptr, _apply_loss_function, _status, _ftr_ptr->getFramePtr()->getPPtr(),_ftr_ptr->getFramePtr()->getOPtr(), _lmk_ptr->getPPtr(), _lmk_ptr->getOPtr())
{ {
setType("CORNER 2D"); setType("CORNER 2D");
} }
......
...@@ -8,7 +8,7 @@ namespace wolf { ...@@ -8,7 +8,7 @@ namespace wolf {
class ConstraintEpipolar : public ConstraintBase class ConstraintEpipolar : public ConstraintBase
{ {
public: public:
ConstraintEpipolar(FeatureBase* _feature_ptr, FeatureBase* _feature_other_ptr); ConstraintEpipolar(FeatureBase* _feature_ptr, FeatureBase* _feature_other_ptr, bool _apply_loss_function = false, ConstraintStatus _status = CTR_ACTIVE);
virtual ~ConstraintEpipolar(); virtual ~ConstraintEpipolar();
...@@ -37,8 +37,8 @@ class ConstraintEpipolar : public ConstraintBase ...@@ -37,8 +37,8 @@ class ConstraintEpipolar : public ConstraintBase
}; };
inline ConstraintEpipolar::ConstraintEpipolar(FeatureBase* _feature_ptr, FeatureBase* _feature_other_ptr) : inline ConstraintEpipolar::ConstraintEpipolar(FeatureBase* _feature_ptr, FeatureBase* _feature_other_ptr, bool _apply_loss_function, ConstraintStatus _status) :
ConstraintBase(CTR_EPIPOLAR, _feature_other_ptr, CTR_INACTIVE) ConstraintBase(CTR_EPIPOLAR, _feature_other_ptr, _apply_loss_function, _status)
{ {
setType("EPIPOLAR"); setType("EPIPOLAR");
} }
......
...@@ -14,8 +14,8 @@ class ConstraintFix: public ConstraintSparse<3,2,1> ...@@ -14,8 +14,8 @@ class ConstraintFix: public ConstraintSparse<3,2,1>
public: public:
static const unsigned int N_BLOCKS = 2; static const unsigned int N_BLOCKS = 2;
ConstraintFix(FeatureBase* _ftr_ptr, ConstraintStatus _status = CTR_ACTIVE) : ConstraintFix(FeatureBase* _ftr_ptr, bool _apply_loss_function = false, ConstraintStatus _status = CTR_ACTIVE) :
ConstraintSparse<3, 2, 1>(_ftr_ptr, CTR_FIX, _status, _ftr_ptr->getFramePtr()->getPPtr(), ConstraintSparse<3, 2, 1>(_ftr_ptr, CTR_FIX, _apply_loss_function, _status, _ftr_ptr->getFramePtr()->getPPtr(),
_ftr_ptr->getFramePtr()->getOPtr()) _ftr_ptr->getFramePtr()->getOPtr())
{ {
setType("FIX"); setType("FIX");
......
...@@ -13,8 +13,8 @@ class ConstraintGPS2D : public ConstraintSparse<2, 2> ...@@ -13,8 +13,8 @@ class ConstraintGPS2D : public ConstraintSparse<2, 2>
public: public:
static const unsigned int N_BLOCKS = 1; static const unsigned int N_BLOCKS = 1;
ConstraintGPS2D(FeatureBase* _ftr_ptr, FrameBase* _frame_ptr, ConstraintStatus _status = CTR_ACTIVE) : ConstraintGPS2D(FeatureBase* _ftr_ptr, FrameBase* _frame_ptr, bool _apply_loss_function = false, ConstraintStatus _status = CTR_ACTIVE) :
ConstraintSparse<2, 2>(_ftr_ptr, CTR_GPS_FIX_2D, _status, _frame_ptr->getPPtr()) ConstraintSparse<2, 2>(_ftr_ptr, CTR_GPS_FIX_2D, _apply_loss_function, _status, _frame_ptr->getPPtr())
{ {
setType("GPS FIX 2D"); setType("GPS FIX 2D");
} }
......
...@@ -28,9 +28,10 @@ namespace wolf { ...@@ -28,9 +28,10 @@ namespace wolf {
class ConstraintGPSPseudorange2D : public ConstraintSparse<1, 2, 1, 3, 1, 3, 1> class ConstraintGPSPseudorange2D : public ConstraintSparse<1, 2, 1, 3, 1, 3, 1>
{ {
public: public:
ConstraintGPSPseudorange2D(FeatureBase* _ftr_ptr, ConstraintStatus _status = CTR_ACTIVE) : ConstraintGPSPseudorange2D(FeatureBase* _ftr_ptr, bool _apply_loss_function = false, ConstraintStatus _status = CTR_ACTIVE) :
ConstraintSparse<1, 2, 1, 3, 1, 3, 1>(_ftr_ptr, ConstraintSparse<1, 2, 1, 3, 1, 3, 1>(_ftr_ptr,
CTR_GPS_PR_2D, CTR_GPS_PR_2D,
_apply_loss_function,
_status, _status,
_ftr_ptr->getCapturePtr()->getFramePtr()->getPPtr(), // position of the vehicle's frame with respect to the initial pos frame _ftr_ptr->getCapturePtr()->getFramePtr()->getPPtr(), // position of the vehicle's frame with respect to the initial pos frame
_ftr_ptr->getCapturePtr()->getFramePtr()->getOPtr(), // orientation of the vehicle's frame _ftr_ptr->getCapturePtr()->getFramePtr()->getOPtr(), // orientation of the vehicle's frame
......
...@@ -24,8 +24,8 @@ class ConstraintGPSPseudorange3D: public ConstraintSparse<1, 3, 4, 3, 1, 3, 4> ...@@ -24,8 +24,8 @@ class ConstraintGPSPseudorange3D: public ConstraintSparse<1, 3, 4, 3, 1, 3, 4>
public: public:
ConstraintGPSPseudorange3D(FeatureBase* _ftr_ptr, ConstraintStatus _status = CTR_ACTIVE) : ConstraintGPSPseudorange3D(FeatureBase* _ftr_ptr, bool _apply_loss_function = false, ConstraintStatus _status = CTR_ACTIVE) :
ConstraintSparse<1, 3, 4, 3, 1, 3, 4>(_ftr_ptr, CTR_GPS_PR_3D, _status, ConstraintSparse<1, 3, 4, 3, 1, 3, 4>(_ftr_ptr, CTR_GPS_PR_3D, _apply_loss_function, _status,
_ftr_ptr->getCapturePtr()->getFramePtr()->getPPtr(), // position of the vehicle's frame with respect to map frame _ftr_ptr->getCapturePtr()->getFramePtr()->getPPtr(), // position of the vehicle's frame with respect to map frame
_ftr_ptr->getCapturePtr()->getFramePtr()->getOPtr(), // orientation of the vehicle's frame wrt map frame _ftr_ptr->getCapturePtr()->getFramePtr()->getOPtr(), // orientation of the vehicle's frame wrt map frame
_ftr_ptr->getCapturePtr()->getSensorPPtr(), // position of the sensor (gps antenna) with respect to base frame _ftr_ptr->getCapturePtr()->getSensorPPtr(), // position of the sensor (gps antenna) with respect to base frame
......
...@@ -12,8 +12,8 @@ class ConstraintOdom2D : public ConstraintSparse<3, 2, 1, 2, 1> ...@@ -12,8 +12,8 @@ class ConstraintOdom2D : public ConstraintSparse<3, 2, 1, 2, 1>
public: public:
static const unsigned int N_BLOCKS = 4; static const unsigned int N_BLOCKS = 4;
ConstraintOdom2D(FeatureBase* _ftr_ptr, FrameBase* _frame_ptr, ConstraintStatus _status = CTR_ACTIVE) : ConstraintOdom2D(FeatureBase* _ftr_ptr, FrameBase* _frame_ptr, bool _apply_loss_function = false, ConstraintStatus _status = CTR_ACTIVE) :
ConstraintSparse<3, 2, 1, 2, 1>(_ftr_ptr, CTR_ODOM_2D, _frame_ptr, _status, _frame_ptr->getPPtr(), _frame_ptr->getOPtr(), _ftr_ptr->getFramePtr()->getPPtr(), _ftr_ptr->getFramePtr()->getOPtr()) ConstraintSparse<3, 2, 1, 2, 1>(_ftr_ptr, CTR_ODOM_2D, _frame_ptr, _apply_loss_function, _status, _frame_ptr->getPPtr(), _frame_ptr->getOPtr(), _ftr_ptr->getFramePtr()->getPPtr(), _ftr_ptr->getFramePtr()->getOPtr())
{ {
setType("ODOM 2D"); setType("ODOM 2D");
} }
......
...@@ -10,8 +10,8 @@ namespace wolf { ...@@ -10,8 +10,8 @@ namespace wolf {
class ConstraintOdom2DAnalytic : public ConstraintRelative2DAnalytic class ConstraintOdom2DAnalytic : public ConstraintRelative2DAnalytic
{ {
public: public:
ConstraintOdom2DAnalytic(FeatureBase* _ftr_ptr, FrameBase* _frame_ptr, ConstraintStatus _status = CTR_ACTIVE) : ConstraintOdom2DAnalytic(FeatureBase* _ftr_ptr, FrameBase* _frame_ptr, bool _apply_loss_function = false, ConstraintStatus _status = CTR_ACTIVE) :
ConstraintRelative2DAnalytic(_ftr_ptr, CTR_ODOM_2D, _frame_ptr, _status) ConstraintRelative2DAnalytic(_ftr_ptr, CTR_ODOM_2D, _frame_ptr, _apply_loss_function, _status)
{ {
setType("ODOM 2D ANALYTIC"); setType("ODOM 2D ANALYTIC");
} }
......
...@@ -14,24 +14,24 @@ class ConstraintRelative2DAnalytic : public ConstraintAnalytic ...@@ -14,24 +14,24 @@ class ConstraintRelative2DAnalytic : public ConstraintAnalytic
/** \brief Constructor of category CTR_FRAME /** \brief Constructor of category CTR_FRAME
**/ **/
ConstraintRelative2DAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, FrameBase* _frame_ptr, ConstraintStatus _status = CTR_ACTIVE) : ConstraintRelative2DAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, FrameBase* _frame_ptr, bool _apply_loss_function = false, ConstraintStatus _status = CTR_ACTIVE) :
ConstraintAnalytic(_ftr_ptr, _tp, _frame_ptr, _status, _frame_ptr->getPPtr(), _frame_ptr->getOPtr(), _ftr_ptr->getFramePtr()->getPPtr(), _ftr_ptr->getFramePtr()->getOPtr()) ConstraintAnalytic(_ftr_ptr, _tp, _frame_ptr, _apply_loss_function, _status, _frame_ptr->getPPtr(), _frame_ptr->getOPtr(), _ftr_ptr->getFramePtr()->getPPtr(), _ftr_ptr->getFramePtr()->getOPtr())
{ {
// //
} }
/** \brief Constructor of category CTR_FEATURE /** \brief Constructor of category CTR_FEATURE
**/ **/
ConstraintRelative2DAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, FeatureBase* _ftr_other_ptr, ConstraintStatus _status = CTR_ACTIVE) : ConstraintRelative2DAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, FeatureBase* _ftr_other_ptr, bool _apply_loss_function = false, ConstraintStatus _status = CTR_ACTIVE) :
ConstraintAnalytic(_ftr_ptr, _tp, _ftr_other_ptr, _status, _ftr_ptr->getFramePtr()->getPPtr(), _ftr_ptr->getFramePtr()->getOPtr(), _ftr_other_ptr->getFramePtr()->getPPtr(), _ftr_other_ptr->getFramePtr()->getOPtr() ) ConstraintAnalytic(_ftr_ptr, _tp, _ftr_other_ptr, _apply_loss_function, _status, _ftr_ptr->getFramePtr()->getPPtr(), _ftr_ptr->getFramePtr()->getOPtr(), _ftr_other_ptr->getFramePtr()->getPPtr(), _ftr_other_ptr->getFramePtr()->getOPtr() )
{ {
// //
} }
/** \brief Constructor of category CTR_LANDMARK /** \brief Constructor of category CTR_LANDMARK
**/ **/
ConstraintRelative2DAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, LandmarkBase* _landmark_ptr, ConstraintStatus _status = CTR_ACTIVE) : ConstraintRelative2DAnalytic(FeatureBase* _ftr_ptr, ConstraintType _tp, LandmarkBase* _landmark_ptr, bool _apply_loss_function = false, ConstraintStatus _status = CTR_ACTIVE) :
ConstraintAnalytic(_ftr_ptr, _tp, _landmark_ptr, _status, _ftr_ptr->getFramePtr()->getPPtr(), _ftr_ptr->getFramePtr()->getOPtr(), _landmark_ptr->getPPtr(), _landmark_ptr->getOPtr()) ConstraintAnalytic(_ftr_ptr, _tp, _landmark_ptr, _apply_loss_function, _status, _ftr_ptr->getFramePtr()->getPPtr(), _ftr_ptr->getFramePtr()->getOPtr(), _landmark_ptr->getPPtr(), _landmark_ptr->getOPtr())
{ {
// //
} }
......
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