Apollo 11.0
自动驾驶开放平台
information_filter.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#pragma once
17
19
20namespace apollo {
21namespace perception {
22namespace fusion {
23
25 public:
27 ~InformationFilter() = default;
28
37 bool Init(const Eigen::VectorXd &global_states,
38 const Eigen::MatrixXd &global_uncertainty);
39
40 // @brief: Set the obervation of the last moment(imf use
41 // the latest two moment of the observation which
42 // from the same source to correct the prediction.
43 // @parmas[IN] last_observation: the observation of the last moment
44 // @params[IN] last_observation_uncertainty: the uncertainty of the
45 // observation of the last moment
46 // @params[IN] last_to_cur_transform_matrix: regard last observatopn
47 // as a state and apply a motion model(the transform
48 // matrix) to predict current state of the last observation.
49 // @params[IN] last_to_cur_env_uncertainty: the uncertainty brought
50 // by the environment when predict the current state of
51 // last observation.
52 bool SetLastObservation(const Eigen::VectorXd &last_observation,
53 const Eigen::MatrixXd &last_observation_uncertainty,
54 const Eigen::MatrixXd &last_to_cur_transform_matrix,
55 const Eigen::MatrixXd &last_to_cur_env_uncertainty);
56
57 // @brief predict the current state and uncertainty of system
58 // @params[IN] transform_matrix: transform the state from the
59 // pre moment to current moment.
60 // @params[IN] env_uncertainty_matrix: the uncertainty brought by
61 // the environment when predict system state.
62 bool Predict(const Eigen::MatrixXd &transform_matrix,
63 const Eigen::MatrixXd &env_uncertainty_matrix);
64
65 // @brief Use the current observation to correct the prediction.
66 // @params[IN] cur_observation: the observation in current moment.
67 // @params[IN] cur_observation_uncertainty: the uncertainty of
68 // the current observation
69 bool Correct(const Eigen::VectorXd &current_observation,
70 const Eigen::MatrixXd &current_observation_uncertainty);
71
72 // @brief get the system state
73 Eigen::VectorXd GetStates() const { return global_states_; }
74
75 // @brief get the number of the system states
76 inline int GetStateNums() const { return states_num_; }
77
78 // @brief set the control matrix
79 bool SetControlMatrix(const Eigen::MatrixXd &control_matrix);
80
81 protected:
82 // @brief whether the observation of last moment has been set
84
85 // @brief the observation of the last moment
86 Eigen::VectorXd last_observation_;
87
88 // @brief the uncertainty of the last moment observation
90
91 // @brief a temporary var for compute conveniece
92 Eigen::VectorXd tmp_states_;
93
94 // @brief motion model to predict the current state of the
95 // last observation
97
98 // @brife uncertainty when predict the current state of the
99 // last observation
101};
102
103} // namespace fusion
104} // namespace perception
105} // namespace apollo
bool SetControlMatrix(const Eigen::MatrixXd &control_matrix)
bool SetLastObservation(const Eigen::VectorXd &last_observation, const Eigen::MatrixXd &last_observation_uncertainty, const Eigen::MatrixXd &last_to_cur_transform_matrix, const Eigen::MatrixXd &last_to_cur_env_uncertainty)
bool Init(const Eigen::VectorXd &global_states, const Eigen::MatrixXd &global_uncertainty)
bool Predict(const Eigen::MatrixXd &transform_matrix, const Eigen::MatrixXd &env_uncertainty_matrix)
bool Correct(const Eigen::VectorXd &current_observation, const Eigen::MatrixXd &current_observation_uncertainty)
class register implement
Definition arena_queue.h:37