Apollo  6.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:
25  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
26 
27  public:
30  void Init(const base::Object& object) override;
31  Eigen::VectorXd Predict(const double time_diff) override;
32  Eigen::VectorXd UpdateWithObject(const base::Object& new_object,
33  double time_diff) override;
34  void GetState(Eigen::Vector3d* anchor_point, Eigen::Vector3d* velocity);
35  Eigen::Matrix4d GetCovarianceMatrix() override { return p_matrix_; }
36  static void SetQMatrixRatio(double q_matrix_ratio) {
37  s_q_matrix_ratio_ = q_matrix_ratio;
38  }
39 
40  private:
41  Eigen::Vector3d belief_anchor_point_;
42  Eigen::Vector3d belief_velocity_;
43  Eigen::Vector4d priori_state_;
44  Eigen::Vector4d posteriori_state_;
45  Eigen::Matrix4d p_matrix_;
46  // the state-transition matrix
47  Eigen::Matrix4d a_matrix_;
48  // the observation mode
49  Eigen::Matrix4d c_matrix_;
50  // the covariance of the process noise
51  Eigen::Matrix4d q_matrix_;
52  // the covariance of the observation noise
53  Eigen::Matrix4d r_matrix_;
54  // Optimal Kalman gain
55  Eigen::Matrix4d k_matrix_;
56  static double s_q_matrix_ratio_;
57 };
58 } // namespace radar
59 } // namespace perception
60 } // namespace apollo
void GetState(Eigen::Vector3d *anchor_point, Eigen::Vector3d *velocity)
Eigen::Matrix4d GetCovarianceMatrix() override
Definition: adaptive_kalman_filter.h:35
Definition: base_filter.h:27
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Eigen::Vector3d Vector3d
Definition: frame_transform.h:27
Eigen::Matrix4d Matrix4d
Definition: base_map_fwd.h:32
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:36
Definition: object.h:34
void Init(const base::Object &object) override
Eigen::VectorXd Predict(const double time_diff) override