Gazebo | Ignition | Community
Ask Your Question
0

Increasing horizontal_hov in gazebo will make the object looks very "far"

asked 2021-10-08 01:33:28 -0500

westcar gravatar image

Hi everyone, I have a CSI camera sitting in front of my robot. It's resolution is 640x480 with 160 degree HOV. I wanted to use the same camera in gazebo environment so I got all the camera properties from the hardware and setup a csi camera in gazebo world. However, the object from this camera looked extremely far comparing to the real world scenario. I was then tuning the parameters and realized that if I decrease the horizontal_hov values, the object in the camera frame would look a lot closer but the horizontal field of view decreases accordingly. Below is my camera setting in gazebo. Am I missing some camera properties? Also, I got the distortion values from the real camera, but by adding those numbers in gazebo didn't show any barrel effect like I saw in the hardware camera.

  <gazebo reference="camera_csi_front">
<!-- <material>Gazebo/Green</material> -->
<sensor type="camera" name="csi_front">
    <pose>0 0 0 0 0 0</pose>
  <update_rate>60.0</update_rate>
  <camera name="front">
    <horizontal_fov>2.79253</horizontal_fov>  <!--160 degrees -->
    <image>
      <width>640</width>
      <height>480</height>
      <format>R8G8B8</format>
    </image>
    <clip>
      <near>0.02</near>
      <far>300</far>
    </clip>
  </camera>
  <plugin name="camera_controller" filename="libgazebo_ros_camera.so">
    <alwaysOn>true</alwaysOn>
    <updateRate>0.0</updateRate>
    <cameraName>car/csi_front</cameraName>
    <imageTopicName>image_raw</imageTopicName>
    <cameraInfoTopicName>camera_info</cameraInfoTopicName>
    <frameName>camera_csi_front</frameName>
    <hackBaseline>0.07</hackBaseline>
    <distortionK1>-0.264598808</distortionK1>
    <distortionK2>0.0156281135</distortionK2>
    <distortionK3>0.0822019378</distortionK3>
    <distortionT1>0.0000652954</distortionT1>
    <distortionT2>0.0053984313</distortionT2>
  </plugin>
</sensor>
</gazebo>

Any help is appreciated! I was trying to upload the images but unfortunately seems like the website wasn't responding to my upload.image description

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-10-11 00:01:15 -0500

Veerachart gravatar image

I decrease the horizontal_hov values, the object in the camera frame would look a lot closer but the horizontal field of view decreases accordingly.

That's correct, and it's the definition of field of view. Camera's FOV is directly related to the lens's focal length (or zoom). Having 160-degree FOV means the camera can see 80 degrees to the left and to the right, which makes it almost a fisheye camera (180-degree means you can see everything in front of the sensor's plane. Wideangle lenses (smaller focal lengths) have larger FOV and objects will look farther in the image, while telephoto lenses or more commonly known as zoom lenses (larger focal length) have smaller FOV and objects will look closer and larger.

Also, I got the distortion values from the real camera, but by adding those numbers in gazebo didn't show any barrel effect like I saw in the hardware camera.

I'm not sure if ROS plugin do that for you. You can try by placing the distortion information in the <camera>itself. I only use SDF format, and the reference is here http://sdformat.org/spec?ver=1.7&elem...

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-10-08 01:33:28 -0500

Seen: 333 times

Last updated: Oct 11 '21