How /camera/camera_info is published when using camera plugin, and how to rectify gazebo camera image

asked 2021-02-19 12:47:13 -0600

altineller gravatar image

Hello,

I made a wide angle lens for my gazebo robot using by:

    <sensor type="wideanglecamera" name="camera">
  <always_on>true</always_on>
  <camera>
    <horizontal_fov>2.792526</horizontal_fov>
    <image>
      <width>640</width>
      <height>480</height>
    </image>
    <clip>
      <near>0.005</near>
      <far>10</far>
    </clip>
    <lens>
      <scale_to_hfov>true</scale_to_hfov>
      <cutoff_angle>1.570796</cutoff_angle>
      <env_texture_size>512</env_texture_size>
    </lens>
  </camera>
  <plugin name="camera_controller" filename="libgazebo_ros_camera.so">
    <alwaysOn>true</alwaysOn>
    <updateRate>30.0</updateRate>
    <cameraName>camera</cameraName>
    <frameName>camera_rgb_optical_frame</frameName>
    <imageTopicName>image_raw</imageTopicName>
    <cameraInfoTopicName>camera_info</cameraInfoTopicName>
  </plugin>
</sensor>

which works as it is supposed to.

While using the camera plugin, how is camera_info published? I tried to rectify the image without success, because I dont know how to make gazebo publish camera_info by using the camera config yaml

Here is my calibration file:

    camera_matrix:
  cols: 3
  data: [337.3092553690036, 0.0, 314.1137093251905, 0.0, 336.85901913795016, 217.29382862441514,
    0.0, 0.0, 1.0]
  rows: 3
camera_name: duckiebot/camera_node
distortion_coefficients:
  cols: 5
  data: [-0.26797875490095663, 0.05000315164795536, 0.0013671143837104543, -0.0004467441984923973,
    0.0]
  rows: 1
distortion_model: plumb_bob
image_height: 480
image_width: 640
projection_matrix:
  cols: 4
  data: [228.53988647460938, 0.0, 314.8955206606661, 0.0, 0.0, 277.1241149902344,
    207.18881284029703, 0.0, 0.0, 0.0, 1.0, 0.0]
  rows: 3
rectification_matrix:
  cols: 3
  data: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
  rows: 3
edit retag flag offensive close merge delete