21#include "modules/map/tools/map_datachecker/proto/collection_error_code.pb.h"
36 explicit Alignment(std::shared_ptr<JsonConf> sp_conf)
64 virtual bool IsGoodPose(
const std::vector<FramePose>& poses,
int pose_index) {
65 if (pose_index <= 0 || pose_index >=
static_cast<int>(poses.size())) {
66 AINFO <<
"params error. poses size:" << poses.size()
67 <<
",pose_index:" << pose_index;
71 unsigned int position_type = poses[pose_index].position_type;
72 float diff_age = poses[pose_index].diff_age;
73 double local_std = poses[pose_index].local_std;
75 if (
sp_conf_->position_type_range.find(position_type) !=
76 sp_conf_->position_type_range.end() &&
77 diff_age >=
sp_conf_->diff_age_range.first &&
78 diff_age <= sp_conf_->diff_age_range.second &&
79 local_std <= sp_conf_->local_std_upper_limit) {
89 std::shared_ptr<BadOrGoodPoseInfo> sp_pose_info) {
90 if (sp_pose_info ==
nullptr) {
91 AERROR <<
"sp_pose_info is nullptr";
109 if (sp_pose_info ==
nullptr) {
110 AERROR <<
"sp_pose_info is nullptr";
119 int TimeToIndex(
const std::vector<FramePose>& poses,
double time) {
120 size_t size = poses.size();
121 if (size == 0 || time <= 0) {
125 for (
size_t i = 0; i < size; ++i) {
126 if (poses[i].time_stamp >= time) {
127 return static_cast<int>(i);
130 return static_cast<int>(size);
void ClearPoseInfo(std::shared_ptr< BadOrGoodPoseInfo > sp_pose_info)
virtual double GetProgress() const
virtual void SetStartTime(double start_time)
virtual ErrorCode Process(const std::vector< FramePose > &poses)=0
Alignment(std::shared_ptr< JsonConf > sp_conf)
std::shared_ptr< JsonConf > sp_conf_
virtual void ClearGoodPoseInfo()
virtual void ClearBadPoseInfo()
virtual void UpdateBadPoseInfo(const FramePose &pose)
int TimeToIndex(const std::vector< FramePose > &poses, double time)
virtual bool IsGoodPose(const std::vector< FramePose > &poses, int pose_index)
void UpdatePoseInfo(const FramePose &pose, std::shared_ptr< BadOrGoodPoseInfo > sp_pose_info)
std::shared_ptr< BadOrGoodPoseInfo > sp_good_pose_info_
ErrorCode GetReturnState() const
std::shared_ptr< BadOrGoodPoseInfo > sp_bad_pose_info_
virtual void UpdateGoodPoseInfo(const FramePose &pose)
virtual void SetEndTime(double end_time)