Custom Camera Model

asked 2019-06-10 08:24:25 -0500

MrRipple gravatar image

Hi all, I need to simulate a custom camera model. I need to set (directly or indirectly through other parameters) FOV, image resolution, sensor dimension [um], focal length. How can I do? Using the lib_gazebo_ros_camera I think there is no way.

Thank for your help. Regards,

edit retag flag offensive close merge delete


Are you sure the existing camera models will not work for you? I will add that we always experimentally calibrate cameras because their optics are so sensitive to small variations in manufacturing, that even two cameras made next to each other on a production line will be different. So knowing the fov, sensor size and focal length is not enough to accurately model a camera.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-06-10 09:32:01 -0500 )edit

This tutorial describes the process to experimentally calibrate a camera with ROS.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-06-10 09:33:06 -0500 )edit

Hi PeteBlackerThe3rd, thanks for the fast reply. My goal is to setup a camera in Gazebo Sim with custom parameter like sensor dimension [um], FOV, focal length etc. I think that in lib_gazebo_ros_camera I can only set FOV (H), image resolution and indirectly focal length in px. I can also set distortion parameters but now I consider a calibrated camera.

I am wrong?

MrRipple gravatar image MrRipple  ( 2019-06-10 10:01:22 -0500 )edit

If you know the sensor size and focal length, then the FOV of the camera (lens distortion aside) is fixed. You can calculate the parameters you need for a simple gazebo pinhole camera, there is no need to extend the code of gazebo. If you need it to realistically match an actual camera you can use the distorted camera as described here.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-06-10 12:36:50 -0500 )edit