use EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION and use same CXX_FLAGS for rpg_svo rpg_vikit

This commit is contained in:
akira_you
2017-03-26 07:57:52 +09:00
parent ec240827b1
commit 0e36dabb6f
7 changed files with 40 additions and 30 deletions
+3 -3
View File
@@ -116,10 +116,10 @@ public:
/// Can be used to compute the Next-Best-View in parallel.
/// IMPORTANT! Make sure you hold a valid reference counting pointer to frame
/// so it is not being deleted while you use it.
void getSeedsCopy(const FramePtr& frame, std::list<Seed, aligned_allocator<Seed> >& seeds);
void getSeedsCopy(const FramePtr& frame, std::list<Seed>& seeds);
/// Return a reference to the seeds. This is NOT THREAD SAFE!
std::list<Seed, aligned_allocator<Seed> >& getSeeds() { return seeds_; }
std::list<Seed>& getSeeds() { return seeds_; }
/// Bayes update of the seed, x is the measurement, tau2 the measurement uncertainty
static void updateSeed(
@@ -137,7 +137,7 @@ public:
protected:
feature_detection::DetectorPtr feature_detector_;
callback_t seed_converged_cb_;
std::list<Seed, aligned_allocator<Seed> > seeds_;
std::list<Seed> seeds_;
boost::mutex seeds_mut_;
bool seeds_updating_halt_; //!< Set this value to true when seeds updating should be interrupted.
boost::thread* thread_;
+6 -4
View File
@@ -25,14 +25,16 @@
#include <math.h>
#include <Eigen/Core>
template <class T, class Allocator = Eigen::aligned_allocator<std::pair<const int,T>> >
using vectorA = std::vector< T, Allocator > ;
template <class T, class Allocator = Eigen::aligned_allocator<std::pair<const int,T>> >
using listA = std::list< T, Allocator > ;
#include <opencv2/opencv.hpp>
#include <sophus/se3.h>
#include <vikit/performance_monitor.h>
#include <boost/shared_ptr.hpp>
#include<Eigen/StdVector>
#ifndef RPG_SVO_VIKIT_IS_VECTOR_SPECIALIZED //Guard for rpg_vikit
#define RPG_SVO_VIKIT_IS_VECTOR_SPECIALIZED
EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Vector3d)
EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Vector2d)
#endif
#ifdef SVO_USE_ROS
#include <ros/console.h>
+9 -9
View File
@@ -44,11 +44,11 @@ public:
protected:
vector<cv::Point2f> px_ref_; //!< keypoints to be tracked in reference frame.
vector<cv::Point2f> px_cur_; //!< tracked keypoints in current frame.
vectorA<Vector3d> f_ref_; //!< bearing vectors corresponding to the keypoints in the reference image.
vectorA<Vector3d> f_cur_; //!< bearing vectors corresponding to the keypoints in the current image.
vector<Vector3d> f_ref_; //!< bearing vectors corresponding to the keypoints in the reference image.
vector<Vector3d> f_cur_; //!< bearing vectors corresponding to the keypoints in the current image.
vector<double> disparities_; //!< disparity between first and second frame.
vector<int> inliers_; //!< inliers after the geometric check (e.g., Homography).
vectorA<Vector3d> xyz_in_cur_; //!< 3D points computed during the geometric check.
vector<Vector3d> xyz_in_cur_; //!< 3D points computed during the geometric check.
SE3 T_cur_from_ref_; //!< computed transformation between the first two frames.
};
@@ -56,7 +56,7 @@ protected:
void detectFeatures(
FramePtr frame,
vector<cv::Point2f>& px_vec,
vectorA<Vector3d>& f_vec);
vector<Vector3d>& f_vec);
/// Compute optical flow (Lucas Kanade) for selected keypoints.
void trackKlt(
@@ -64,17 +64,17 @@ void trackKlt(
FramePtr frame_cur,
vector<cv::Point2f>& px_ref,
vector<cv::Point2f>& px_cur,
vectorA<Vector3d>& f_ref,
vectorA<Vector3d>& f_cur,
vector<Vector3d>& f_ref,
vector<Vector3d>& f_cur,
vector<double>& disparities);
void computeHomography(
const vectorA<Vector3d>& f_ref,
const vectorA<Vector3d>& f_cur,
const vector<Vector3d>& f_ref,
const vector<Vector3d>& f_cur,
double focal_length,
double reprojection_threshold,
vector<int>& inliers,
vectorA<Vector3d>& xyz_in_cur,
vector<Vector3d>& xyz_in_cur,
SE3& T_cur_from_ref);
} // namespace initialization