This tutorial gives an overview of the physical phenomena of lift and drag and how they are implemented in Gazebo in the LiftDragPlugin. After this tutorial, you will be able to simulate aerodynamic robots.

Physics background

Fluid mechanics

Fluid mechanics is the study of the forces on or due to liquids and gases. Solving fluid mechanics problems is complex, and a truly faithful simulation of fluid mechanics would be computationally prohibitive. Thus, Gazebo simulates the forces on an object immersed in a fluid and applies the forces to the object's links directly. In particular, the phenomena of lift and drag are instrumental to underwater and aerodynamic vehicles.


Lift is the force on a body due to fluid flowing past the body in the component perpendicular to the flow direction.


Drag forces are the forces on a body due to fluid flowing past the body that acts opposite to the object's motion.

Angle of attack and alpha slope

Angle of attack, AOA, or alpha, is the angle between the direction of motion of the body and the reference plane. The reference plane is usually horizontal (perpendicular to gravity).

When modeling aerodynamics, we must consider the relationship between angle of attack and coefficient of lift for a body:

The alpha-lift curve for an object is often determined experimentally.

Drag coefficient has a similar relationship with alpha, though note that the alpha/lift coefficient and alpha/drag coefficient curves are not necessarily the same for a given body.


The critical angle of attack is the angle at which the alpha-lift curve reaches its maximum. Stall is defined as the period after the critical angle of attack, when lift coefficient decreases as a function of angle of attack.

Using the LiftDragPlugin

The LiftDragPlugin makes an important assumption about the relationship between angle of attack (or alpha) and lift coefficient. Instead of a smooth curve, the alpha/lift coefficient curve is simplified as two lines.

The same assumption is made about the relationship between angle of attack and drag coefficient.

Note in this example, the airfoil has non-zero camber, and has a net positive lift at zero angle of attack. To obtain equivalent representation using the current Gazebo LiftDragPlugin plugin parameters, shift the entire curve to the right such that the zero lift point corresponds to zero angle of attack. And we can label the original zero angle of attack location as a0 in the shifted curve, i.e. a0 is 5 degrees. Also shift the stall angle accordingly, i.e. alpha_stall is now 19.2 degrees.

Here is an example plugin that implements the lift coefficient values and stall angles from figure above,

      <plugin name="lifting_surface" filename="">

        <!-- taken from the lift curve figure -->
        <!-- alpha_0 is 5 degrees -->
        <!-- alpha_stall is 19.3 degrees -->
        <!-- slope of the lift curve to the left of the stall angle -->
        <!-- slope of the lift curve to the right of the stall angle -->

        <!-- below are just random values in this example -->
        <forward>-1 0 0</forward>
        <upward>0 -1 0</upward>
        <cp>0 0 1</cp>

Further, the airfoil coordinate system is defined by graph below:

Note without simulating induced drag, the airfoil forward direction indicates the intended forward flight direction of the airfoil parallel to the chord line, and the upward direction is the direction perpendicular to the forward direction towards the lifting direction corresponding to positive angle of attack. By convention, Drag is opposite of the inertial velocity of the body, and lift is perpendicular to drag direction towards positive angle of attack. The reference plane is spanned by the <forward> vector and the spanwise direction vector (where spanwise direction = <forward> cross <upward>).

Lastly, the center of pressure is defined as an offset in the parent link frame. This is where the free stream velocity is measured, as well as where the computed lift, drag forces and moments are applied. See plot below:

Input parameters

The following parameters are used by the LiftDragPlugin.

  • link_name: Name of the link affected by the group of lift/drag properties.
  • air_density: Density of the fluid this model is suspended in.
  • area: Surface area of the link.
  • a0: The initial "alpha" or initial angle of attack. a0 is also the y-intercept of the alpha-lift coefficient curve.
  • cla: The ratio of the coefficient of lift and alpha slope before stall. Slope of the first portion of the alpha-lift coefficient curve.
  • cda: The ratio of the coefficient of drag and alpha slope before stall.
  • cp: Center of pressure. The forces due to lift and drag will be applied here.
  • forward: 3-vector representing the forward direction of motion in the link frame.
  • upward: 3-vector representing the direction of lift or drag.
  • alpha_stall: Angle of attack at stall point; the peak angle of attack.
  • cla_stall: The ratio of coefficient of lift and alpha slope after stall. Slope of the second portion of the alpha-lift coefficient curve.
  • cda_stall: The ratio of coefficient of drag and alpha slope after stall.

Fixed wing model

Open the environment with Gazebo:

gazebo --verbose worlds/

This world contains a model of the Cessna C-172 with three different plugin types:

  • CessnaPlugin: This model plugin exposes the topic ~/cessna_c172/control for controlling the thrust and control surfaces via Gazebo messages. It also publishes the state of the model into the topic ~/cessna_c172/state. Please, read the documentation included in the header file of this plugin for a detailed explanation of its required and optional parameters. Here is the plugin block included in our
  <!-- A plugin for controlling the thrust and control surfaces -->
  <plugin name="cessna_control" filename="">
  • CessnaGUIPlugin: This GUI plugin publishes Cessna messages to modify the angle of the control surfaces and the thrust power. Next you can find the available Cessna control keys:
  w         Increase thrust (+10 %)
  s         Decrease thrust (-10 %)
  d         Increase rudder angle (+1 degree)
  a         Decrease rudder angle (-1 degree)
  Left-Key  Left roll (+1 degree)
  Right-Key Right roll (+1 degree)
  Up-Key    Pitch down (+1 degree)
  Down-Key  Pitch up (+1 degree)
  1         Preset for take-off
  2         Preset for cruise
  3         Preset for landing
  • LiftDragPlugin: We are using this plugin in some of the plane elements to generate lift and drag. The propeller will generate thrust according to its angular speed. The control surfaces will generate different forces according to their specific angles and speed. The LiftDragPlugin aerodynamic parameters were approximated using values from jsbsim for Cessna 172P.

Open a new terminal and execute the following command to visualize the state of the Cessna:

gz topic -e /gazebo/default/cessna_c172/state

In the Gazebo window, right click on the model and press Follow. The user camera will follow the plane during the flight and you will not lose it.

Press '1' to start the preset for take-off. The propeller should start spinning and the model should gain speed along the landing strip.

Use the Down-arrow key to pitch up and take-off. Try to balance the plane on the air with the arrow keys.

You can explore all the different control combinations detailed before while you are flying.