mars_lib  0.1.0.3dc76ee85e09
Modular and Robust Sensor-Fusion
velocity_measurement_type.h
Go to the documentation of this file.
1 // Copyright (C) 2024 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 author at <christian.brommer@ieee.org>
11 
12 #ifndef VELOCITYMEASUREMENTTYPE_H
13 #define VELOCITYMEASUREMENTTYPE_H
14 
16 #include <Eigen/Dense>
17 #include <utility>
18 
19 namespace mars
20 {
22 {
23 public:
24  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
25 
26  Eigen::Vector3d velocity_;
27 
29 
30  VelocityMeasurementType(Eigen::Vector3d velocity) : velocity_(std::move(velocity))
31  {
32  }
33 
34  static std::string get_csv_state_header_string()
35  {
36  std::stringstream os;
37  os << "t, ";
38  os << "v_x, v_y, v_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 << ", " << velocity_.x() << ", " << velocity_.y() << ", " << velocity_.z();
50 
51  return os.str();
52  }
53 };
54 } // namespace mars
55 #endif // VELOCITYMEASUREMENTTYPE_H
Definition: measurement_base_class.h:20
Definition: velocity_measurement_type.h:22
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Eigen::Vector3d velocity_
Velocity [x y z].
Definition: velocity_measurement_type.h:26
VelocityMeasurementType(Eigen::Vector3d velocity)
Definition: velocity_measurement_type.h:30
static std::string get_csv_state_header_string()
Definition: velocity_measurement_type.h:34
std::string to_csv_string(const double &timestamp) const
Definition: velocity_measurement_type.h:43
Definition: buffer.h:27