logger.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023 RaccoonLab.
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, version 3.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Author: Dmitry Ponomarev <ponomarevda96@gmail.com>
17  */
18 
19 #ifndef UAV_DYNAMICS_LOGER_HPP
20 #define UAV_DYNAMICS_LOGER_HPP
21 
22 #include "actuators.hpp"
23 #include "sensors.hpp"
24 #include "dynamics.hpp"
25 
26 struct StateLogger {
27  StateLogger(Actuators& actuators, Sensors& sensors, DynamicsInfo& info) :
28  _actuators(actuators), _sensors(sensors), _info(info) {}
29  void init(double clockScale, double dt_secs);
30  void createStringStream(std::stringstream& logStream,
31  const Eigen::Vector3d& pose,
32  double dynamicsCounter,
33  double rosPubCounter,
34  double periodSec);
35 
36 private:
37  static void colorize(std::stringstream& logStream, bool is_ok, const std::string& newData);
38  static void addBold(std::stringstream& logStream, const char* newData);
39 
43 
44  double _clockScale;
45  double _dt_secs;
46 };
47 
48 #endif // UAV_DYNAMICS_LOGER_HPP
Actuators & _actuators
Definition: logger.hpp:40
double _clockScale
Definition: logger.hpp:44
Sensors & _sensors
Definition: logger.hpp:41
DynamicsInfo & _info
Definition: logger.hpp:42
StateLogger(Actuators &actuators, Sensors &sensors, DynamicsInfo &info)
Definition: logger.hpp:27
double _dt_secs
Definition: logger.hpp:45
static void colorize(std::stringstream &logStream, bool is_ok, const std::string &newData)
Definition: logger.cpp:94
void init(double clockScale, double dt_secs)
Definition: logger.cpp:33
void createStringStream(std::stringstream &logStream, const Eigen::Vector3d &pose, double dynamicsCounter, double rosPubCounter, double periodSec)
Definition: logger.cpp:38
static void addBold(std::stringstream &logStream, const char *newData)
Definition: logger.cpp:102


inno_vtol_dynamics
Author(s): Roman Fedorenko, Dmitry Ponomarev, Ezra Tal, Winter Guerra
autogenerated on Sat Jul 1 2023 02:13:44