Gazebo | Ignition | Community
Ask Your Question
1

North East Down (NED) gazebo frame

asked 2016-01-20 11:40:23 -0500

updated 2016-01-21 07:00:23 -0500

Hi,

I am interested in having a North-East-Down inertial frame in Gazebo. AFAIK this is not possible by just setting an option, and this question remains unanswered.

As a workaround I was trying to flip the camera 180 deg around its X axis and spawn objects in negative Z, but whenever they are below the ground plane they are switched to the positive Z in the next iteration. I tried flipping 180 deg also the ground plane but still the same behavior. Also, the camera gets moved to a "normal"position whenever I try to move it (zoom works OK though, and FPS camera kind of work as well).

Can anybody give me some advice on how to achieve this? Thank you!

EDIT: I added the world I am using to test, contains a cylinder, a inverted gravity and cameras, and a ground plane also rotated (in case it makes any difference, because the same behavior is noticed without flipping the ground plane.

<?xml version="1.0" ?>
<sdf version="1.5">
<world name="test_world">
    <physics type="ode">
        <gravity>0.0 0.0 9.81</gravity>
        <ode>
            <solver>
                <type>quick</type>
                <iters>50</iters>
                <sor>0.8</sor>
            </solver>
        </ode>
        <real_time_update_rate>1000</real_time_update_rate>
        <max_step_size>0.001</max_step_size>
    </physics>

        <gui>
  <camera name="user_camera">
    <pose>1 0 -1 3.141592 0 0</pose>
  </camera>
</gui>

<model name='unit_cylinder_1'>
      <pose>0 0 -1.5 0 0 0</pose>
      <link name='link'>
        <inertial>
          <mass>1</mass>
          <inertia>
            <ixx>1</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>1</iyy>
            <iyz>0</iyz>
            <izz>1</izz>
          </inertia>
        </inertial>
        <collision name='collision'>
          <geometry>
            <cylinder>
              <radius>0.5</radius>
              <length>1</length>
            </cylinder>
          </geometry>
          <max_contacts>10</max_contacts>
        </collision>
        <visual name='visual'>
          <geometry>
            <cylinder>
              <radius>0.5</radius>
              <length>1</length>
            </cylinder>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Grey</name>
            </script>
          </material>
        </visual>
        <self_collide>0</self_collide>
        <kinematic>0</kinematic>
      </link>
    </model>

    <include>
         <pose>0 0 0 3.141592 0 0</pose>
        <uri>model://ground_plane</uri>
    </include>
</world>

</sdf>

edit retag flag offensive close merge delete

Comments

It's possible that a lot of logic in Gazebo assumes the Z axis is pointing up. Maybe you could ticket an issue in the issue tracker? It might also help if you share the world that you've created and behaves weird.

chapulina gravatar imagechapulina ( 2016-01-20 12:04:44 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2016-01-22 20:49:50 -0500

chapulina gravatar image

If I understood right, is this just a matter of flipping gravity? I might not be fully understanding the question.

I feel like the example world in the question should be supported, but there seems to be a problem related to the ground plane. I changed the ground to be a box geometry instead and got some sort of world working:

https://www.youtube.com/watch?v=kHPKw...

Without a plane, the physics seems to work ok. But the GUI is not ready to be used upside-down.

<?xml version="1.0" ?>
<sdf version="1.5">
<world name="test_world">
  <physics type="ode">
      <gravity>0.0 0.0 9.81</gravity>
  </physics>

  <gui>
    <camera name="user_camera">
      <pose>-4.7 0 -1.6 3.141592 0 0</pose>
    </camera>
  </gui>

  <light type="directional" name="sun">
    <cast_shadows>true</cast_shadows>
    <pose>0 0 10 3.14 0 0</pose>
    <diffuse>0.8 0.8 0.8 1</diffuse>
    <specular>0.2 0.2 0.2 1</specular>
    <attenuation>
      <range>1000</range>
      <constant>0.9</constant>
      <linear>0.01</linear>
      <quadratic>0.001</quadratic>
    </attenuation>
    <direction>-0.5 0.1 -0.9</direction>
  </light>

  <model name='unit_cylinder_1'>
    <pose>0 0 -1.5 0 0 0</pose>
    <link name='link'>
      <collision name='collision'>
        <geometry>
          <cylinder>
            <radius>0.5</radius>
            <length>1</length>
          </cylinder>
        </geometry>
      </collision>
      <visual name='visual'>
        <geometry>
          <cylinder>
            <radius>0.5</radius>
            <length>1</length>
          </cylinder>
        </geometry>
      </visual>
    </link>
  </model>

  <model name='ground_box'>
   <static>1</static>
    <link name='link'>
      <collision name='collision'>
        <geometry>
          <box>
            <size>100 100 1</size>
          </box>
        </geometry>
      </collision>
      <visual name='visual'>
        <geometry>
          <box>
            <size>100 100 1</size>
          </box>
        </geometry>
      </visual>
    </link>
  </model>
</world>
</sdf>
edit flag offensive delete link more

Comments

@chapulina It is not only switching gravity. This would be just a workaround. Gravity switch is just a rotation about 180deg around X axis, while the actual transformation would be from East-North-Up to North-East-Down (180 deg around X and 90 around Z) and this would crete some problems if we really depend on the Earth model (WGS84 in Gazebo). Furthermore, in your video you have the same problem as me: the camera is not behaving OK.

Javi V gravatar imageJavi V ( 2016-01-25 02:30:46 -0500 )edit

Oh I see... Then I guess the only remaining options are the ones listed by @nkoenig on the other answer...

chapulina gravatar imagechapulina ( 2016-01-25 02:48:17 -0500 )edit

Thank you so much for looking into this anyway. It is interesting that with the box instead of the ground plane the physics work.

Javi V gravatar imageJavi V ( 2016-01-25 07:36:49 -0500 )edit

No problem, I got really intrigued as to why your example world behaved weirdly. It looks like the ground plane is more like a collision half-space than a thin collision layer.

chapulina gravatar imagechapulina ( 2016-01-25 15:29:32 -0500 )edit

@chapulina yes, that is what I thought. But the weirdest thing for me is that the behavior does not change if you rotate the ground plane 180deg around X.

Javi V gravatar imageJavi V ( 2016-01-26 01:54:22 -0500 )edit
0

answered 2016-01-21 09:14:03 -0500

nkoenig gravatar image

Can you describe what your goal is, or what type of output you're trying to simulate? There might be an alternative way to achieve your goal without trying to alter Gazebo's reference frames.

edit flag offensive delete link more

Comments

I am trying to set my simulation using North-East-Down frame, what I am trying to achieve is simply: http://answers.gazebosim.org/question/4514/gazebo-reference-frame-with-z-pointing-downward/?answer=12404#post-id-12404 which you already replied :)

Javi V gravatar imageJavi V ( 2016-01-22 09:22:32 -0500 )edit

Can you describe the high level goal of the project? For example: "I want to simulate a airplane", and describe the constraints.

nkoenig gravatar imagenkoenig ( 2016-01-22 09:33:39 -0500 )edit

NED frames are common for outdoor applications. In my case, I want to simulate UAVs. Which kind of constraints you mean?

Javi V gravatar imageJavi V ( 2016-01-22 09:49:09 -0500 )edit

It might be possible to have a gazebo plugin act as a middleman to transform frames for you. Do you have a controller that expects a certain frame? Do you need images in a certain frame? Be as descriptive of your whole problem as possible.

nkoenig gravatar imagenkoenig ( 2016-01-22 09:52:49 -0500 )edit

Basically, everything will operate in this NED frame. That means that state estimation and control is done in this frame, camera and sensor inputs are mostly related to the corresponding robot link which is also expressed in the NED frame. Basically, just a full autonomous navigation setup for outdoor UAVs.

Javi V gravatar imageJavi V ( 2016-01-22 10:01:45 -0500 )edit
1

Thanks, it sounds like you have a few options: 1) create some kind of filter that converts between NED frames and gazebo frames, 2) Don't use NED, 3) Don't use Gazebo. Changing the default Gazebo frame will be extremely difficult.

nkoenig gravatar imagenkoenig ( 2016-01-22 20:29:24 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-01-20 11:40:23 -0500

Seen: 1,143 times

Last updated: Jan 22 '16