##

CessnaGUIPlugin.hh
Go to the documentation of this file.
/*
* Copyright (C) 2015 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_PLUGINS_CESSNAGUIPLUGIN_HH_
#define GAZEBO_PLUGINS_CESSNAGUIPLUGIN_HH_
#include <mutex>
#include <ignition/math/Angle.hh>
#include <gazebo/common/Plugin.hh>
#include <gazebo/gui/GuiPlugin.hh>
// moc parsing error of tbb headers
#ifndef Q_MOC_RUN
#include <gazebo/transport/transport.hh>
#endif
namespace gazebo
{
class GAZEBO_VISIBLE CessnaGUIPlugin : public GUIPlugin
{
Q_OBJECT
public: CessnaGUIPlugin();
public: virtual ~CessnaGUIPlugin();
private: void OnState(ConstCessnaPtr &_msg);
private slots: void OnIncreaseThrust();
private slots: void OnDecreaseThrust();
private slots: void OnIncreaseFlaps();
private slots: void OnDecreaseFlaps();
private slots: void OnIncreaseRoll();
private slots: void OnDecreaseRoll();
private slots: void OnIncreaseElevators();
private slots: void OnDecreaseElevators();
private slots: void OnIncreaseRudder();
private slots: void OnDecreaseRudder();
private slots: void OnPresetTakeOff();
private slots: void OnPresetCruise();
private slots: void OnPresetLanding();
private: sdf::ElementPtr sdf;
private: transport::NodePtr gzNode;
private: transport::PublisherPtr controlPub;
private: transport::SubscriberPtr stateSub;
private: ignition::math::Angle angleStep;
private: msgs::Cessna state;
private: std::mutex mutex;
};
}
#endif
gazebo::GUIPlugin
A plugin loaded within the gzclient on startup.
Definition: GuiPlugin.hh:26
gazebo::CessnaGUIPlugin
A GUI plugin that controls the Cessna model using the keyboard.
Definition: CessnaGUIPlugin.hh:49
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::transport::PublisherPtr
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
gazebo::transport::SubscriberPtr
boost::shared_ptr< Subscriber > SubscriberPtr
Definition: TransportTypes.hh:53
gazebo::transport::NodePtr
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
GuiPlugin.hh
Plugin.hh
GAZEBO_VISIBLE
#define GAZEBO_VISIBLE
Definition: system.hh:59