CessnaGUIPlugin.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2016 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef _GAZEBO_GUI_CESSNA_PLUGIN_HH_
18 #define _GAZEBO_GUI_CESSNA_PLUGIN_HH_
19 
20 #include <mutex>
21 #include <gazebo/common/Plugin.hh>
22 #include <gazebo/gui/GuiPlugin.hh>
23 #ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829
24 # include <gazebo/transport/transport.hh>
25 # include <gazebo/gui/gui.hh>
26 #endif
27 
28 namespace gazebo
29 {
47  {
48  Q_OBJECT
49 
51  public: CessnaGUIPlugin();
52 
54  public: virtual ~CessnaGUIPlugin();
55 
59  private: void OnState(ConstCessnaPtr &_msg);
60 
62  private slots: void OnIncreaseThrust();
63 
65  private slots: void OnDecreaseThrust();
66 
68  private slots: void OnIncreaseFlaps();
69 
71  private slots: void OnDecreaseFlaps();
72 
74  private slots: void OnIncreaseRoll();
75 
77  private slots: void OnDecreaseRoll();
78 
80  private slots: void OnIncreaseElevators();
81 
83  private slots: void OnDecreaseElevators();
84 
86  private slots: void OnIncreaseRudder();
87 
89  private slots: void OnDecreaseRudder();
90 
92  private slots: void OnPresetTakeOff();
93 
95  private slots: void OnPresetCruise();
96 
98  private slots: void OnPresetLanding();
99 
101  private: sdf::ElementPtr sdf;
102 
104  private: transport::NodePtr gzNode;
105 
107  private: transport::PublisherPtr controlPub;
108 
110  private: transport::SubscriberPtr stateSub;
111 
113  private: math::Angle angleStep;
114 
116  private: msgs::Cessna state;
117 
119  private: std::mutex mutex;
120  };
121 }
122 
123 #endif
A GUI plugin that controls the Cessna model using the keyboard.
Definition: CessnaGUIPlugin.hh:46
A plugin loaded within the gzclient on startup.
Definition: GuiPlugin.hh:26
boost::shared_ptr< Subscriber > SubscriberPtr
Definition: TransportTypes.hh:53
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
An angle and related functions.
Definition: Angle.hh:53
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:59