Skip to content
Snippets Groups Projects
Commit d98e180b authored by Andreu Corominas-Murtra's avatar Andreu Corominas-Murtra Committed by Joan Solà Ortega
Browse files

[WIP] adding typedefs at derived Captures.

parent 913c1ec0
No related branches found
No related tags found
No related merge requests found
......@@ -12,14 +12,15 @@
namespace wolf {
//forward declaration to typedef class pointers
class CaptureFix;
typedef std::shared_ptr<CaptureFix> CaptureFixPtr;
typedef std::shared_ptr<const CaptureFix> CaptureFixConstPtr;
typedef std::weak_ptr<CaptureFix> CaptureFixWPtr;
//class CaptureFix
class CaptureFix : public CaptureBase
{
public:
typedef std::shared_ptr<CaptureFix> Ptr;
typedef std::weak_ptr<CaptureFix> WPtr;
protected:
Eigen::VectorXs data_; ///< Raw data.
Eigen::MatrixXs data_covariance_; ///< Noise of the capture.
......
......@@ -7,24 +7,23 @@
#include "capture_base.h"
namespace wolf {
//forward declaration to typedef class pointers
class CaptureGPS;
typedef std::shared_ptr<CaptureGPS> CaptureGPSPtr;
typedef std::shared_ptr<const CaptureGPS> CaptureGPSConstPtr;
typedef std::weak_ptr<CaptureGPS> CaptureGPSWPtr;
class CaptureGPS : public CaptureBase
{
public:
typedef std::shared_ptr<CaptureGPS> Ptr;
protected:
rawgpsutils::SatellitesObs obs_;
public:
CaptureGPS(const TimeStamp &_ts, SensorBasePtr _sensor_ptr, rawgpsutils::SatellitesObs &_obs);
virtual ~CaptureGPS();
rawgpsutils::SatellitesObs &getData();
protected:
rawgpsutils::SatellitesObs obs_;
public:
CaptureGPS(const TimeStamp &_ts, SensorBasePtr _sensor_ptr, rawgpsutils::SatellitesObs &_obs);
virtual ~CaptureGPS();
rawgpsutils::SatellitesObs &getData();
};
} // namespace wolf
......
......@@ -9,6 +9,12 @@
//
namespace wolf {
//forward declaration to typedef class pointers
class CaptureGPSFix;
typedef std::shared_ptr<CaptureGPSFix> CaptureGPSFixPtr;
typedef std::shared_ptr<const CaptureGPSFix> CaptureGPSFixConstPtr;
typedef std::weak_ptr<CaptureGPSFix> CaptureGPSFixWPtr;
//class CaptureGPSFix
class CaptureGPSFix : public CaptureBase
......@@ -21,9 +27,7 @@ class CaptureGPSFix : public CaptureBase
CaptureGPSFix(const TimeStamp& _ts, SensorBasePtr _sensor_ptr, const Eigen::VectorXs& _data);
CaptureGPSFix(const TimeStamp& _ts, SensorBasePtr _sensor_ptr, const Eigen::VectorXs& _data, const Eigen::MatrixXs& _data_covariance);
virtual ~CaptureGPSFix();
virtual void process();
};
} //namespace wolf
......
......@@ -14,6 +14,12 @@
namespace wolf {
//forward declaration to typedef class pointers
class CaptureImage;
typedef std::shared_ptr<CaptureImage> CaptureImagePtr;
typedef std::shared_ptr<const CaptureImage> CaptureImageConst;
typedef std::weak_ptr<CaptureImage> CaptureImageWPtr;
/**
* \brief class CaptureImage
*
......@@ -22,10 +28,6 @@ namespace wolf {
*/
class CaptureImage : public CaptureBase
{
public:
typedef std::shared_ptr<CaptureImage> Ptr;
typedef std::weak_ptr<CaptureImage> WPtr;
protected:
cv::Mat image_;
cv::Mat descriptors_;
......
......@@ -130,9 +130,9 @@ int main(int argc, char** argv)
// Captures------------------
cv::Mat cv_image;
cv_image.zeros(2,2,0);
CaptureImage::Ptr image_0 = std::make_shared<CaptureImage>(TimeStamp(0), camera, cv_image);
CaptureImage::Ptr image_1 = std::make_shared<CaptureImage>(TimeStamp(1), camera, cv_image);
CaptureImage::Ptr image_2 = std::make_shared<CaptureImage>(TimeStamp(2), camera, cv_image);
CaptureImagePtr image_0 = std::make_shared<CaptureImage>(TimeStamp(0), camera, cv_image);
CaptureImagePtr image_1 = std::make_shared<CaptureImage>(TimeStamp(1), camera, cv_image);
CaptureImagePtr image_2 = std::make_shared<CaptureImage>(TimeStamp(2), camera, cv_image);
kf_2->addCapture(image_0);
kf_3->addCapture(image_1);
kf_4->addCapture(image_2);
......
......@@ -20,7 +20,7 @@ class ProcessorGPS : public ProcessorBase
typedef std::shared_ptr<ProcessorGPS> Ptr;
protected:
CaptureGPS::Ptr capture_gps_ptr_;
CaptureGPSPtr capture_gps_ptr_;
Scalar gps_covariance_;
public:
......
......@@ -75,7 +75,7 @@ TEST(ProcessorMotion, Motion2D)
FrameBasePtr origin_frame = problem_ptr->emplaceFrame(KEY_FRAME, x0, t0);
// Prior covariance
CaptureFix::Ptr initial_covariance = std::make_shared<CaptureFix>(TimeStamp(0), sensor_fix_ptr, x0, init_cov);
CaptureFixPtr initial_covariance = std::make_shared<CaptureFix>(TimeStamp(0), sensor_fix_ptr, x0, init_cov);
origin_frame->addCapture(initial_covariance);
initial_covariance->process();
......
......@@ -218,50 +218,61 @@ class LocalParametrizationBase;
// NodeBase
typedef std::shared_ptr<NodeBase> NodeBasePtr;
typedef std::shared_ptr<const NodeBase> NodeBaseConstPtr;
typedef std::weak_ptr<NodeBase> NodeBaseWPtr;
// Problem
typedef std::shared_ptr<Problem> ProblemPtr;
typedef std::shared_ptr<const Problem> ProblemConstPtr;
typedef std::weak_ptr<Problem> ProblemWPtr;
// Hardware
typedef std::shared_ptr<HardwareBase> HardwareBasePtr;
typedef std::shared_ptr<const HardwareBase> HardwareBaseConstPtr;
typedef std::weak_ptr<HardwareBase> HardwareBaseWPtr;
// - Sensors
typedef std::shared_ptr<SensorBase> SensorBasePtr;
typedef std::shared_ptr<const SensorBase> SensorBaseConstPtr;
typedef std::weak_ptr<SensorBase> SensorBaseWPtr;
typedef std::list<SensorBasePtr> SensorBaseList;
typedef SensorBaseList::iterator SensorBaseIter;
// - - Intrinsics
typedef std::shared_ptr<IntrinsicsBase> IntrinsicsBasePtr;
typedef std::shared_ptr<const IntrinsicsBase> IntrinsicsBaseConstPtr;
// - Processors
typedef std::shared_ptr<ProcessorBase> ProcessorBasePtr;
typedef std::shared_ptr<const ProcessorBase> ProcessorBaseConstPtr;
typedef std::weak_ptr<ProcessorBase> ProcessorBaseWPtr;
typedef std::list<ProcessorBasePtr> ProcessorBaseList;
typedef ProcessorBaseList::iterator ProcessorBaseIter;
// - ProcessorMotion
typedef std::shared_ptr<ProcessorMotion> ProcessorMotionPtr;
typedef std::shared_ptr<const ProcessorMotion> ProcessorMotionConstPtr;
typedef std::weak_ptr<ProcessorMotion> ProcessorMotionWPtr;
// - - Processor params
typedef std::shared_ptr<ProcessorParamsBase> ProcessorParamsBasePtr;
typedef std::shared_ptr<const ProcessorParamsBase> ProcessorParamsBaseConstPtr;
// Trajectory
typedef std::shared_ptr<TrajectoryBase> TrajectoryBasePtr;
typedef std::shared_ptr<const TrajectoryBase> TrajectoryBaseConstPtr;
typedef std::weak_ptr<TrajectoryBase> TrajectoryBaseWPtr;
// - Frame
typedef std::shared_ptr<FrameBase> FrameBasePtr;
typedef std::shared_ptr<const FrameBase> FrameBaseConstPtr;
typedef std::weak_ptr<FrameBase> FrameBaseWPtr;
typedef std::list<FrameBasePtr> FrameBaseList;
typedef FrameBaseList::iterator FrameBaseIter;
// - Capture
typedef std::shared_ptr<CaptureBase> CaptureBasePtr;
typedef std::shared_ptr<const CaptureBase> CaptureBaseConstPtr;
typedef std::weak_ptr<CaptureBase> CaptureBaseWPtr;
typedef std::list<CaptureBasePtr> CaptureBaseList;
typedef CaptureBaseList::iterator CaptureBaseIter;
......@@ -272,30 +283,35 @@ typedef std::weak_ptr<CaptureMotion> CaptureMotionWPtr;
// - Feature
typedef std::shared_ptr<FeatureBase> FeatureBasePtr;
typedef std::shared_ptr<const FeatureBase> FeatureBaseConstPtr;
typedef std::weak_ptr<FeatureBase> FeatureBaseWPtr;
typedef std::list<FeatureBasePtr> FeatureBaseList;
typedef FeatureBaseList::iterator FeatureBaseIter;
// - Constraint
typedef std::shared_ptr<ConstraintBase> ConstraintBasePtr;
typedef std::shared_ptr<const ConstraintBase> ConstraintBaseConstPtr;
typedef std::weak_ptr<ConstraintBase> ConstraintBaseWPtr;
typedef std::list<ConstraintBasePtr> ConstraintBaseList;
typedef ConstraintBaseList::iterator ConstraintBaseIter;
// Map
typedef std::shared_ptr<MapBase> MapBasePtr;
typedef std::shared_ptr<const MapBase> MapBaseConstPtr;
typedef std::weak_ptr<MapBase> MapBaseWPtr;
typedef std::list<MapBasePtr> MapBaseList;
typedef MapBaseList::iterator MapBaseIter;
// - Landmark
typedef std::shared_ptr<LandmarkBase> LandmarkBasePtr;
typedef std::shared_ptr<const LandmarkBase> LandmarkBaseConstPtr;
typedef std::weak_ptr<LandmarkBase> LandmarkBaseWPtr;
typedef std::list<LandmarkBasePtr> LandmarkBaseList;
typedef LandmarkBaseList::iterator LandmarkBaseIter;
// - - State blocks
typedef std::shared_ptr<StateBlock> StateBlockPtr;
typedef std::shared_ptr<const StateBlock> StateBlockConstPtr;
typedef std::weak_ptr<StateBlock> StateBlockWPtr;
typedef std::list<StateBlockPtr> StateBlockList;
typedef StateBlockList::iterator StateBlockIter;
......@@ -303,6 +319,7 @@ typedef std::shared_ptr<StateQuaternion> StateQuaternionPtr;
// - - Local Parametrization
typedef std::shared_ptr<LocalParametrizationBase> LocalParametrizationBasePtr;
typedef std::shared_ptr<const LocalParametrizationBase> LocalParametrizationBaseConstPtr;
// ==================================================
......
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