ethzasl-msf - Modular Sensor Fusion
Time delay compensated single and multi sensor fusion framework based on an EKF
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
msf_statedef.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2013 Simon Lynen, ASL, ETH Zurich, Switzerland
3  * You can contact the author at <slynen at ethz dot ch>
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 #ifndef MSF_STATEDEF_HPP_
18 #define MSF_STATEDEF_HPP_
19 
20 #include <Eigen/Dense>
21 #include <msf_core/msf_fwds.h>
22 #include <boost/fusion/container.hpp>
23 namespace msf_updates {
24 /*
25  * This file contains the state definition of the EKF as defined for a given set
26  * of sensors / states to estimate.
27  */
28 enum StateDefinition { //must not manually set the enum values!
29  p,
30  v,
31  q,
32  b_w,
33  b_a,
34  L,
35  q_wv,
36  p_wv,
37  q_ic,
38  p_ic,
39  p_ip
40 };
41 
42 namespace {
43 /***
44  * Setup core state, then auxiliary state.
45  */
46 typedef boost::fusion::vector<
47  // States varying during propagation - must not change the ordering here for
48  // now, CalcQ has the ordering hardcoded.
51  msf_core::StateVar_T<Eigen::Matrix<double, 3, 1>, v,
52  msf_core::CoreStateWithPropagation>,
54  msf_core::CoreStateWithPropagation>,
55  msf_core::StateVar_T<Eigen::Matrix<double, 3, 1>, b_w,
57  msf_core::StateVar_T<Eigen::Matrix<double, 3, 1>, b_a,
58  msf_core::CoreStateWithoutPropagation>,
59 
60  // States not varying during propagation.
62  msf_core::StateVar_T<Eigen::Quaternion<double>, q_wv,
64  msf_core::StateVar_T<Eigen::Matrix<double, 3, 1>, p_wv>,
65  msf_core::StateVar_T<Eigen::Quaternion<double>, q_ic>,
66  msf_core::StateVar_T<Eigen::Matrix<double, 3, 1>, p_ic>,
67  msf_core::StateVar_T<Eigen::Matrix<double, 3, 1>, p_ip>
68 > fullState_T;
69 }
72 typedef shared_ptr<EKFState> EKFStatePtr;
73 typedef shared_ptr<const EKFState> EKFStateConstPtr;
74 }
75 #include <msf_updates/static_ordering_assertions.h> //DO NOT REMOVE THIS
76 #endif /* MSF_STATEDEF_HPP_ */