mars_lib  0.1.0.3dc76ee85e09
Modular and Robust Sensor-Fusion
bodyvel_measurement_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 BODYVELMEASUREMENTTYPE_H
14 #define BODYVELMEASUREMENTTYPE_H
15 
17 #include <Eigen/Dense>
18 #include <utility>
19 
20 namespace mars
21 {
23 {
24 public:
25  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
26 
27  Eigen::Vector3d velocity_;
28 
30 
31  BodyvelMeasurementType(Eigen::Vector3d velocity) : velocity_(std::move(velocity))
32  {
33  }
34 
35  static std::string get_csv_state_header_string()
36  {
37  std::stringstream os;
38  os << "t, ";
39  os << "v_x, v_y, v_z";
40 
41  return os.str();
42  }
43 
44  std::string to_csv_string(const double& timestamp) const
45  {
46  std::stringstream os;
47  os.precision(17);
48  os << timestamp;
49 
50  os << ", " << velocity_.x() << ", " << velocity_.y() << ", " << velocity_.z();
51 
52  return os.str();
53  }
54 };
55 } // namespace mars
56 #endif // BODYVELMEASUREMENTTYPE_H
Definition: measurement_base_class.h:20
Definition: bodyvel_measurement_type.h:23
static std::string get_csv_state_header_string()
Definition: bodyvel_measurement_type.h:35
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Eigen::Vector3d velocity_
Velocity [x y z].
Definition: bodyvel_measurement_type.h:27
std::string to_csv_string(const double &timestamp) const
Definition: bodyvel_measurement_type.h:44
BodyvelMeasurementType(Eigen::Vector3d velocity)
Definition: bodyvel_measurement_type.h:31
Definition: buffer.h:27