gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.17k stars 477 forks source link

Logical camera pose rotates user camera and heightmap #2240

Open osrf-migration opened 7 years ago

osrf-migration commented 7 years ago

Original report (archived issue) by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).


Try this minimal example world:

<?xml version="1.0" ?>
<sdf version="1.5">
  <world name="default">
    <include>
      <uri>model://vrc_driving_terrain</uri>
    </include>

    <include>
      <uri>model://sun</uri>
    </include>

    <include>
      <pose>0 10 0 0 0 0</pose>
      <uri>model://house_1</uri>
    </include>

    <model name="box">
      <pose>0 0 0.5 0 0 0</pose>
      <link name="link">
        <collision name="collision">
          <geometry>
            <box>
              <size>1 1 1</size>
            </box>
          </geometry>
        </collision>
        <visual name="visual">
          <geometry>
            <box>
              <size>1 1 1</size>
            </box>
          </geometry>
        </visual>

        <sensor name="logical_camera" type="logical_camera">

          <!-- try with and without this pose element -->
          <pose>0 0 0 0 0 1.57</pose>

          <logical_camera>
            <near>0.55</near>
            <far>5</far>
            <horizontal_fov>1.04719755</horizontal_fov>
            <aspect_ratio>1.778</aspect_ratio>
          </logical_camera>

          <visualize>true</visualize>
          <always_on>true</always_on>
          <update_rate>10</update_rate>
        </sensor>
      </link>
    </model>

  </world>
</sdf>

Without the sensor pose element, the world looks like this:

posezero.png

With the sensor pose element (just adding that, the rest of the world is all the same!), it looks like this:

pose_rotated.png

osrf-migration commented 7 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


this is so weird

osrf-migration commented 7 years ago

Original comment by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).


Related to #2341

osrf-migration commented 6 years ago

Original comment by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).


Seems likely that this either a rendering or GUI issue. The pose of a model seen by a logical camera seems is unaffected.

I tried a world with a logical camera and a box with 3 cases:

  1. No rotation
  2. 0.5 radians yaw rotation only in the<sensor>
  3. 0.5 radians yaw rotation only in the <model> that has the <sensor>

In each I clicked the button for orthographic perspective then top down perspective.

sensor_pose_cases.png

The client window always aligned with the grid. When the rotation was in the <sensor> element everything appears to have been rotated in the client. However, the world pose of the box is identical in cases 1, 2, and 3. The logical camera pose is identical in case 2 and 3. It seems like physics is working with the right poses. The worlds appear identical in ode and bullet.

osrf-migration commented 6 years ago

Original comment by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).


There is a related question on answers:

http://answers.gazebosim.org/question/17876/logical-camera-refence-frame-affecting-gui-reference-frame/