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 
68  break;
71  break;
72 
73  default:
74  break;
75  }
76 }
Scenario::GNSS_DISABLE
@ GNSS_DISABLE
ScenarioManager::_sensors
Sensors & _sensors
Definition: scenarios.hpp:55
IceStatusSensor::stop_stall_emulation
void stop_stall_emulation()
Definition: ice.cpp:97
Scenario::BARO_DISABLE
@ BARO_DISABLE
Scenario::MAG_ENABLE
@ MAG_ENABLE
ScenarioManager::init
void init()
Definition: scenarios.cpp:21
Sensors::escStatusSensor
EscStatusSensor escStatusSensor
Definition: sensors.hpp:52
Scenario::ICE_STOP_STALL_EMULATION
@ ICE_STOP_STALL_EMULATION
Scenario::ICE_START_STALL_EMULATION
@ ICE_START_STALL_EMULATION
Scenario::GNSS_ENABLE
@ GNSS_ENABLE
IceStatusSensor::start_stall_emulation
void start_stall_emulation()
Definition: ice.cpp:93
ScenarioManager::_scenarioSub
ros::Subscriber _scenarioSub
Definition: scenarios.hpp:52
Sensors::magSensor
MagSensor magSensor
Definition: sensors.hpp:50
Scenario::ESC_FEEDBACK_ENABLE
@ ESC_FEEDBACK_ENABLE
ScenarioManager::scenarioCallback
void scenarioCallback(std_msgs::UInt8 msg)
Definition: scenarios.cpp:25
Actuators::_scenarioType
uint8_t _scenarioType
Definition: actuators.hpp:41
Sensors::iceStatusSensor
IceStatusSensor iceStatusSensor
Definition: sensors.hpp:46
Sensors::gpsSensor
GpsSensor gpsSensor
Definition: sensors.hpp:49
Scenario::DIFFERENTIAL_PRESSURE_DISABLE
@ DIFFERENTIAL_PRESSURE_DISABLE
ScenarioManager::_actuators
Actuators & _actuators
Definition: scenarios.hpp:54
Scenario::BARO_ENABLE
@ BARO_ENABLE
Sensors::diffPressureSensor
DiffPressureSensor diffPressureSensor
Definition: sensors.hpp:45
ros::NodeHandle::subscribe
Subscriber subscribe(const std::string &topic, uint32_t queue_size, const boost::function< void(C)> &callback, const VoidConstPtr &tracked_object=VoidConstPtr(), const TransportHints &transport_hints=TransportHints())
BaseSensor::enable
void enable()
Definition: sensor_base.hpp:29
scenarios.hpp
BaseSensor::disable
void disable()
Definition: sensor_base.hpp:30
Scenario::ESC_FEEDBACK_DISABLE
@ ESC_FEEDBACK_DISABLE
Scenario
Scenario
Definition: scenarios.hpp:27
ScenarioManager::_node
ros::NodeHandle & _node
Definition: scenarios.hpp:53
Sensors::pressureSensor
PressureSensor pressureSensor
Definition: sensors.hpp:43
Scenario::MAG_DISABLE
@ MAG_DISABLE
Scenario::DIFFERENTIAL_PRESSURE_ENABLE
@ DIFFERENTIAL_PRESSURE_ENABLE


inno_vtol_dynamics
Author(s): Roman Fedorenko, Dmitry Ponomarev, Ezra Tal, Winter Guerra
autogenerated on Mon Dec 9 2024 03:13:35