scenarios.cpp
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 #include "scenarios.hpp"
20 
22  _scenarioSub = _node.subscribe("/uav/scenario", 1, &ScenarioManager::scenarioCallback, this);
23 }
24 
25 void ScenarioManager::scenarioCallback(std_msgs::UInt8 msg){
26  Scenario scenarioType = static_cast<Scenario>(msg.data);
27 
28  switch(scenarioType) {
31  break;
34  break;
35 
38  break;
41  break;
42 
44  _actuators._scenarioType = msg.data;
46  break;
48  _actuators._scenarioType = msg.data;
50  break;
51 
54  break;
57  break;
58 
61  break;
64  break;
65 
66  default:
67  break;
68  }
69 }
MagSensor magSensor
Definition: sensors.hpp:49
void enable()
Definition: sensor_base.hpp:30
GpsSensor gpsSensor
Definition: sensors.hpp:48
void start_stall_emulation()
Definition: ice.cpp:93
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
IceStatusSensor iceStatusSensor
Definition: sensors.hpp:45
void disable()
Definition: sensor_base.hpp:31
void scenarioCallback(std_msgs::UInt8 msg)
Definition: scenarios.cpp:25
ros::Subscriber _scenarioSub
Definition: scenarios.hpp:49
Actuators & _actuators
Definition: scenarios.hpp:51
DiffPressureSensor diffPressureSensor
Definition: sensors.hpp:44
PressureSensor pressureSensor
Definition: sensors.hpp:42
uint8_t _scenarioType
Definition: actuators.hpp:41
void stop_stall_emulation()
Definition: ice.cpp:97
Sensors & _sensors
Definition: scenarios.hpp:52
Scenario
Definition: scenarios.hpp:27
ros::NodeHandle & _node
Definition: scenarios.hpp:50


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