Gazebo | Ignition | Community
Ask Your Question
0

DEM / Ground model rotation

asked 2018-08-31 09:16:59 -0600

dve_bonx gravatar image

updated 2018-09-04 08:50:54 -0600

Hello,

I use Gazebo-8. I load a DEM file as a ground into gazebo and I'm using the ardupilot_gazebo 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 ardupilot_gazebo 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.

edit retag flag offensive close merge delete

Comments

I've edited my answer in response to your modifications.

Raskkii gravatar imageRaskkii ( 2018-09-07 02:07:17 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-09-03 05:55:42 -0600

Raskkii gravatar image

updated 2018-09-07 02:06:48 -0600

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)

edit flag offensive delete link more

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.

dve_bonx gravatar imagedve_bonx ( 2018-09-10 03:19:09 -0600 )edit

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).

Raskkii gravatar imageRaskkii ( 2018-09-10 04:04:23 -0600 )edit

Ok thanks for the answers.

dve_bonx gravatar imagedve_bonx ( 2018-09-11 02:38:16 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-08-31 09:09:52 -0600

Seen: 437 times

Last updated: Sep 07 '18