Skip to content
Snippets Groups Projects
Commit e7277927 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

rename constrained nodes to **_other_**

parent dab2844a
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,6 @@
namespace wolf{
class FrameBase;
class FeatureBase;
class SensorBase;
}
//Wolf includes
......@@ -27,6 +26,7 @@ class CaptureBase : public NodeBase // NodeLinked<FrameBase, FeatureBase>
FeatureBaseList feature_list_;
static unsigned int capture_id_count_;
protected:
unsigned int capture_id_;
TimeStamp time_stamp_; ///< Time stamp
......
......@@ -13,9 +13,9 @@ ConstraintBase::ConstraintBase(ConstraintType _tp, bool _apply_loss_function, Co
category_(CTR_ABSOLUTE),
status_(_status),
apply_loss_function_(_apply_loss_function),
frame_ptr_(nullptr),
feature_ptr_(nullptr),
landmark_ptr_(nullptr)
frame_other_ptr_(nullptr),
feature_other_ptr_(nullptr),
landmark_other_ptr_(nullptr)
{
//std::cout << "creating ConstraintBase " << std::endl;
}
......@@ -28,12 +28,12 @@ ConstraintBase::ConstraintBase(ConstraintType _tp, FrameBase* _frame_ptr, bool _
category_(CTR_FRAME),
status_(_status),
apply_loss_function_(_apply_loss_function),
frame_ptr_(_frame_ptr),
feature_ptr_(nullptr),
landmark_ptr_(nullptr)
frame_other_ptr_(_frame_ptr),
feature_other_ptr_(nullptr),
landmark_other_ptr_(nullptr)
{
// add constraint to frame
frame_ptr_->addConstrainedBy(this);
frame_other_ptr_->addConstrainedBy(this);
}
......@@ -44,12 +44,12 @@ ConstraintBase::ConstraintBase(ConstraintType _tp, FeatureBase* _feature_ptr, bo
category_(CTR_FEATURE),
status_(_status),
apply_loss_function_(_apply_loss_function),
frame_ptr_(nullptr),
feature_ptr_(_feature_ptr),
landmark_ptr_(nullptr)
frame_other_ptr_(nullptr),
feature_other_ptr_(_feature_ptr),
landmark_other_ptr_(nullptr)
{
// add constraint to feature
feature_ptr_->addConstrainedBy(this);
feature_other_ptr_->addConstrainedBy(this);
}
......@@ -60,12 +60,12 @@ ConstraintBase::ConstraintBase(ConstraintType _tp, LandmarkBase* _landmark_ptr,
category_(CTR_LANDMARK),
status_(_status),
apply_loss_function_(_apply_loss_function),
frame_ptr_(nullptr),
feature_ptr_(nullptr),
landmark_ptr_(_landmark_ptr)
frame_other_ptr_(nullptr),
feature_other_ptr_(nullptr),
landmark_other_ptr_(_landmark_ptr)
{
// add constraint to landmark
landmark_ptr_->addConstrainedBy(this);
landmark_other_ptr_->addConstrainedBy(this);
}
ConstraintBase::~ConstraintBase()
......@@ -80,12 +80,12 @@ ConstraintBase::~ConstraintBase()
//std::cout << "removeConstraintPtr " << std::endl;
// remove constraint to frame/landmark/feature
if (frame_ptr_ != nullptr)
frame_ptr_->removeConstrainedBy(this);
if (feature_ptr_ != nullptr)
feature_ptr_->removeConstrainedBy(this);
if (landmark_ptr_ != nullptr)
landmark_ptr_->removeConstrainedBy(this);
if (frame_other_ptr_ != nullptr)
frame_other_ptr_->removeConstrainedBy(this);
if (feature_other_ptr_ != nullptr)
feature_other_ptr_->removeConstrainedBy(this);
if (landmark_other_ptr_ != nullptr)
landmark_other_ptr_->removeConstrainedBy(this);
//std::cout << "removed constraints to " << std::endl;
}
......
......@@ -4,7 +4,6 @@
// Forward declarations for node templates
namespace wolf{
class FeatureBase;
class NodeTerminus;
}
//Wolf includes
......@@ -23,16 +22,19 @@ class ConstraintBase : public NodeBase // NodeLinked<FeatureBase, NodeTerminus>
{
private:
ProblemPtr problem_ptr_;
FeatureBasePtr feature_ptr_; ///< FeatureBase pointer (upper node)
static unsigned int constraint_id_count_;
protected:
unsigned int constraint_id_;
ConstraintType type_id_; ///< type 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)
bool apply_loss_function_; ///< flag for applying loss function to this constraint
FrameBase* frame_ptr_; ///< FrameBase pointer (for category CTR_FRAME)
FeatureBase* feature_ptr_; ///< FeatureBase pointer (for category CTR_FEATURE)
LandmarkBase* landmark_ptr_; ///< LandmarkBase pointer (for category CTR_LANDMARK)
FrameBase* frame_other_ptr_; ///< FrameBase pointer (for category CTR_FRAME)
FeatureBase* feature_other_ptr_; ///< FeatureBase pointer (for category CTR_FEATURE)
LandmarkBase* landmark_other_ptr_; ///< LandmarkBase pointer (for category CTR_LANDMARK)
public:
......@@ -198,12 +200,12 @@ inline void ConstraintBase::setApplyLossFunction(const bool _apply)
inline FrameBase* ConstraintBase::getFrameOtherPtr()
{
return frame_ptr_;
return frame_other_ptr_;
}
inline FeatureBase* ConstraintBase::getFeatureOtherPtr()
{
return feature_ptr_;
return feature_other_ptr_;
}
inline void ConstraintBase::destruct()
......@@ -211,10 +213,10 @@ inline void ConstraintBase::destruct()
// TODO implement something
if (!is_deleting_)
{
if (feature_ptr_ != nullptr) // && !up_node_ptr_->isTop())
if (feature_other_ptr_ != nullptr) // && !up_node_ptr_->isTop())
{
//std::cout << "upper node is not WolfProblem " << std::endl;
feature_ptr_->removeConstraint(this);
feature_other_ptr_->removeConstraint(this);
}
else
{
......@@ -226,7 +228,7 @@ inline void ConstraintBase::destruct()
inline LandmarkBase* ConstraintBase::getLandmarkOtherPtr()
{
return landmark_ptr_;
return landmark_other_ptr_;
}
} // namespace wolf
......
......@@ -30,7 +30,7 @@ class ConstraintCorner2D: public ConstraintSparse<3,2,1,2,1>
LandmarkCorner2D* getLandmarkPtr()
{
return (LandmarkCorner2D*) landmark_ptr_;
return (LandmarkCorner2D*) landmark_other_ptr_;
}
template <typename T>
......
......@@ -44,7 +44,7 @@ class ConstraintPoint2D: public ConstraintSparse<2,2,1,2,1,2>
LandmarkPolyline2D* getLandmarkPtr()
{
return (LandmarkPolyline2D*) landmark_ptr_;
return (LandmarkPolyline2D*) landmark_other_ptr_;
}
int getLandmarkPointId()
......
......@@ -45,7 +45,7 @@ class ConstraintPointToLine2D: public ConstraintSparse<1,2,1,2,1,2,2>
LandmarkPolyline2D* getLandmarkPtr()
{
return (LandmarkPolyline2D*) landmark_ptr_;
return (LandmarkPolyline2D*) landmark_other_ptr_;
}
int getLandmarkPointId()
......
......@@ -27,6 +27,7 @@ class FeatureBase : public NodeBase // NodeConstrained<CaptureBase,ConstraintBas
ConstraintBaseList constrained_by_list_;
static unsigned int feature_id_count_;
protected:
unsigned int feature_id_;
unsigned int track_id_; // ID of the feature track
......
......@@ -28,6 +28,7 @@ class FrameBase : public NodeBase // NodeConstrained<TrajectoryBase,CaptureBase>
ConstraintBaseList constrained_by_list_;
static unsigned int frame_id_count_;
protected:
unsigned int frame_id_;
FrameKeyType type_id_; ///< type of frame. Either NON_KEY_FRAME or KEY_FRAME. (types defined at wolf.h)
......
......@@ -3,8 +3,8 @@
// Fwd dependencies
namespace wolf{
class SensorBase;
class Problem;
class SensorBase;
}
//Wolf includes
......
......@@ -4,7 +4,6 @@
// Fwd references
namespace wolf{
class MapBase;
class NodeTerminus;
class StateBlock;
}
......@@ -33,6 +32,7 @@ class LandmarkBase : public NodeBase // NodeConstrained<MapBase, NodeTerminus>
ProblemPtr problem_ptr_;
MapBasePtr map_ptr_;
ConstraintBaseList constrained_by_list_;
static unsigned int landmark_id_count_;
protected:
......
......@@ -3,14 +3,12 @@
// Fwd refs
namespace wolf{
class Problem;
class SensorBase;
}
//Wolf includes
#include "wolf.h"
#include "node_base.h"
//#include "problem.h"
namespace wolf {
......
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