chassis_ceres_solver.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // Created by zx on 2021/9/17.
  3. //
  4. #ifndef FIND_CHASSIS__CHASSIS_CERES_SOLVER_H_
  5. #define FIND_CHASSIS__CHASSIS_CERES_SOLVER_H_
  6. #include <ceres/ceres.h>
  7. #include <glog/logging.h>
  8. #include <pcl/point_types.h>
  9. #include <pcl/point_cloud.h>
  10. #include <pcl/common/centroid.h>
  11. #include <opencv2/opencv.hpp>
  12. #include <iostream>
  13. #include <string>
  14. #include <chrono>
  15. #include "../error_code/error_code.h"
  16. class chassis_ceres_solver
  17. {
  18. public:
  19. chassis_ceres_solver();
  20. ~chassis_ceres_solver();
  21. Error_manager solve(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud,double& x,double& z,double& w,double& h);
  22. // 利用图像优化,计算速度提升
  23. Error_manager solve_mat(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud,double& x,double& z,double& w,double& h, bool update_debug_img=false);
  24. // 创建优化地图
  25. static cv::Mat create_mat();
  26. // 返回更新投影地图
  27. cv::Mat get_projected_mat() { return m_projected_mat; }
  28. // 返回投影地图转换的点云, 便于投影到pcl视野中
  29. pcl::PointCloud<pcl::PointXYZ>::Ptr get_projected_cloud();
  30. private:
  31. static cv::Mat m_model;
  32. cv::Mat m_projected_mat;
  33. };
  34. #endif //FIND_CHASSIS__CHASSIS_CERES_SOLVER_H_