123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- //
- // Created by zx on 22-12-2.
- //
- #ifndef LIO_LIVOX_CPP__PANGOLINVIEWER_H_
- #define LIO_LIVOX_CPP__PANGOLINVIEWER_H_
- #include <pangolin/var/var.h>
- #include <pangolin/var/varextra.h>
- #include <pangolin/gl/gl.h>
- #include <pangolin/gl/gldraw.h>
- #include <pangolin/display/display.h>
- #include <pangolin/display/view.h>
- #include <pangolin/display/widgets.h>
- #include <pangolin/display/default_font.h>
- #include <pangolin/handler/handler.h>
- #include "segment/LidarFeatureExtractor.h"
- #include <thread>
- #include "define/typedef.h"
- class PangolinViewer
- {
- public:
- typedef void(*ViewerSpinOnceCallback)(PangolinViewer*);
- typedef void(*StartLocateBtnCallback)(std::string);
- typedef void(*StartBtnCallback)();
- typedef void(*StopBtnCallback)();
- typedef void(*FreqChangedCallback)(int);
- public:
- static PangolinViewer* CreateViewer();
- void SetCallbacks(ViewerSpinOnceCallback spinOnce,StartLocateBtnCallback startBtn,
- StopBtnCallback stopBtn,FreqChangedCallback freqChanged);
- void ShowRealtimePose(Eigen::Matrix4d pose);
- void ShowSlamCost(double cost);
- void ShowSlamQueueTime(int queue,double tm);
- void DrawCloud(PointCloud::Ptr cloud,double r,double g,double b,
- double alpha,double psize);
- void Join();
- ~PangolinViewer();
- private:
- static void loop(PangolinViewer* p);
- PangolinViewer();
- void Init();
- protected:
- static PangolinViewer* viewer_;
- std::thread* thread_;
- pangolin::GlFont *text_font_ ;
- pangolin::OpenGlRenderState* s_cam_;
- pangolin::View *d_cam_ ;
- pangolin::Var<bool>* lvx_checkbox_;
- pangolin::Var<std::string>* lvx_file_;
- pangolin::Var<bool>* start_button_;
- pangolin::Var<bool>* stop_button_;
- pangolin::Var<double>* freq_double_;
- pangolin::Var<std::string>* timequeue_string_;
- pangolin::Var<std::string>* xyz_string_;
- pangolin::Var<std::string>* rpy_string_;
- pangolin::Var<std::string>* cost_string_;
- ViewerSpinOnceCallback spinOnce_callback_=nullptr;
- StartLocateBtnCallback startBtn_callback_=nullptr;
- StopBtnCallback stopBtn_callback_= nullptr;
- FreqChangedCallback freqChanged_callback_= nullptr;
- };
- #endif //LIO_LIVOX_CPP__PANGOLINVIEWER_H_
|