# How does the rotor create downforce in gazebo when it is modeled as a cylinder?

A rotor creates, because of its shape and the airflow resulting from this shape.

Now I’m trying to understand how the gazebo simulation works and how precisely the flying dynamics are modeled. During this process I was looking into the `iris.sdf` file within the `Tools/sitl_gazebo/models/iris` directory. This file models the collision of the rotors like this:

``````<collision name='rotor_0_collision'>
<pose>0 0 0 0 0 0</pose>
<geometry>
<cylinder>
<length>0.005</length>
</cylinder>
</geometry>
<surface>
<contact>
<ode/>
</contact>
<friction>
<ode/>
</friction>
</surface>
</collision>
``````

As far as I understand this, the actual physical collision model is just a cylinder and just the appearance is “rotor-shaped”. So how is the downforce created, when the rotor is spinning? Can anyone help me understand this?

what you are looking at is the collision geometry. The collision geometry is not related to the rotor thrust, but related in calculating collisions between objects. e.g. the rotor collision geometry you are looking at will be used in calculating the collision with the ground or other objects.

The model is defined as an `sdf` file, which follows the sdf specifications. If you are curious on the format, you can look at the sdf format specification.

If you are curious how the rotor thrust is generated, this is done by a gazebo plugin implementation, which is defined here

If you are not sure how the gazebo plugin works, you can look at a tutorial here

1 Like

@Jaeyoung-Lim Thanks a lot for your clarifications. I had thought that the collision model also defines, how the rotor “collides” with the air and thus creates thrust…

However, I have digged a little bit into the gazebo plugin that you mentioned and I am still didn’t figure it out entirely. Specifically I would like to know how the simulated Autopilot sends the desired motor speeds to the gazebo plugin.

In the sdf-file of the rotor plugin that you linked, I can see that the motor speeds shall be published on the gazebo topic `<motorSpeedCommandPubTopic>/gazebo/command/motor_speed</motorSpeedCommandPubTopic>`. In the source code of the `gazebo_mavlink_interface` this topic is also advertised in line 385:
`motor_velocity_reference_pub_ = node_handle_->Advertise<mav_msgs::msgs::CommandMotorSpeed>("~/" + model_->GetName() + motor_velocity_reference_pub_topic_, 1);`
The thing, I can’t find/understand is when and where the PX4 Autopilot publishes messages to this topic. Can you provide some details on how this works?