mars_lib  0.1.0.3dc76ee85e09
Modular and Robust Sensor-Fusion
gps_w_vel_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 GPSVELMEASUREMENTTYPE_H
12 #define GPSVELMEASUREMENTTYPE_H
13 
16 #include <Eigen/Dense>
17 
18 namespace mars
19 {
21 {
22 public:
24  Eigen::Vector3d velocity_;
25 
26  GpsVelMeasurementType(double latitude, double longitude, double altitude, double vel_x, double vel_y, double vel_z)
27  : coordinates_(std::move(latitude), std::move(longitude), std::move(altitude))
28  , velocity_(std::move(vel_x), std::move(vel_y), std::move(vel_z))
29  {
30  }
31 
32  static std::string get_csv_state_header_string()
33  {
34  std::stringstream os;
35  os << "t, ";
36  os << "lat, lon, alt, ";
37  os << "vel_x, vel_y, vel_z";
38 
39  return os.str();
40  }
41 
42  std::string to_csv_string(const double& timestamp) const
43  {
44  std::stringstream os;
45  os.precision(17);
46  os << timestamp;
47 
48  os << ", " << coordinates_.latitude_ << ", " << coordinates_.longitude_ << ", " << coordinates_.altitude_;
49  os << ", " << velocity_.x() << ", " << velocity_.y() << ", " << velocity_.z();
50 
51  return os.str();
52  }
53 };
54 } // namespace mars
55 #endif // GPSVELMEASUREMENTTYPE_H
Definition: measurement_base_class.h:20
Definition: gps_w_vel_measurement_type.h:21
static std::string get_csv_state_header_string()
Definition: gps_w_vel_measurement_type.h:32
GpsCoordinates coordinates_
Definition: gps_w_vel_measurement_type.h:23
std::string to_csv_string(const double &timestamp) const
Definition: gps_w_vel_measurement_type.h:42
GpsVelMeasurementType(double latitude, double longitude, double altitude, double vel_x, double vel_y, double vel_z)
Definition: gps_w_vel_measurement_type.h:26
Eigen::Vector3d velocity_
Definition: gps_w_vel_measurement_type.h:24
Definition: buffer.h:27
The GpsCoordinates struct.
Definition: gps_conversion.h:22
double longitude_
Definition: gps_conversion.h:29
double altitude_
Definition: gps_conversion.h:30
double latitude_
Definition: gps_conversion.h:28