18#ifndef GAZEBO_PLUGINS_CESSNAPLUGIN_HH_
19#define GAZEBO_PLUGINS_CESSNAPLUGIN_HH_
25#include <ignition/transport/Node.hh>
82 private:
bool FindJoint(
const std::string &_sdfParam,
92 private:
void OnControl(ConstCessnaPtr &_msg);
96 private:
void UpdatePIDs(
double _dt);
99 private:
void PublishState();
102 private:
static const unsigned int kLeftAileron = 0;
103 private:
static const unsigned int kLeftFlap = 1;
104 private:
static const unsigned int kRightAileron = 2;
105 private:
static const unsigned int kRightFlap = 3;
106 private:
static const unsigned int kElevators = 4;
107 private:
static const unsigned int kRudder = 5;
108 private:
static const unsigned int kPropeller = 6;
126 private: std::array<physics::JointPtr, 7> joints;
129 private: int32_t propellerMaxRpm = 2500;
132 private: std::array<float, 7> cmds;
138 private: std::array<common::PID, 6> controlSurfacesPID;
144 private: std::mutex mutex;
150 private: ignition::transport::Node nodeIgn;
153 private: ignition::transport::Node::Publisher statePubIgn;
default namespace for gazebo
Forward declarations for transport.
Allow moving the control surfaces of a Cessna C-172 plane.
Definition CessnaPlugin.hh:65
CessnaPlugin()
Constructor.
~CessnaPlugin()
Destructor.
virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
Load function.
A plugin with access to physics::Model.
Definition Plugin.hh:304
Generic PID controller class.
Definition PID.hh:37
A Time class, can be used to hold wall- or sim-time.
Definition Time.hh:48
Information for use in an update event.
Definition UpdateInfo.hh:31
boost::shared_ptr< Connection > ConnectionPtr
Definition CommonTypes.hh:134
boost::shared_ptr< Model > ModelPtr
Definition PhysicsTypes.hh:93
boost::shared_ptr< Joint > JointPtr
Definition PhysicsTypes.hh:117
boost::shared_ptr< Subscriber > SubscriberPtr
Definition TransportTypes.hh:53
boost::shared_ptr< Publisher > PublisherPtr
Definition TransportTypes.hh:49
boost::shared_ptr< Node > NodePtr
Definition TransportTypes.hh:57
Forward declarations for the common classes.
Definition Animation.hh:27