ORB_SLAM2
ORB_SLAM2 copied to clipboard
Fix many errors: ‘usleep’ was not declared
There are many compile time errors. This PR fixes these errors.
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc: In member function ‘void ORB_SLAM2::LoopClosing::Run()’:
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc:84:9: error: ‘usleep’ was not declared in this scope
usleep(5000);
^~~~~~
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc:84:9: note: suggested alternative: ‘fseek’
usleep(5000);
^~~~~~
fseek
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc: In member function ‘void ORB_SLAM2::LoopClosing::CorrectLoop()’:
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc:416:20: warning: use of an operand of type ‘bool’ in ‘operator++’ is deprecated [-Wdeprecated]
mnFullBAIdx++;
^~
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc:428:9: error: ‘usleep’ was not declared in this scope
usleep(1000);
^~~~~~
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc:428:9: note: suggested alternative: ‘fseek’
usleep(1000);
^~~~~~
fseek
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc: In member function ‘void ORB_SLAM2::LoopClosing::RequestReset()’:
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc:630:9: error: ‘usleep’ was not declared in this scope
usleep(5000);
^~~~~~
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc:630:9: note: suggested alternative: ‘fseek’
usleep(5000);
^~~~~~
fseek
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc: In member function ‘void ORB_SLAM2::LoopClosing::RunGlobalBundleAdjustment(long unsigned int)’:
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc:670:17: error: ‘usleep’ was not declared in this scope
usleep(1000);
^~~~~~
/home/booil/linspace/orbslam/ORB_SLAM2/src/LoopClosing.cc:670:17: note: suggested alternative: ‘fseek’
usleep(1000);
^~~~~~
fseek
/home/booil/linspace/orbslam/ORB_SLAM2/src/Tracking.cc: In member function ‘void ORB_SLAM2::Tracking::Reset()’:
/home/booil/linspace/orbslam/ORB_SLAM2/src/Tracking.cc:1512:13: error: ‘usleep’ was not declared in this scope
usleep(3000);
^~~~~~
/home/booil/linspace/orbslam/ORB_SLAM2/src/Tracking.cc:1512:13: note: suggested alternative: ‘fseek’
usleep(3000);
^~~~~~
fseek
add #include <unistd.h> #include <stdio.h> #include <stdlib.h> in "system.h"
Same problem on Ubuntu 18.04 and @linuxsen 's fix worked for me! ( "System.h", not "system.h")