Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera Sensor Lens Orthographic not working #2804

Open
Jak253 opened this issue Feb 28, 2025 · 0 comments
Open

Camera Sensor Lens Orthographic not working #2804

Jak253 opened this issue Feb 28, 2025 · 0 comments

Comments

@Jak253
Copy link

Jak253 commented Feb 28, 2025

Hello,

I'm trying to use the camera sensor with the orthographic lens to generate a 2D map for navigation.
However, I can't change my lens type. It always stays stereographic.
Every value I write in the field is ignored.

The relevant SDF Parts look like this:
`

<physics type="ode">
  <max_step_size>0.003</max_step_size>
  <real_time_factor>1.0</real_time_factor>
</physics>
<plugin name="gz::sim::systems::Physics" filename="libgz-sim8-physics-system.so"/>
<plugin name="gz::sim::systems::UserCommands" filename="libgz-sim8-user-commands-system.so"/>
<plugin name="gz::sim::systems::SceneBroadcaster" filename="libgz-sim8-scene-broadcaster-system.so"/>
<plugin name="gz::sim::systems::Sensors" filename="libgz-sim8-sensors-system.so">
  <render_engine>ogre2</render_engine>
</plugin>

<model name="My_Ortho_Cam">
  <pose>170 -200 400 0 1.57 0</pose>
  <static>true</static>
  <link name="camera_link">
    <sensor name="my_camera" type="camera">
      <topic>/map_camera</topic>
      <update_rate>1</update_rate>
  <always_on>1</always_on>
      <visualize>true</visualize>
      <camera>
    <save enabled="true">
	    <path>/home/ros/camera</path>
        </save>
        <image>
          <width>10000</width>
          <height>10000</height>
          <format>R8G8B8</format>
        </image>
        <clip>
          <near>0.1</near>
          <far>1000</far>
        </clip>
    <lens>
          <type>orthographic</type>
    </lens>
      </camera>
    </sensor>
  </link>
</model>

`

I noticed that if I check my camera model with gz model -l -m My_Ortho_Cam -s all my properties are correctly set, except the lens type.
The output of said gz model -l -m My_Ortho_Cam -s
`
Requesting state for world [warehouse]...

  • Link [5]
    • Name: camera_link
    • Parent: My_Ortho_Cam [4]
    • Mass (kg): 1.000000
    • Inertial Pose [ XYZ (m) ] [ RPY (rad) ]:
      [0.000000 0.000000 0.000000]
      [0.000000 -0.000000 0.000000]
    • Inertial Matrix (kg.m^2):
      [1.000000 0.000000 0.000000]
      [0.000000 1.000000 0.000000]
      [0.000000 0.000000 1.000000]
    • Pose [ XYZ (m) ] [ RPY (rad) ]:
      [0.000000 0.000000 0.000000]
      [0.000000 -0.000000 0.000000]
    • Sensor [6]
      • Name: my_camera
      • Parent: My_Ortho_Cam [4]
      • Pose [ XYZ (m) ] [ RPY (rad) ]:
        [0.000000 0.000000 0.000000]
        [0.000000 -0.000000 0.000000]
      • Horizontal field of view (rad): 1.047
      • Image width (px): 10000
      • Image height (px): 10000
      • Near clip (m): 0.1
      • Far clip (m): 1000
      • Pixel format: RGB_INT8
      • Save frames: 1
      • Save frames path: /home/ros/camera
      • Image noise:
        • Mean: 0
        • Bias mean: 0
        • Standard deviation: 0
        • Bias standard deviation: 0
        • Precision: 0
        • Dynamic bias standard deviation: 0
        • Dynamic bias correlation time (s): 0
      • Distortion K1: 0
      • Distortion K2: 0
      • Distortion K3: 0
      • Distortion P1: 0
      • Distortion P2: 0
      • Distortion center: 0.5 0.5
      • Lens type: stereographic
      • Lens scale to horizontal field of view (rad): 1
      • Lens C1: 1
      • Lens C2: 1
      • Lens C3: 0
      • Lens focal length (m): 1
      • Lens function: tan
      • Lens cutoff angle (rad): 1.5708
      • Lens texture size: 256
      • Lens intrinsics Fx: 277
      • Lens intrinsics Fy: 277
      • Lens intrinsics Cx: 160
      • Lens intrinsics Cy: 120
      • Lens intrinsics skew: 0
      • Visibility mask: 4294967295
        `

I'm unsure if it's because I did something wrong with the implementation of the SDF-file, or gazebo does not support different lens types, or the rendering engine does not support it.

Thanks for your help and input in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Inbox
Development

No branches or pull requests

1 participant