mars_lib 0.1.0.2abe2576fe7f
Modular and Robust Sensor-Fusion
Loading...
Searching...
No Matches
mag_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 MAG_MEASUREMENT_TYPE_H
12#define MAG_MEASUREMENT_TYPE_H
13
15#include <Eigen/Dense>
16#include <utility>
17
18namespace mars
19{
21{
22public:
23 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
24
25 Eigen::Vector3d mag_vector_;
26
27 MagMeasurementType() = default;
28
29 MagMeasurementType(Eigen::Vector3d mag_vector) : mag_vector_(std::move(mag_vector))
30 {
31 }
32
33 static std::string get_csv_state_header_string()
34 {
35 std::stringstream os;
36 os << "t, ";
37 os << "m_x, m_y, m_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 << ", " << mag_vector_.x() << ", " << mag_vector_.y() << ", " << mag_vector_.z();
49
50 return os.str();
51 }
52};
53} // namespace mars
54
55#endif // MAG_MEASUREMENT_TYPE_H
Definition measurement_base_class.h:20
Definition mag_measurement_type.h:21
static std::string get_csv_state_header_string()
Definition mag_measurement_type.h:33
MagMeasurementType(Eigen::Vector3d mag_vector)
Definition mag_measurement_type.h:29
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Eigen::Vector3d mag_vector_
Raw magnetometer measurement [x y z].
Definition mag_measurement_type.h:25
std::string to_csv_string(const double &timestamp) const
Definition mag_measurement_type.h:42
Definition buffer.h:27