AndreiBarsan / DynSLAM

Master's Thesis on Simultaneous Localization and Mapping in dynamic environments. Separately reconstructs both the static environment and the dynamic objects from it, such as cars.
BSD 3-Clause "New" or "Revised" License
576 stars 179 forks source link

compile issue #33

Closed rnunziata closed 6 years ago

rnunziata commented 7 years ago

I was getting the following bug

Track.cpp:73:30: error: ‘setw’ was not declared in this scope

but fixed it by adding the line at the top of the file.

include

Now it fails with following errors....not sure what to do?

/home/rjn/opencv3-p3-code/classification_and_boxing/newstuff/DynSLAM/src/DynSLAM/InstRecLib/VisoSparseSFProvider.cpp: In function ‘Eigen::Matrix4d instreclib::VisoToEigen(const Matrix&)’:
/home/rjn/opencv3-p3-code/classification_and_boxing/newstuff/DynSLAM/src/DynSLAM/InstRecLib/VisoSparseSFProvider.cpp:9:28: error: passing ‘const Matrix’ as ‘this’ argument discards qualifiers [-fpermissive]
   return Eigen::Matrix4d((~viso_matrix).val[0]);
                            ^
In file included from /home/rjn/opencv3-p3-code/classification_and_boxing/newstuff/DynSLAM/src/DynSLAM/InstRecLib/../../libviso2/src/matcher.h:34:0,
                 from /home/rjn/opencv3-p3-code/classification_and_boxing/newstuff/DynSLAM/src/DynSLAM/InstRecLib/SparseSFProvider.h:7,
                 from /home/rjn/opencv3-p3-code/classification_and_boxing/newstuff/DynSLAM/src/DynSLAM/InstRecLib/VisoSparseSFProvider.h:7,
                 from /home/rjn/opencv3-p3-code/classification_and_boxing/newstuff/DynSLAM/src/DynSLAM/InstRecLib/VisoSparseSFProvider.cpp:3:
/home/rjn/opencv3-p3-code/classification_and_boxing/newstuff/DynSLAM/src/DynSLAM/InstRecLib/../../libviso2/src/matrix.h:106:11: note:   in call to ‘Matrix Matrix::operator~()’
   Matrix  operator~ ();                // transpose
           ^
[ 30%] Building CXX object src/DynSLAM/InstRecLib/CMakeFiles/InstRecLib.dir/PrecomputedSegmentationProvider.cpp.o
src/DynSLAM/InstRecLib/CMakeFiles/InstRecLib.dir/build.make:158: recipe for target 'src/DynSLAM/InstRecLib/CMakeFiles/InstRecLib.dir/VisoSparseSFProvider.cpp.o' failed
make[2]: *** [src/DynSLAM/InstRecLib/CMakeFiles/InstRecLib.dir/VisoSparseSFProvider.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/rjn/opencv3-p3-code/classification_and_boxing/newstuff/DynSLAM/src/DynSLAM/InstRecLib/PrecomputedSegmentationProvider.cpp: In member function ‘virtual std::shared_ptr<instreclib::segmentation::InstanceSegmentationResult> instreclib::segmentation::PrecomputedSegmentationProvider::SegmentFrame(const Mat3b&)’:
/home/rjn/opencv3-p3-code/classification_and_boxing/newstuff/DynSLAM/src/DynSLAM/InstRecLib/PrecomputedSegmentationProvider.cpp:173:25: error: ‘imread’ is not a member of ‘cv’
   cv::Mat seg_preview = cv::imread(img_fpath);
                         ^
/home/rjn/opencv3-p3-code/classification_and_boxing/newstuff/DynSLAM/src/DynSLAM/InstRecLib/PrecomputedSegmentationProvider.cpp:174:3: error: ‘resize’ is not a member of ‘cv’
   cv::resize(seg_preview, *last_seg_preview_, cv::Size(), 1.0 / input_scale_, 1.0 / input_scale_, cv::INTER_LINEAR);
   ^
/home/rjn/opencv3-p3-code/classification_and_boxing/newstuff/DynSLAM/src/DynSLAM/InstRecLib/PrecomputedSegmentationProvider.cpp:174:99: error: ‘INTER_LINEAR’ is not a member of ‘cv’
AndreiBarsan commented 7 years ago

Do you have OpenCV installed on your system? (If so, perhaps there's some sort of version clash. I will have to double check which exact version is needed.)

Otherwise, maybe try adding #include <opencv/cv.h> to the problematic file(s).

Apologies for the vague responses, it's just that I temporarily do not have access to a system with an nVIDIA GPU and CUDA so that I can test these things.

rnunziata commented 7 years ago

I have installed opencv 3.3, however I think I can get around this...its the Eigen error that I am not sure what to do about.

AndreiBarsan commented 6 years ago

Hmm, so the return Eigen::Matrix4d((~viso_matrix).val[0]); is causing an error? Again, I can't try out any changes right now (really sorry!), but can you try making a (non-const) copy of viso_matrix, transposing it (using the ~ operator), and using val[0] to construct an Eigen matrix?

rnunziata commented 6 years ago

Eigen::Matrix4d VisoToEigen(const Matrix &viso_matrix) { // The '~' transposes the matrix... Matrix a=viso_matrix; return Eigen::Matrix4d((~a).val[0]); }

got pass with this mod....

rnunziata commented 6 years ago

closed see above fix