mars_lib  0.1.0.3dc76ee85e09
Modular and Robust Sensor-Fusion
pose_sensor_state_type.h
Go to the documentation of this file.
1 // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria.
2 //
3 // All rights reserved.
4 //
5 // This software is licensed under the terms of the BSD-2-Clause-License with
6 // no commercial use allowed, the full terms of which are made available
7 // in the LICENSE file. No license in patents is granted.
8 //
9 // You can contact the author at <christian.brommer@ieee.org>
10 
11 #ifndef POSESENSORSTATETYPE_H
12 #define POSESENSORSTATETYPE_H
13 
15 #include <Eigen/Dense>
16 
17 namespace mars
18 {
20 {
21 public:
22  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
23 
24  Eigen::Vector3d p_ip_;
25  Eigen::Quaternion<double> q_ip_;
26 
27  PoseSensorStateType() : BaseStates(6) // size of covariance
28  {
29  p_ip_.setZero();
30  q_ip_.setIdentity();
31  }
32 
33  static std::string get_csv_state_header_string()
34  {
35  std::stringstream os;
36  os << "t, ";
37  os << "p_ip_x, p_ip_y, p_ip_z, ";
38  os << "q_ip_w, q_ip_x, q_ip_y, q_ip_z";
39 
40  return os.str();
41  }
42 
43  std::string to_csv_string(const double& timestamp) const
44  {
45  std::stringstream os;
46  os.precision(17);
47  os << timestamp;
48 
49  os << ", " << p_ip_(0) << ", " << p_ip_(1) << ", " << p_ip_(2);
50 
51  Eigen::Vector4d q_ip = q_ip_.coeffs(); // x y z w
52  os << ", " << q_ip(3) << ", " << q_ip(0) << ", " << q_ip(1) << ", " << q_ip(2);
53 
54  return os.str();
55  }
56 };
57 } // namespace mars
58 #endif // POSESENSORSTATETYPE_H
The BaseStates class is used to ensure that all sensor data classes define a covariance size for the ...
Definition: base_states.h:23
Definition: pose_sensor_state_type.h:20
std::string to_csv_string(const double &timestamp) const
Definition: pose_sensor_state_type.h:43
Eigen::Quaternion< double > q_ip_
Definition: pose_sensor_state_type.h:25
PoseSensorStateType()
Definition: pose_sensor_state_type.h:27
static std::string get_csv_state_header_string()
Definition: pose_sensor_state_type.h:33
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Eigen::Vector3d p_ip_
Definition: pose_sensor_state_type.h:24
Definition: buffer.h:27