Robotics StackExchange | Archived questions

Is it possible to simulate a wide angle camera in ignition fortress ?

Hello everyone,

I'm trying to implement a camera sensor on my robot. For a classic camera, no problem it's working but not if I try to make this camera a wide angle camera :/ It seems that the features that we can see on this tuto https://classic.gazebosim.org/tutorials?tut=wide_angle_camera&cat= are still not implemented in gazebo ign/sim. It seems that a lot of the sdf tags for the camera sensor have no effects (<cutoff_angle> for example).

The only thing that have an effect is the tag <horizontal_fov>. But when I increase it to much everything looks far away, if I try to set it to 180deg the image has no more sense. So is there a way to simulate a wide angle camera in ign/sim ?

My code for the cam:

<sensor name="camera" type="camera">
        <camera>
          <horizontal_fov>3</horizontal_fov>
          <image>
            <width>720</width>
            <height>480</height>
          </image>
          <clip>
            <near>0.1</near>
            <far>100</far>
          </clip>
          <lens>
            <type>stereographic</type>
            <scale_to_hfov>false</scale_to_hfov>
            <cutoff_angle>3.14</cutoff_angle> 
          </lens>
        </camera>
        <always_on>1</always_on>
        <update_rate>24</update_rate>
        <visualize>true</visualize>
        <topic>wide_camera_left</topic>
</sensor>

Have a nice day and thank you for your time !

Asked by mls on 2023-05-26 08:58:28 UTC

Comments

Answers

The tutorial you refer to, discusses the use of the wide angle camera plugin (e.g. for fisheye cameras). As far as I can see this also exist for gazebo sim: wide angle camera plugin.

So first thing I'd try is to change

<sensor name="camera" type="camera">

into

<sensor name="camera" type="wideanglecamera">

and see if it works.

Not sure if that plugin is backported to Fortress though, so you might have to update to Garden, or try to compile the plugin for Fortress.

Asked by jrtg on 2023-05-27 00:46:22 UTC

Comments

There is also an example world wide_angle_camera.sdf.

Asked by jrtg on 2023-05-27 08:35:54 UTC

Thanks for your answer !

Yeah I tried <sensor name="camera" type="wideanglecamera"> before and it doesn't work :/ I tried to run the example world but it doesn't seem to work neither. The ignition sensor plugin seems to only works with <sensor name="camera" type="camera"> and when it works I have this weird distortion that make everything look very far away.

I use Fortress because it's the one recommended for ROS2 Humble, can I upgrade to Garden safely ?

Asked by mls on 2023-05-30 03:37:18 UTC

Little update : so it's possible to use wideanglecamera with ogre1 and gz-garden but not with ogre2... And a lot of features are not available with ogre1 so not very worth it. I tried to run the example world, it runs during 2s and crashes.

Asked by mls on 2023-05-30 10:47:08 UTC