[Buoyancy Plugin] Possible bug
Hi everybody,
I'm using Gazebo 6.6.0 with Ubuntu 14.04 and currently I'm experiencing strange behaviors with the buoyancy plugin shipped with this version.
The following minimal working example shows two sphere, of mass 1 kg, and the usage of the buoyancy plugin where I force the volume of these two sphere to be equal to their mass. Having fluid density equal to 1 should result having the two objects floating in the air, because in this case force_of_gravity == force_of_buoyancy. Unfortunately only the first sphere, l1, floats whereas the second one falls down.
<?xml version='1.0'?>
<sdf version='1.5'>
<model name="buoyancy_example">
<!-- ================== link l1 ================== -->
<link name="l1">
<pose>0 0 1 0 0 0</pose>
<inertial> <mass>1</mass> </inertial>
<visual name='visual'>
<geometry>
<sphere> <radius>0.5</radius> </sphere>
</geometry>
</visual>
<collision name='collision'>
<geometry>
<sphere> <radius>0.5</radius> </sphere>
</geometry>
</collision>
</link>
<!-- ================== link l2 ================== -->
<link name="l2">
<pose>2 0 1 0 0 0</pose>
<inertial> <mass>1</mass> </inertial>
<visual name='visual'>
<geometry>
<sphere> <radius>0.5</radius> </sphere>
</geometry>
</visual>
<collision name='collision'>
<geometry>
<sphere> <radius>0.5</radius> </sphere>
</geometry>
</collision>
</link>
<!-- ================== buoyancy plugin ================== -->
<plugin name="buoyancy" filename="libBuoyancyPlugin.so">
<fluid_density>1</fluid_density>
<link name="l1">
<center_of_volume>0 0 0</center_of_volume>
<volume>1</volume> <!-- volume == mass ==> object should float -->
</link>
<link name="l2">
<center_of_volume>0 0 0</center_of_volume>
<volume>1</volume> <!-- volume == mass ==> object should float -->
</link>
</plugin>
</model>
</sdf>
Based on my trials I believe that the problem is in this for statement here, which doesn't return the next link element within the plugin tag. Does anyone know how I can fix this bug and be able to use multiple "links" tags within this plugin?
Thanks,
Marco.