Apollo 10.0
自动驾驶开放平台
localization_integ_process.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
17#pragma once
18
19#include <queue>
20#include <string>
21
22#include "Eigen/Core"
23#include "Eigen/Geometry"
24#include "cyber/cyber.h"
25
26#include "localization_msf/sins.h"
29#include "modules/common_msgs/localization_msgs/localization.pb.h"
30
35namespace apollo {
36namespace localization {
37namespace msf {
38
39enum class IntegState { NOT_INIT = 0, NOT_STABLE, OK, VALID };
40
48 public:
49 typedef Eigen::Affine3d TransformD;
50
53
54 // Initialization.
56
57 // Raw Imu process.
58 void RawImuProcess(const ImuData &imu_msg);
59 void GetState(IntegState *state);
60 void GetResult(IntegState *state, LocalizationEstimate *localization);
61 void GetResult(IntegState *state, InsPva *sins_pva,
62 double pva_covariance[9][9]);
63 void GetCorrectedImu(ImuData *imu_data);
64 void GetEarthParameter(InertialParameter *earth_param);
65
66 // itegration measure data process
67 void MeasureDataProcess(const MeasureData &measure_msg);
68
69 private:
70 bool CheckIntegMeasureData(const MeasureData &measure_data);
71
72 bool LoadGnssAntennaExtrinsic(const std::string &file_path,
73 TransformD *extrinsic) const;
74
75 void MeasureDataProcessImpl(const MeasureData &measure_msg);
76 void MeasureDataThreadLoop();
77 void StartThreadLoop();
78 void StopThreadLoop();
79
80 void GetValidFromOK();
81
82 private:
83 Sins *sins_;
84
85 // config
86 TransformD gnss_antenna_extrinsic_;
87
88 // double imu_rate_;
89
90 IntegState integ_state_;
91 InsPva ins_pva_;
92 double pva_covariance_[9][9];
93
94 ImuData corrected_imu_;
95 InertialParameter earth_param_;
96
97 std::atomic<bool> keep_running_;
98 std::queue<MeasureData> measure_data_queue_;
99 int measure_data_queue_size_ = 150;
100 std::mutex measure_data_queue_mutex_;
101
102 int delay_output_counter_ = 0;
103
104 public:
105 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
106};
107
108} // namespace msf
109} // namespace localization
110} // namespace apollo
A general class to denote the return status of an API call.
Definition status.h:43
apollo::common::Status Init(const LocalizationIntegParam &params)
void GetResult(IntegState *state, LocalizationEstimate *localization)
The class of LocalizationIntegParam
class register implement
Definition arena_queue.h:37