00001 00004 /***************************************************************************** 00005 ** Ifdefs 00006 *****************************************************************************/ 00007 00008 #ifndef qglv_OBJECTS_ODOMETRY_HPP_ 00009 #define qglv_OBJECTS_ODOMETRY_HPP_ 00010 00011 /***************************************************************************** 00012 ** Includes 00013 *****************************************************************************/ 00014 00015 #include <deque> 00016 #include <memory> 00017 #include <sophus/se3.hpp> 00018 #include <vector> 00019 00020 /***************************************************************************** 00021 ** Namespaces 00022 *****************************************************************************/ 00023 00024 namespace qglv { 00025 00026 /***************************************************************************** 00027 ** Interfaces 00028 *****************************************************************************/ 00029 00030 class Odometry { 00031 public: 00032 Odometry(const Sophus::SE3f& T_extrinsics); 00033 ~Odometry(); 00034 00035 void update(const Sophus::SE3f& T_cam_rel_odom); 00036 void draw(); 00037 void draw(const Sophus::SE3f& T_map_rel_odom); 00038 00039 int gl_id_global, gl_id_window; 00040 std::vector<Sophus::SE3f> global; 00041 std::deque<Sophus::SE3f> window; 00043 private: 00044 Sophus::SE3f T_extrinsics_rotation; // this is rotation part of T_extrinsics (lets us convert camera rotation to align with base, i.e. robot front). 00045 void _glGenLists(); 00046 bool need_to_rebuild_global_list, need_to_rebuild_window_list; 00047 unsigned int size_of_odometry_trail; 00048 }; 00049 00050 /***************************************************************************** 00051 ** Typedefs 00052 *****************************************************************************/ 00053 00054 typedef std::shared_ptr<Odometry> OdometryPtr; 00055 00056 /***************************************************************************** 00057 ** Trailers 00058 *****************************************************************************/ 00059 00060 } // namespace qglv 00061 00062 #endif /* qglv_OBJECTS_ODOMETRY_HPP_ */