ORB-slam2编译时报错‘usleep’ was not declared in this scope
1 修改下面的文件:
vi include/System.h
2 手动添加“#include <unistd.h>”
#ifndef SYSTEM_H
#define SYSTEM_H
#include<string>
#include<thread>
#include<opencv2/core/core.hpp>
#include "Tracking.h"
#include "FrameDrawer.h"
#include "MapDrawer.h"
#include "Map.h"
#include "LocalMapping.h"
#include "LoopClosing.h"
#include "KeyFrameDatabase.h"
#include "ORBVocabulary.h"
#include "Viewer.h"
#include <unistd.h>//手动添加
namespace ORB_SLAM2
{
class Viewer;
class FrameDrawer;
class Map;
class Tracking;
class LocalMapping;
class LoopClosing;
3 编译成功
[ 62%] Built target ORB_SLAM2
[ 68%] Built target rgbd_tum
[ 75%] Built target mono_euroc
[ 81%] Built target mono_kitti
[ 87%] Built target stereo_euroc
[ 93%] Built target stereo_kitti
[100%] Built target mono_tum