mars_lib  0.1.0.3dc76ee85e09
Modular and Robust Sensor-Fusion
attitude_sensor_state_type.h
Go to the documentation of this file.
1 // Copyright (C) 2021 Martin Scheiber and Christian Brommer, Control of Networked Systems, University of Klagenfurt,
2 // Austria.
3 //
4 // All rights reserved.
5 //
6 // This software is licensed under the terms of the BSD-2-Clause-License with
7 // no commercial use allowed, the full terms of which are made available
8 // in the LICENSE file. No license in patents is granted.
9 //
10 // You can contact the authors at <martin.scheiber@ieee.org>
11 // and <christian.brommer@ieee.org>.
12 
13 #ifndef ATTITUDE_SENSOR_STATE_TYPE_H
14 #define ATTITUDE_SENSOR_STATE_TYPE_H
15 
17 #include <Eigen/Dense>
18 
19 namespace mars
20 {
22 {
23 public:
24  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
25 
26  Eigen::Quaternion<double> q_aw_; // calibration between world and attitude reference frame
27  Eigen::Quaternion<double> q_ib_; // calibration between IMU and attitude sensor
28 
29  AttitudeSensorStateType() : BaseStates(6) // BaseStates(6) // cov size
30  {
31  q_aw_.setIdentity();
32  q_ib_.setIdentity();
33  }
34 
35  static std::string get_csv_state_header_string()
36  {
37  std::stringstream os;
38  os << "t, ";
39  os << "q_aw_w, q_aw_x, q_aw_y, q_aw_z";
40  os << "q_ib_w, q_ib_x, q_ib_y, q_ib_z";
41 
42  return os.str();
43  }
44 
45  std::string to_csv_string(const double& timestamp) const
46  {
47  std::stringstream os;
48  os.precision(17);
49  os << timestamp;
50 
51  os << ", " << q_aw_.w() << ", " << q_aw_.x() << ", " << q_aw_.y() << ", " << q_aw_.z();
52  os << ", " << q_ib_.w() << ", " << q_ib_.x() << ", " << q_ib_.y() << ", " << q_ib_.z();
53 
54  return os.str();
55  }
56 };
57 } // namespace mars
58 #endif // ATTITUDE_SENSOR_STATE_TYPE_H
Definition: attitude_sensor_state_type.h:22
AttitudeSensorStateType()
Definition: attitude_sensor_state_type.h:29
std::string to_csv_string(const double &timestamp) const
Definition: attitude_sensor_state_type.h:45
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Eigen::Quaternion< double > q_aw_
Definition: attitude_sensor_state_type.h:26
Eigen::Quaternion< double > q_ib_
Definition: attitude_sensor_state_type.h:27
static std::string get_csv_state_header_string()
Definition: attitude_sensor_state_type.h:35
The BaseStates class is used to ensure that all sensor data classes define a covariance size for the ...
Definition: base_states.h:23
Definition: buffer.h:27