# T200 simulation in gazebo

**URL:** <https://discuss.bluerobotics.com/t/t200-simulation-in-gazebo/798>\
**Category:** General Discussion\
**Tags:** sitl, simulate\
**Created:** [March 1, 2017, 11:50am UTC](https://discuss.bluerobotics.com/t/t200-simulation-in-gazebo/798 "2017-03-01T11:50:34Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakkala-kalvik](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jakkala-kalvik](https://discuss.bluerobotics.com/u/jakkala-kalvik)\
**Post date:** [March 1, 2017, 11:50am UTC](https://discuss.bluerobotics.com/t/t200-simulation-in-gazebo/798/1 "2017-03-01T11:50:34Z")

</div>

Hello I am trying to simulate a rover with T200 thrusters in gazebo but I am not sure what parameters for the LiftDragPlugin. Did anyone try simulating the thrusters in gazebo?

---

<div class="post-metadata">

**Author:** ![rjehangir](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/rjehangir/32/671_2.png) [@rjehangir](https://discuss.bluerobotics.com/u/rjehangir)\
**Post date:** [March 1, 2017, 7:58pm UTC](https://discuss.bluerobotics.com/t/t200-simulation-in-gazebo/798/2 "2017-03-01T19:58:07Z")

</div>

Hi Jakkala,

As far as I know, nobody has simulated the ROV in Gazebo yet. Can you give us an idea of what type of parameters you need for the LiftDragPlugin. We might be able to get some approximations that will work for you.

-Rusty

---

<div class="post-metadata">

**Author:** ![jakkala-kalvik](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jakkala-kalvik](https://discuss.bluerobotics.com/u/jakkala-kalvik)\
**Post date:** [March 1, 2017, 9:42pm UTC](https://discuss.bluerobotics.com/t/t200-simulation-in-gazebo/798/3 "2017-03-01T21:42:37Z")

</div>

> **[Gazebo : Tutorial : Aerodynamics](https://classic.gazebosim.org/tutorials?tut=aerodynamics&cat=plugins)**
>
> The Gazebo robot simulation

The link above has detailed explanation of the parameters.It says the plugin is for aerodynamics but It is even used to simulate thrust from a propeller for under water simulations.

link is the propeller  
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.  
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.

---

<div class="post-metadata">

**Author:** ![rjehangir](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/rjehangir/32/671_2.png) [@rjehangir](https://discuss.bluerobotics.com/u/rjehangir)\
**Post date:** [March 2, 2017, 5:57pm UTC](https://discuss.bluerobotics.com/t/t200-simulation-in-gazebo/798/4 "2017-03-02T17:57:42Z")

</div>

Hi Jakkala,

These parameters are clearly meant for an airplane. Are there any plugins that allow for more generic drag and force inputs? Perhaps something for a helicopter or spacecraft?

-Rusty

---

<div class="post-metadata">

**Author:** ![jakkala-kalvik](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jakkala-kalvik](https://discuss.bluerobotics.com/u/jakkala-kalvik)\
**Post date:** [March 3, 2017, 1:17am UTC](https://discuss.bluerobotics.com/t/t200-simulation-in-gazebo/798/5 "2017-03-03T01:17:46Z")

</div>

Not really its the only plugin to simulate drag in gazebo.

---

<div class="post-metadata">

**Author:** ![rjehangir](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/rjehangir/32/671_2.png) [@rjehangir](https://discuss.bluerobotics.com/u/rjehangir)\
**Post date:** [March 3, 2017, 5:02pm UTC](https://discuss.bluerobotics.com/t/t200-simulation-in-gazebo/798/6 "2017-03-03T17:02:39Z")

</div>

Jakkala,

Okay, I’m doing a bit of research and it doesn’t really look like there is an appropriate physics plugin for anything other than an aircraft. They do have a [hydrodynamics tutorial](http://gazebosim.org/tutorials?tut=hydrodynamics&cat=plugins) but it is for an AUV that has pretty similar characteristics to an airplane.

I’m afraid I can’t help you much more than that. I’ve never used Gazebo.

-Rusty

---

<div class="post-metadata">

**Author:** ![jakkala-kalvik](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jakkala-kalvik](https://discuss.bluerobotics.com/u/jakkala-kalvik)\
**Post date:** [March 3, 2017, 6:00pm UTC](https://discuss.bluerobotics.com/t/t200-simulation-in-gazebo/798/7 "2017-03-03T18:00:48Z")

</div>

The hydrodynamics plugin is used to simulate the buoyancy of the object it has nothing to do with drag and the aerodynamics plugin. And to calculate drag on a propeller atleast for planes each blade is considered as a flat box at a certain angle. So I think for the propellers of the T200 we have to consider each blade as a flat box and figure out the angle which had the most impact on thrust I am guessing that will be the angle near the center of the blade. I took a look at the iris drone’s parameters and they used the following settings

```
  <a0>0.3</a0>
  <alpha_stall>1.4</alpha_stall>
  <cla>4.2500</cla>
  <cda>0.10</cda>
  <cma>0.00</cma>
  <cla_stall>-0.025</cla_stall>
  <cda_stall>0.0</cda_stall>
  <cma_stall>0.0</cma_stall>
  <area>0.002</area>
  <air_density>1.2041</air_density>
  <cp>-0.084 0 0</cp>
  <forward>0 1 0</forward>
  <upward>0 0 1</upward>

```

So in our case the air density will be the same. water density is 1000 and for some reason they are using water density for the drone so I guess we can do the same. And they probably got better results with 1.2041 which is a bit more dense than water.  
The forward and upward directions are just the directions of force that needs to be applied so we can ignore that…Similarly cp and area. can be ignored. I can figure them out.

I don’t know how to figure out the rest. I though the stall parameters can be ignored but they have -0.025 for cla\_stall so I am not sure about it.

---

<div class="post-metadata">

**Author:** ![jakkala-kalvik](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jakkala-kalvik](https://discuss.bluerobotics.com/u/jakkala-kalvik)\
**Post date:** [March 3, 2017, 6:17pm UTC](https://discuss.bluerobotics.com/t/t200-simulation-in-gazebo/798/8 "2017-03-03T18:17:46Z")

</div>

Or do you know of a better simulator I can use with ros?

---

<div class="post-metadata">

**Author:** ![rjehangir](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/rjehangir/32/671_2.png) [@rjehangir](https://discuss.bluerobotics.com/u/rjehangir)\
**Post date:** [March 3, 2017, 6:20pm UTC](https://discuss.bluerobotics.com/t/t200-simulation-in-gazebo/798/9 "2017-03-03T18:20:56Z")

</div>

Gazebo is the standard so it would be cool if we could get it working in there. There is also a software-in-the-loop (SITL) simulator built into ArduSub/ArduPilot. If you are planning to talk to ArduSub through ROS, then that might be a perfect fit. We haven’t done much on the physics for that but it has more flexibility.

For ROS, I suppose it’s probably best to try to simulate the propellers just like the Iris model. How do you define the motor positions?

---

<div class="post-metadata">

**Author:** ![jakkala-kalvik](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jakkala-kalvik](https://discuss.bluerobotics.com/u/jakkala-kalvik)\
**Post date:** [March 3, 2017, 6:43pm UTC](https://discuss.bluerobotics.com/t/t200-simulation-in-gazebo/798/10 "2017-03-03T18:43:37Z")

</div>

You will have to use the model editor. Import the rov chassis with the motors attached but without the propellers(do this in blender or whichever cad software and then save it as a .dae to import it into gazebo). Then import the propellers and attach them to each motor as a revolute joint .

---

<div class="post-metadata">

**Author:** ![olivier](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/olivier/32/16825_2.png) [@olivier](https://discuss.bluerobotics.com/u/olivier)\
**Post date:** [March 8, 2017, 8:39am UTC](https://discuss.bluerobotics.com/t/t200-simulation-in-gazebo/798/11 "2017-03-08T08:39:54Z")

</div>

Hello,

I created a few years ago a simple drag/buoyancy plugin for Gazebo available here:

> **[freefloating-gazebo](https://github.com/freefloating-gazebo)**
>
> freefloating-gazebo has 3 repositories available. Follow their code on GitHub.

It is less realistic than the new Gazebo plugin, basically you define linear drag coefficients in each direction and a buoyancy force for each link, then you can apply thruster forces and Gazebo deals with the dynamics. Propellers physics is thus implicit, we assume a thruster can directly apply a given force.

You can read the referenced paper in the Readme in order to see how this works.

I also created a package to simulate the BlueRov 1 in Gazebo (follow above link) using this plugin, for now it waits for thruster inputs. I am not sure about the X-Y-Z drag coefficients and the inertia matrix of the robot, feel free to give feedback if you have more realistic values.  
We have a BlueROV 1 here and once it is built and identification is done I will update the simulation parameters.

---

<div class="post-metadata">

**Author:** ![jakkala-kalvik](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jakkala-kalvik](https://discuss.bluerobotics.com/u/jakkala-kalvik)\
**Post date:** [March 8, 2017, 8:40am UTC](https://discuss.bluerobotics.com/t/t200-simulation-in-gazebo/798/12 "2017-03-08T08:40:23Z")

</div>

Did you try importing the thruster into gazebo I tried using igs and step imported them into catia removed the prop then exported it as stl imported it into blender and then exported it as .dae and then imported it into gazebo but the imported model in gazebo is not imported properly. part of the duct has a few missing surfaces and the tip on the tail has a few missing surfaces. It it your model or am I messing it up or gazebo. The model looks alright in catia and blender.

---

<div class="post-metadata">

**Author:** ![clyde](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/clyde/32/8563_2.png) [@clyde](https://discuss.bluerobotics.com/u/clyde)\
**Post date:** [September 23, 2017, 10:45pm UTC](https://discuss.bluerobotics.com/t/t200-simulation-in-gazebo/798/13 "2017-09-23T22:45:39Z")

</div>

You might want to take a look at uuv\_simulator, which includes quite a few Gazebo plugins, including a thruster plugin. [Home · uuvsimulator/uuv\_simulator Wiki · GitHub](https://github.com/uuvsimulator/uuv_simulator/wiki)

---

<div class="post-metadata">

**Author:** ![musamorena](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@musamorena](https://discuss.bluerobotics.com/u/musamorena)\
**Post date:** [September 25, 2017, 9:14am UTC](https://discuss.bluerobotics.com/t/t200-simulation-in-gazebo/798/14 "2017-09-25T09:14:50Z")

</div>

Hello Jakkala,

we added thruster plugins and lift and drag plugins into the package [GitHub - uuvsimulator/uuv\_simulator: Gazebo/ROS packages for underwater robotics simulation](https://github.com/uuvsimulator/uuv_simulator). There are a number of ROVs and AUVs we already simulate in Gazebo for the Eu-Project SWARMs. We actually also have a small simulation scenario with an ROV that uses the BlueRobotics thruster. If you want to try it out and need any help, you can contact us on GitHub.

Best,

Musa
