mars_lib  0.1.0.3dc76ee85e09
Modular and Robust Sensor-Fusion
position_measurement_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 POSITIONMEASUREMENTTYPE_H
12 #define POSITIONMEASUREMENTTYPE_H
13 
15 #include <Eigen/Dense>
16 #include <utility>
17 
18 namespace mars
19 {
21 {
22 public:
23  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
24 
25  Eigen::Vector3d position_;
26 
27  PositionMeasurementType(Eigen::Vector3d position) : position_(std::move(position))
28  {
29  }
30 
31  static std::string get_csv_state_header_string()
32  {
33  std::stringstream os;
34  os << "t, ";
35  os << "p_x, p_y, p_z";
36 
37  return os.str();
38  }
39 
40  std::string to_csv_string(const double& timestamp) const
41  {
42  std::stringstream os;
43  os.precision(17);
44  os << timestamp;
45 
46  os << ", " << position_.x() << ", " << position_.y() << ", " << position_.z();
47 
48  return os.str();
49  }
50 };
51 } // namespace mars
52 #endif // POSITIONMEASUREMENTTYPE_H
Definition: measurement_base_class.h:20
Definition: position_measurement_type.h:21
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Eigen::Vector3d position_
Position [x y z].
Definition: position_measurement_type.h:25
PositionMeasurementType(Eigen::Vector3d position)
Definition: position_measurement_type.h:27
static std::string get_csv_state_header_string()
Definition: position_measurement_type.h:31
std::string to_csv_string(const double &timestamp) const
Definition: position_measurement_type.h:40
Definition: buffer.h:27