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

addXXX is now protected, added corr. friends

parent 7f8c1d1b
No related branches found
No related tags found
1 merge request!274Resolve "Emplace API inconsistent with ProcessorTrackerFeature/Landmark functions"
......@@ -19,6 +19,8 @@ namespace wolf{
//class CaptureBase
class CaptureBase : public NodeBase, public std::enable_shared_from_this<CaptureBase>
{
friend FactorBase;
private:
FrameBaseWPtr frame_ptr_;
FeatureBasePtrList feature_list_;
......@@ -61,10 +63,7 @@ class CaptureBase : public NodeBase, public std::enable_shared_from_this<Capture
void unlinkFromFrame(){frame_ptr_.reset();}
virtual void setProblem(ProblemPtr _problem) final;
FeatureBasePtr addFeature(FeatureBasePtr _ft_ptr);
FeatureBasePtrList& getFeatureList();
void addFeatureList(FeatureBasePtrList& _new_ft_list);
void getFactorList(FactorBasePtrList& _fac_list);
......@@ -106,6 +105,7 @@ class CaptureBase : public NodeBase, public std::enable_shared_from_this<Capture
protected:
SizeEigen computeCalibSize() const;
FeatureBasePtr addFeature(FeatureBasePtr _ft_ptr);
private:
void updateCalibSize();
};
......
......@@ -18,6 +18,8 @@ namespace wolf {
//class FeatureBase
class FeatureBase : public NodeBase, public std::enable_shared_from_this<FeatureBase>
{
friend FactorBase;
private:
CaptureBaseWPtr capture_ptr_;
FactorBasePtrList factor_list_;
......@@ -85,7 +87,6 @@ class FeatureBase : public NodeBase, public std::enable_shared_from_this<Feature
CaptureBasePtr getCapture() const;
void setCapture(CaptureBasePtr _cap_ptr){capture_ptr_ = _cap_ptr;}
FactorBasePtr addFactor(FactorBasePtr _co_ptr);
FactorBasePtrList& getFactorList();
virtual FactorBasePtr addConstrainedBy(FactorBasePtr _fac_ptr);
......@@ -99,8 +100,11 @@ class FeatureBase : public NodeBase, public std::enable_shared_from_this<Feature
template<typename classType, typename... T>
static std::shared_ptr<FeatureBase> emplace(CaptureBasePtr _cpt_ptr, T&&... all);
private:
protected:
Eigen::MatrixXs computeSqrtUpper(const Eigen::MatrixXs& _M) const;
FactorBasePtr addFactor(FactorBasePtr _co_ptr);
};
}
......
......@@ -30,6 +30,9 @@ typedef enum
//class FrameBase
class FrameBase : public NodeBase, public std::enable_shared_from_this<FrameBase>
{
friend CaptureBase;
friend FactorBase;
private:
TrajectoryBaseWPtr trajectory_ptr_;
CaptureBasePtrList capture_list_;
......@@ -133,7 +136,6 @@ class FrameBase : public NodeBase, public std::enable_shared_from_this<FrameBase
FrameBasePtr getNextFrame() const;
CaptureBasePtrList& getCaptureList();
CaptureBasePtr addCapture(CaptureBasePtr _capt_ptr);
CaptureBasePtr getCaptureOf(const SensorBasePtr _sensor_ptr);
CaptureBasePtr getCaptureOf(const SensorBasePtr _sensor_ptr, const std::string& type);
CaptureBasePtrList getCapturesOf(const SensorBasePtr _sensor_ptr);
......@@ -150,6 +152,9 @@ class FrameBase : public NodeBase, public std::enable_shared_from_this<FrameBase
template<typename classType, typename... T>
static std::shared_ptr<FrameBase> emplace(TrajectoryBasePtr _ptr, T&&... all);
protected:
CaptureBasePtr addCapture(CaptureBasePtr _capt_ptr);
public:
static FrameBasePtr create_PO_2D (const FrameType & _tp,
const TimeStamp& _ts,
......
......@@ -16,6 +16,8 @@ namespace wolf {
//class HardwareBase
class HardwareBase : public NodeBase, public std::enable_shared_from_this<HardwareBase>
{
friend SensorBase;
private:
SensorBasePtrList sensor_list_;
......@@ -23,8 +25,10 @@ class HardwareBase : public NodeBase, public std::enable_shared_from_this<Hardwa
HardwareBase();
virtual ~HardwareBase();
virtual SensorBasePtr addSensor(SensorBasePtr _sensor_ptr);
SensorBasePtrList& getSensorList();
protected:
virtual SensorBasePtr addSensor(SensorBasePtr _sensor_ptr);
};
} // namespace wolf
......
......@@ -44,8 +44,8 @@ class LandmarkBase : public NodeBase, public std::enable_shared_from_this<Landma
* \param _o_ptr StateBlock pointer to the orientation (default: nullptr)
*
**/
LandmarkBase(const std::string& _type, StateBlockPtr _p_ptr, StateBlockPtr _o_ptr = nullptr);
LandmarkBase(MapBaseWPtr _ptr, const std::string& _type, StateBlockPtr _p_ptr, StateBlockPtr _o_ptr = nullptr);
LandmarkBase(const std::string& _type, StateBlockPtr _p_ptr, StateBlockPtr _o_ptr = nullptr);
LandmarkBase(MapBaseWPtr _ptr, const std::string& _type, StateBlockPtr _p_ptr, StateBlockPtr _o_ptr = nullptr);
virtual ~LandmarkBase();
virtual void remove();
virtual YAML::Node saveToYaml() const;
......
......@@ -19,6 +19,8 @@ namespace wolf {
//class MapBase
class MapBase : public NodeBase, public std::enable_shared_from_this<MapBase>
{
friend LandmarkBase;
private:
LandmarkBasePtrList landmark_list_;
......@@ -26,8 +28,10 @@ class MapBase : public NodeBase, public std::enable_shared_from_this<MapBase>
MapBase();
~MapBase();
protected:
virtual LandmarkBasePtr addLandmark(LandmarkBasePtr _landmark_ptr);
virtual void addLandmarkList(LandmarkBasePtrList& _landmark_list);
public:
LandmarkBasePtrList& getLandmarkList();
void load(const std::string& _map_file_yaml);
......
......@@ -29,6 +29,9 @@ struct IntrinsicsBase: public ParamsBase
class SensorBase : public NodeBase, public std::enable_shared_from_this<SensorBase>
{
friend Problem;
friend ProcessorBase;
private:
HardwareBaseWPtr hardware_ptr_;
ProcessorBasePtrList processor_list_;
......@@ -95,9 +98,11 @@ class SensorBase : public NodeBase, public std::enable_shared_from_this<SensorBa
virtual void setProblem(ProblemPtr _problem) final;
HardwareBasePtr getHardware();
protected:
void setHardware(const HardwareBasePtr _hw_ptr);
ProcessorBasePtr addProcessor(ProcessorBasePtr _proc_ptr);
public:
ProcessorBasePtrList& getProcessorList();
CaptureBasePtr lastKeyCapture(void);
......
......@@ -20,6 +20,8 @@ namespace wolf {
//class TrajectoryBase
class TrajectoryBase : public NodeBase, public std::enable_shared_from_this<TrajectoryBase>
{
friend FrameBase;
private:
std::list<FrameBasePtr> frame_list_;
......@@ -47,6 +49,10 @@ class TrajectoryBase : public NodeBase, public std::enable_shared_from_this<Traj
void sortFrame(FrameBasePtr _frm_ptr);
void updateLastFrames();
protected:
FrameBasePtr addFrame(FrameBasePtr _frame_ptr);
public:
// factors
void getFactorList(FactorBasePtrList & _fac_list);
......
......@@ -102,16 +102,7 @@ FeatureBasePtr CaptureBase::addFeature(FeatureBasePtr _ft_ptr)
return _ft_ptr;
}
void CaptureBase::addFeatureList(FeatureBasePtrList& _new_ft_list)
{
for (FeatureBasePtr feature_ptr : _new_ft_list)
{
feature_ptr->setCapture(shared_from_this());
if (getProblem() != nullptr)
feature_ptr->setProblem(getProblem());
// feature_list_.push_back(feature_ptr);
}
feature_list_.splice(feature_list_.end(), _new_ft_list);
}
void CaptureBase::getFactorList(FactorBasePtrList& _fac_list)
......
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