DEM / Ground model rotation
Hello,
I use Gazebo-8. I load a DEM file as a ground into gazebo and I'm using the ardupilotgazebo plugin to simulate the behavior of a drone in a real environment. My issue is that gazebo load the North of my DEM pointing toward the Y axis but the IMU from the ardupilotgazebo plugin sees the North toward the X axis.
Is there a way to rotate the DEM/Ground model so that the North directions match ?
Here is what I do to load my DEM :
<world name="my_world_name">
...
<model name="ground">
<static>true</static>
<link name="ground_link">
<collision name="ground_collision">
<geometry>
<heightmap>
<uri>file://path/to/my/file.dem</uri>
</heightmap>
</geometry>
</collision>
<visual name="ground_visual">
<geometry>
<heightmap>
<texture>
<diffuse>file://path/to/my/file.jpg</diffuse>
<normal>file://media/materials/textures/tile/flat_normal.png</normal>
</texture>
<uri>file://path/to/my/file.dem</uri>
</heightmap>
</geometry>
</visual>
</link>
</model>
....
</world>
Regards.
Asked by dve_bonx on 2018-08-31 09:09:52 UTC
Answers
Create a world file, include your DEM model with the include tags, add the pose tags with the desired rotation into the include tags.
Something like this:
<world name="your_world_name">
...
<include>
<uri>model://path/to/your/dem</uri>
<pose>0 0 0 0 0 1.5707</pose>
</include>
...
</world>
If you're not including then you can do it like this:
<model name="ground">
<static>true</static>
<pose>0 0 0 0 0 1.5707</pose>
<link name="ground_link">
(You might have to change this last value to the correct rotation)
Asked by Raskkii on 2018-09-03 05:55:42 UTC
Comments
I did what you propose and it doesn't change anything. I did multiple tries with different values for the rotation. Between each try, I took care of cleaning the Heightmap cache data. No visible change.
Asked by dve_bonx on 2018-09-10 03:19:09 UTC
Oh it turns out it is not possible to change the rotation of the heightmap due to this bug: https://bitbucket.org/osrf/gazebo/issues/2167/not-possible-to-change-the-pose-of The other option would be to do the rotation in the dem itself (though I'm not sure if your particular dem is editable).
Asked by Raskkii on 2018-09-10 04:04:23 UTC
Ok thanks for the answers.
Asked by dve_bonx on 2018-09-11 02:38:16 UTC
Comments
I've edited my answer in response to your modifications.
Asked by Raskkii on 2018-09-07 02:07:17 UTC