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_IMUHandler.h
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_IMU_HANDLER_H_
18 #define MSF_IMU_HANDLER_H_
19 
21 
22 namespace msf_core {
23 
24 template<typename EKFState_T>
25 class IMUHandler : public SensorHandler<EKFState_T> {
26  protected:
27  shared_ptr<MSF_Core<EKFState_T> > core_;
28  public:
30  const std::string& topic_namespace,
31  const std::string& parameternamespace)
32  : SensorHandler<EKFState_T>(mng, topic_namespace, parameternamespace) {
33  core_ = mng.msf_core_;
34  }
35  virtual ~IMUHandler() {
36  }
37  ;
38  virtual bool initialize() = 0;
39  void process_imu(const msf_core::Vector3& linear_acceleration,
40  const msf_core::Vector3& angular_velocity,
41  const double& msg_stamp, size_t msg_seq) {
42  core_->process_imu(linear_acceleration, angular_velocity, msg_stamp,
43  msg_seq);
44  }
45  void process_state(const msf_core::Vector3& linear_acceleration,
46  const msf_core::Vector3& angular_velocity,
47  const msf_core::Vector3& p, const msf_core::Vector3& v,
48  const msf_core::Quaternion& q, bool is_already_propagated,
49  const double& msg_stamp, size_t msg_seq) {
50  core_->process_extstate(linear_acceleration, angular_velocity, p, v, q,
51  is_already_propagated, msg_stamp, msg_seq);
52  }
53 };
54 }
55 
56 #endif /* MSF_IMU_HANDLER_H_ */