sensor_base.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020-2022 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 SENSORS_SENSOR_BASE_HPP
20 #define SENSORS_SENSOR_BASE_HPP
21 
22 #include <ros/ros.h>
23 #include <random>
24 #include <geographiclib_conversions/geodetic_conv.hpp>
25 
26 class BaseSensor{
27  public:
28  BaseSensor() = delete;
29  BaseSensor(ros::NodeHandle* nh, double period): node_handler_(nh), PERIOD(period) {};
30  void enable() {_isEnabled = true;}
31  void disable() {_isEnabled = false;}
32  protected:
34  bool _isEnabled{false};
35  const double PERIOD;
37  double nextPubTimeSec_ = 0;
38 
39  std::default_random_engine randomGenerator_;
40  std::normal_distribution<double> normalDistribution_{std::normal_distribution<double>(0.0, 1.0)};
41 };
42 
43 #endif // SENSORS_SENSOR_BASE_HPP
double nextPubTimeSec_
Definition: sensor_base.hpp:37
void enable()
Definition: sensor_base.hpp:30
BaseSensor(ros::NodeHandle *nh, double period)
Definition: sensor_base.hpp:29
ros::NodeHandle * node_handler_
Definition: sensor_base.hpp:33
void disable()
Definition: sensor_base.hpp:31
BaseSensor()=delete
const double PERIOD
Definition: sensor_base.hpp:35
std::normal_distribution< double > normalDistribution_
Definition: sensor_base.hpp:40
bool _isEnabled
Definition: sensor_base.hpp:34
std::default_random_engine randomGenerator_
Definition: sensor_base.hpp:39
ros::Publisher publisher_
Definition: sensor_base.hpp:36


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