MapDrawer.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /**
  2. * This file is part of ORB-SLAM3
  3. *
  4. * Copyright (C) 2017-2020 Carlos Campos, Richard Elvira, Juan J. Gómez Rodríguez, José M.M. Montiel and Juan D. Tardós, University of Zaragoza.
  5. * Copyright (C) 2014-2016 Raúl Mur-Artal, José M.M. Montiel and Juan D. Tardós, University of Zaragoza.
  6. *
  7. * ORB-SLAM3 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
  8. * License as published by the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * ORB-SLAM3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
  12. * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along with ORB-SLAM3.
  16. * If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef MAPDRAWER_H
  19. #define MAPDRAWER_H
  20. #include"Atlas.h"
  21. #include"MapPoint.h"
  22. #include"KeyFrame.h"
  23. #include<pangolin/pangolin.h>
  24. #include<mutex>
  25. namespace ORB_SLAM3
  26. {
  27. class MapDrawer
  28. {
  29. public:
  30. MapDrawer(Atlas* pAtlas, const string &strSettingPath);
  31. Atlas* mpAtlas;
  32. void DrawMapPoints();
  33. void DrawKeyFrames(const bool bDrawKF, const bool bDrawGraph, const bool bDrawInertialGraph);
  34. void DrawCurrentCamera(pangolin::OpenGlMatrix &Twc);
  35. void SetCurrentCameraPose(const cv::Mat &Tcw);
  36. void SetReferenceKeyFrame(KeyFrame *pKF);
  37. void GetCurrentOpenGLCameraMatrix(pangolin::OpenGlMatrix &M, pangolin::OpenGlMatrix &MOw);
  38. void GetCurrentOpenGLCameraMatrix(pangolin::OpenGlMatrix &M, pangolin::OpenGlMatrix &MOw, pangolin::OpenGlMatrix &MTwwp);
  39. private:
  40. bool ParseViewerParamFile(cv::FileStorage &fSettings);
  41. float mKeyFrameSize;
  42. float mKeyFrameLineWidth;
  43. float mGraphLineWidth;
  44. float mPointSize;
  45. float mCameraSize;
  46. float mCameraLineWidth;
  47. cv::Mat mCameraPose;
  48. std::mutex mMutexCamera;
  49. float mfFrameColors[6][3] = {{0.0f, 0.0f, 1.0f},
  50. {0.8f, 0.4f, 1.0f},
  51. {1.0f, 0.2f, 0.4f},
  52. {0.6f, 0.0f, 1.0f},
  53. {1.0f, 1.0f, 0.0f},
  54. {0.0f, 1.0f, 1.0f}};
  55. };
  56. } //namespace ORB_SLAM
  57. #endif // MAPDRAWER_H