Apollo  v5.5.0
Open source self driving car software
adaptive_kalman_filter.h
Go to the documentation of this file.
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 #pragma once
17 
19 
20 namespace apollo {
21 namespace perception {
22 namespace radar {
24  public:
27  void Init(const base::Object& object) override;
28  Eigen::VectorXd Predict(const double time_diff) override;
29  Eigen::VectorXd UpdateWithObject(const base::Object& new_object,
30  double time_diff) override;
31  void GetState(Eigen::Vector3d* anchor_point, Eigen::Vector3d* velocity);
32  Eigen::Matrix4d GetCovarianceMatrix() override { return p_matrix_; }
33  static void SetQMatrixRatio(double q_matrix_ratio) {
34  s_q_matrix_ratio_ = q_matrix_ratio;
35  }
36 
37  private:
38  Eigen::Vector3d belief_anchor_point_;
39  Eigen::Vector3d belief_velocity_;
40  Eigen::Vector4d priori_state_;
41  Eigen::Vector4d posteriori_state_;
42  Eigen::Matrix4d p_matrix_;
43  // the state-transition matrix
44  Eigen::Matrix4d a_matrix_;
45  // the observation mode
46  Eigen::Matrix4d c_matrix_;
47  // the covariance of the process noise
48  Eigen::Matrix4d q_matrix_;
49  // the covariance of the observation noise
50  Eigen::Matrix4d r_matrix_;
51  // Optimal Kalman gain
52  Eigen::Matrix4d k_matrix_;
53  static double s_q_matrix_ratio_;
54 };
55 } // namespace radar
56 } // namespace perception
57 } // namespace apollo
void GetState(Eigen::Vector3d *anchor_point, Eigen::Vector3d *velocity)
Eigen::Matrix4d GetCovarianceMatrix() override
Definition: adaptive_kalman_filter.h:32
Definition: base_filter.h:27
Definition: blob.h:72
Definition: adaptive_kalman_filter.h:23
Eigen::VectorXd UpdateWithObject(const base::Object &new_object, double time_diff) override
static void SetQMatrixRatio(double q_matrix_ratio)
Definition: adaptive_kalman_filter.h:33
Definition: object.h:34
void Init(const base::Object &object) override
Eigen::VectorXd Predict(const double time_diff) override