ceres_scan_matcher_2d.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef SPACE_SCAN_MATCHING_CERES_SCAN_MATCHER_2D_H_
  2. #define SPACE_SCAN_MATCHING_CERES_SCAN_MATCHER_2D_H_
  3. #include <memory>
  4. #include <vector>
  5. #include "Eigen/Core"
  6. #include "ceres/ceres.h"
  7. #include "map/map.h"
  8. #include "common/common.h"
  9. #include "ceres_matcher/occupied_space_cost_function_2d.h"
  10. #include "ceres_matcher/rotation_delta_cost_functor_2d.h"
  11. #include "ceres_matcher/translation_delta_cost_functor_2d.h"
  12. namespace hlzn_slam {
  13. namespace ceres_matching {
  14. // Align scans with an existing map using Ceres.
  15. class CeresScanMatcher2D {
  16. public:
  17. explicit CeresScanMatcher2D(const double& occupied_space_weight, const double& translation_weight,
  18. const double& rotation_weight, const double& self_stab_weight);
  19. virtual ~CeresScanMatcher2D();
  20. CeresScanMatcher2D(const CeresScanMatcher2D&) = delete;
  21. CeresScanMatcher2D& operator=(const CeresScanMatcher2D&) = delete;
  22. // Aligns 'point_cloud' within the 'grid' given an
  23. // 'initial_pose_estimate' and returns a 'pose_estimate' and the solver
  24. // 'summary'.
  25. void Match(const common::Rigid2f& target_pose,
  26. const common::Rigid2f& initial_pose_estimate,
  27. const common::PointCloud& point_cloud,
  28. Map& map,
  29. common::Rigid2f* pose_estimate,
  30. ceres::Solver::Summary* summary) const;
  31. private:
  32. ceres::Solver::Options ceres_solver_options_;
  33. double occupied_space_weight_;
  34. double translation_weight_;
  35. double rotation_weight_;
  36. double self_stab_weight_;
  37. };
  38. } // namespace scan_matching
  39. } // namespace cartographer
  40. #endif // CARTOGRAPHER_MAPPING_INTERNAL_2D_SCAN_MATCHING_CERES_SCAN_MATCHER_2D_H_