diff --git a/svo/CMakeLists.txt b/svo/CMakeLists.txt index 703e379..15257be 100644 --- a/svo/CMakeLists.txt +++ b/svo/CMakeLists.txt @@ -30,6 +30,7 @@ IF(DEBUG_OUTPUT) ENDIF() # Set build flags, set ARM_ARCHITECTURE environment variable on Odroid +# Set build flags. Set IS_ARM on odroid board as environment variable SET(CMAKE_CXX_FLAGS "-Wall -D_LINUX -D_REENTRANT -march=native -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unknown-pragmas") IF(DEFINED ENV{ARM_ARCHITECTURE}) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -march=armv7-a") diff --git a/svo/include/svo/depth_filter.h b/svo/include/svo/depth_filter.h index 7c4ab19..70f6df3 100644 --- a/svo/include/svo/depth_filter.h +++ b/svo/include/svo/depth_filter.h @@ -119,7 +119,7 @@ public: void getSeedsCopy(const FramePtr& frame, std::list& seeds); /// Return a reference to the seeds. This is NOT THREAD SAFE! - std::list >& getSeeds() { return seeds_; } + std::list& 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 > seeds_; + std::list seeds_; boost::mutex seeds_mut_; bool seeds_updating_halt_; //!< Set this value to true when seeds updating should be interrupted. boost::thread* thread_; diff --git a/svo/include/svo/global.h b/svo/include/svo/global.h index 9f7cc97..03aff4e 100644 --- a/svo/include/svo/global.h +++ b/svo/include/svo/global.h @@ -29,6 +29,12 @@ #include #include #include +#include +#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 diff --git a/svo/include/svo/reprojector.h b/svo/include/svo/reprojector.h index 7207b54..e345f0d 100644 --- a/svo/include/svo/reprojector.h +++ b/svo/include/svo/reprojector.h @@ -72,7 +72,7 @@ private: Vector2d px; //!< projected 2D pixel location. Candidate(Point* pt, Vector2d& px) : pt(pt), px(px) {} }; - typedef std::list > Cell; + typedef std::list Cell; typedef std::vector CandidateGrid; /// The grid stores a set of candidate matches. For every grid cell we try to find one match. diff --git a/svo/src/depth_filter.cpp b/svo/src/depth_filter.cpp index bf3a686..db24408 100644 --- a/svo/src/depth_filter.cpp +++ b/svo/src/depth_filter.cpp @@ -135,7 +135,7 @@ void DepthFilter::removeKeyframe(FramePtr frame) { seeds_updating_halt_ = true; lock_t lock(seeds_mut_); - list::iterator it=seeds_.begin(); + std::list::iterator it=seeds_.begin(); size_t n_removed = 0; while(it!=seeds_.end()) { @@ -200,7 +200,7 @@ void DepthFilter::updateSeeds(FramePtr frame) // for all the seeds in every frame! size_t n_updates=0, n_failed_matches=0, n_seeds = seeds_.size(); lock_t lock(seeds_mut_); - list::iterator it=seeds_.begin(); + std::list::iterator it=seeds_.begin(); const double focal_length = frame->cam_->errorMultiplier2(); double px_noise = 1.0; diff --git a/svo/src/frame_handler_mono.cpp b/svo/src/frame_handler_mono.cpp index 3050ba7..4facc51 100644 --- a/svo/src/frame_handler_mono.cpp +++ b/svo/src/frame_handler_mono.cpp @@ -84,7 +84,6 @@ void FrameHandlerMono::addImage(const cv::Mat& img, const double timestamp) // set last frame last_frame_ = new_frame_; new_frame_.reset(); - // finish processing finishFrameProcessingCommon(last_frame_->id_, res, last_frame_->nObs()); } diff --git a/svo/src/initialization.cpp b/svo/src/initialization.cpp index 84b9baf..571a0bc 100644 --- a/svo/src/initialization.cpp +++ b/svo/src/initialization.cpp @@ -177,8 +177,8 @@ void computeHomography( vector& xyz_in_cur, SE3& T_cur_from_ref) { - vector > uv_ref(f_ref.size()); - vector > uv_cur(f_cur.size()); + vector uv_ref(f_ref.size()); + vector uv_cur(f_cur.size()); for(size_t i=0, i_max=f_ref.size(); ipx[0]+3*(*it)->grad[1], (*it)->px[1]-3*(*it)->grad[0]), cv::Point2f((*it)->px[0]-3*(*it)->grad[1], (*it)->px[1]+3*(*it)->grad[0]), cv::Scalar(255,0,255), 2); - else + else//point size 5x5 cv::rectangle(img_rgb, cv::Point2f((*it)->px[0]-2, (*it)->px[1]-2), cv::Point2f((*it)->px[0]+2, (*it)->px[1]+2), cv::Scalar(0,255,0), CV_FILLED); } } - if(img_pub_level_ == 1) + else if(img_pub_level_ == 1){//point size 3x3 for(Features::iterator it=frame->fts_.begin(); it!=frame->fts_.end(); ++it) cv::rectangle(img_rgb, cv::Point2f((*it)->px[0]/scale-1, (*it)->px[1]/scale-1), cv::Point2f((*it)->px[0]/scale+1, (*it)->px[1]/scale+1), cv::Scalar(0,255,0), CV_FILLED); - else - for(Features::iterator it=frame->fts_.begin(); it!=frame->fts_.end(); ++it) - cv::rectangle(img_rgb, - cv::Point2f((*it)->px[0]/scale, (*it)->px[1]/scale), - cv::Point2f((*it)->px[0]/scale, (*it)->px[1]/scale), - cv::Scalar(0,255,0), CV_FILLED); - + }else{ //point size 1x1 + for(Features::iterator it=frame->fts_.begin(); it!=frame->fts_.end(); ++it){ + cv::Vec3b &p= img_rgb.at((*it)->px[1]/scale, (*it)->px[0]/scale); + p[0]=0;p[1]=255;p[2]=0; + } + } cv_bridge::CvImage img_msg; img_msg.header = header_msg; img_msg.image = img_rgb; diff --git a/svo_ros/src/vo_node.cpp b/svo_ros/src/vo_node.cpp index 8a6f88c..c9fbb84 100644 --- a/svo_ros/src/vo_node.cpp +++ b/svo_ros/src/vo_node.cpp @@ -13,7 +13,6 @@ // // You should have received a copy of the GNU General Public License // along with this program. If not, see . - #include #include #include