Gazebo | Ignition | Community
Ask Your Question
0

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

asked 2023-05-26 08:58:28 -0500

mls gravatar image

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/tutoria... 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 !

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-05-27 00:46:22 -0500

jrtg gravatar image

updated 2023-05-27 08:19:29 -0500

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.

edit flag offensive delete link more

Comments

There is also an example world wide_angle_camera.sdf.

jrtg gravatar imagejrtg ( 2023-05-27 08:35:54 -0500 )edit

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 ?

mls gravatar imagemls ( 2023-05-30 03:37:18 -0500 )edit

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.

mls gravatar imagemls ( 2023-05-30 10:47:08 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2023-05-26 08:58:28 -0500

Seen: 195 times

Last updated: May 27