#include <gazebo_fw_dynamics_plugin.h>
Public Member Functions | |
GazeboFwDynamicsPlugin () | |
Constructor. More... | |
virtual | ~GazeboFwDynamicsPlugin () |
Destructor. More... | |
Protected Member Functions | |
void | Load (physics::ModelPtr _model, sdf::ElementPtr _sdf) |
Called when the plugin is first created, and after the world has been loaded. This function should not be blocking. More... | |
double | NormalizedInputToAngle (const ControlSurface &surface, double input) |
Convert control surface input that is normalized in range [-1, 1] to a physical deflection angle value. More... | |
void | OnUpdate (const common::UpdateInfo &) |
This gets called by the world update start event. More... | |
void | UpdateForcesAndMoments () |
Calculates the forces and moments to be applied to the fixed-wing body. More... | |
Private Member Functions | |
void | ActuatorsCallback (GzActuatorsMsgPtr &actuators_msg) |
Processes the actuator commands. More... | |
void | CreatePubsAndSubs () |
Creates all required publishers and subscribers, incl. routing of messages to/from ROS if required. More... | |
void | RollPitchYawrateThrustCallback (GzRollPitchYawrateThrustMsgPtr &roll_pitch_yawrate_thrust_msg) |
Process the roll_pitch_yawrate_thrust commands. More... | |
void | WindSpeedCallback (GzWindSpeedMsgPtr &wind_speed_msg) |
Processes the wind speed readings. More... | |
Private Attributes | |
gazebo::transport::SubscriberPtr | actuators_sub_ |
Subscriber for receiving actuator commands. More... | |
std::string | actuators_sub_topic_ |
Topic name for actuator commands. More... | |
FWAerodynamicParameters | aero_params_ |
The aerodynamic properties of the aircraft. More... | |
double | delta_aileron_left_ |
Left aileron deflection [rad]. More... | |
double | delta_aileron_right_ |
Right aileron deflection [rad]. More... | |
double | delta_elevator_ |
Elevator deflection [rad]. More... | |
double | delta_flap_ |
Flap deflection [rad]. More... | |
double | delta_rudder_ |
Rudder deflection [rad]. More... | |
bool | is_input_joystick_ |
Are the input commands coming from a joystick (as opposed to a remote control via HIL interface, for example)? More... | |
physics::LinkPtr | link_ |
Pointer to the link. More... | |
physics::ModelPtr | model_ |
Pointer to the model. More... | |
std::string | namespace_ |
Transport namespace. More... | |
transport::NodePtr | node_handle_ |
Handle for the Gazebo node. More... | |
bool | pubs_and_subs_created_ |
Flag that is set to true once CreatePubsAndSubs() is called, used to prevent CreatePubsAndSubs() from be called on every OnUpdate(). More... | |
gazebo::transport::SubscriberPtr | roll_pitch_yawrate_thrust_sub_ |
Subscriber for receiving roll_pitch_yawrate_thrust commands. More... | |
std::string | roll_pitch_yawrate_thrust_sub_topic_ |
Topic name for roll_pitch_yawrate_thrust commands. More... | |
double | throttle_ |
Throttle input, in range from 0 to 1. More... | |
event::ConnectionPtr | updateConnection_ |
Pointer to the update event connection. More... | |
FWVehicleParameters | vehicle_params_ |
The physical properties of the aircraft. More... | |
ignition::math::Vector3d | W_wind_speed_W_B_ |
Most current wind speed reading [m/s]. More... | |
gazebo::transport::SubscriberPtr | wind_speed_sub_ |
Subscriber ror receiving wind speed readings. More... | |
std::string | wind_speed_sub_topic_ |
Topic name for wind speed readings. More... | |
physics::WorldPtr | world_ |
Pointer to the world. More... | |
Definition at line 50 of file gazebo_fw_dynamics_plugin.h.
gazebo::GazeboFwDynamicsPlugin::GazeboFwDynamicsPlugin | ( | ) |
Constructor.
Definition at line 24 of file gazebo_fw_dynamics_plugin.cpp.
|
virtual |
Destructor.
Definition at line 37 of file gazebo_fw_dynamics_plugin.cpp.
|
private |
Processes the actuator commands.
Converts control surface actuator inputs into physical angles before storing them and throttle values for later use in calculation of forces and moments.
Definition at line 358 of file gazebo_fw_dynamics_plugin.cpp.
|
private |
Creates all required publishers and subscribers, incl. routing of messages to/from ROS if required.
Call this once the first time OnUpdate() is called (can't be called from Load() because there is no guarantee GazeboRosInterfacePlugin has loaded and listening to ConnectGazeboToRosTopic and ConnectRosToGazeboTopic messages).
Definition at line 290 of file gazebo_fw_dynamics_plugin.cpp.
|
protected |
Called when the plugin is first created, and after the world has been loaded. This function should not be blocking.
Definition at line 40 of file gazebo_fw_dynamics_plugin.cpp.
|
protected |
Convert control surface input that is normalized in range [-1, 1] to a physical deflection angle value.
Definition at line 284 of file gazebo_fw_dynamics_plugin.cpp.
|
protected |
This gets called by the world update start event.
Definition at line 123 of file gazebo_fw_dynamics_plugin.cpp.
|
private |
Process the roll_pitch_yawrate_thrust commands.
Converts the inputs into physical angles before storing them and thrust values for later use in calculation of forces and moments.
Definition at line 378 of file gazebo_fw_dynamics_plugin.cpp.
|
protected |
Calculates the forces and moments to be applied to the fixed-wing body.
Definition at line 136 of file gazebo_fw_dynamics_plugin.cpp.
|
private |
Processes the wind speed readings.
Stores the most current wind speed reading for later use in calculation of forces and moments.
Definition at line 396 of file gazebo_fw_dynamics_plugin.cpp.
|
private |
Subscriber for receiving actuator commands.
Definition at line 105 of file gazebo_fw_dynamics_plugin.h.
|
private |
Topic name for actuator commands.
Definition at line 95 of file gazebo_fw_dynamics_plugin.h.
|
private |
The aerodynamic properties of the aircraft.
Definition at line 124 of file gazebo_fw_dynamics_plugin.h.
|
private |
Left aileron deflection [rad].
Definition at line 130 of file gazebo_fw_dynamics_plugin.h.
|
private |
Right aileron deflection [rad].
Definition at line 132 of file gazebo_fw_dynamics_plugin.h.
|
private |
Elevator deflection [rad].
Definition at line 134 of file gazebo_fw_dynamics_plugin.h.
|
private |
Flap deflection [rad].
Definition at line 136 of file gazebo_fw_dynamics_plugin.h.
|
private |
Rudder deflection [rad].
Definition at line 138 of file gazebo_fw_dynamics_plugin.h.
|
private |
Are the input commands coming from a joystick (as opposed to a remote control via HIL interface, for example)?
Definition at line 77 of file gazebo_fw_dynamics_plugin.h.
|
private |
Pointer to the link.
Definition at line 116 of file gazebo_fw_dynamics_plugin.h.
|
private |
Pointer to the model.
Definition at line 114 of file gazebo_fw_dynamics_plugin.h.
|
private |
Transport namespace.
Definition at line 93 of file gazebo_fw_dynamics_plugin.h.
|
private |
Handle for the Gazebo node.
Definition at line 102 of file gazebo_fw_dynamics_plugin.h.
|
private |
Flag that is set to true once CreatePubsAndSubs() is called, used to prevent CreatePubsAndSubs() from be called on every OnUpdate().
Definition at line 82 of file gazebo_fw_dynamics_plugin.h.
|
private |
Subscriber for receiving roll_pitch_yawrate_thrust commands.
Definition at line 107 of file gazebo_fw_dynamics_plugin.h.
|
private |
Topic name for roll_pitch_yawrate_thrust commands.
Definition at line 97 of file gazebo_fw_dynamics_plugin.h.
|
private |
Throttle input, in range from 0 to 1.
Definition at line 140 of file gazebo_fw_dynamics_plugin.h.
|
private |
Pointer to the update event connection.
Definition at line 118 of file gazebo_fw_dynamics_plugin.h.
|
private |
The physical properties of the aircraft.
Definition at line 127 of file gazebo_fw_dynamics_plugin.h.
|
private |
Most current wind speed reading [m/s].
Definition at line 121 of file gazebo_fw_dynamics_plugin.h.
|
private |
Subscriber ror receiving wind speed readings.
Definition at line 109 of file gazebo_fw_dynamics_plugin.h.
|
private |
Topic name for wind speed readings.
Definition at line 99 of file gazebo_fw_dynamics_plugin.h.
|
private |
Pointer to the world.
Definition at line 112 of file gazebo_fw_dynamics_plugin.h.