Robotics StackExchange | Archived questions

camera_info has wrong distortion coefficients and the Window->Topic Visualization in gazebo has no image topic

Hello, I add a Kinect in the gazebo and publish the ros topic by libgazeborosopennikinect. I found that the distortion coefficients in `/camera/rgb/camerainfo` is all zero, the camera_info details is:

header: 
  seq: 95
  stamp: 
    secs: 2793
    nsecs: 488000000
  frame_id: "camera_depth_optical_frame"
height: 480
width: 640
distortion_model: "plumb_bob"
D: [0.0, 0.0, 0.0, 0.0, 0.0]
K: [554.254691191187, 0.0, 320.5, 0.0, 554.254691191187, 240.5, 0.0, 0.0, 1.0]
R: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
P: [554.254691191187, 0.0, 320.5, -0.0, 0.0, 554.254691191187, 240.5, 0.0, 0.0, 0.0, 1.0, 0.0]
binning_x: 0
binning_y: 0
roi: 
  x_offset: 0
  y_offset: 0
  height: 0
  width: 0
  do_rectify: False

the configuration of kinect in gazebo is below:

<?xml version="1.0"?>
<robot name="kinect_gazebo" xmlns:xacro="http://ros.org/wiki/xacro">
  <xacro:macro name="betago_sim_3dsensor">
    <gazebo reference="camera_link">
      <sensor type="depth" name="camera">
        <always_on>true</always_on>
          <visualize>true</visualize>
        <update_rate>20.0</update_rate>
        <camera>
          <horizontal_fov>${60.0*M_PI/180.0}</horizontal_fov>
          <image>
            <format>B8G8R8</format>
            <width>640</width>
            <height>480</height>
          </image>
          <clip>
            <near>0.05</near>
            <far>8.0</far>
          </clip>
          <distortion>
            <k1>-1.25</k1>
            <k2>0.12</k2>
            <k3>0.0</k3>
            <p1>-0.00028</p1>
            <p2>-0.00005</p2>
            <center>0.5 0.5</center>
          </distortion>
        </camera>

        <plugin name="kinect_camera_controller" filename="libgazebo_ros_openni_kinect.so">
          <cameraName>camera</cameraName>
          <alwaysOn>true</alwaysOn>
          <updateRate>0</updateRate>
          <imageTopicName>rgb/image_raw</imageTopicName>
          <depthImageTopicName>depth/image_raw</depthImageTopicName>
          <pointCloudTopicName>depth/points</pointCloudTopicName>
          <cameraInfoTopicName>rgb/camera_info</cameraInfoTopicName>
          <depthImageCameraInfoTopicName>depth/camera_info</depthImageCameraInfoTopicName>
          <frameName>camera_depth_optical_frame</frameName>
          <baseline>0.1</baseline>
          <distortion_k1>-0.25</distortion_k1>
          <distortion_k2>0.12</distortion_k2>
          <distortion_k3>0.0</distortion_k3>
          <distortion_t1>-0.00028</distortion_t1>
          <distortion_t2>-0.00005</distortion_t2>
          <pointCloudCutoff>0.4</pointCloudCutoff>
          <pointCloudCutoffMax>4.0</pointCloudCutoffMax>
        </plugin>
      </sensor>
    </gazebo>
  </xacro:macro>
</robot>

What's more, there is no image topic in Window->Topic Visualization in gazebo.

Could you please provide some advice? Thanks a lot!

Asked by TouchDeeper on 2020-12-01 05:56:38 UTC

Comments

Answers

The distortion coefficients in your plugin description are wrong.

See the plugins tutorial or the camera utils source for the list of parameters for the camera plugins.

Asked by nlamprian on 2020-12-01 07:37:58 UTC

Comments

@nlamprian Yes, you are right. I wrote the wrong parameter name. In addition, Do you have some idea about the issue that there is no image topic in Window->Topic Visualization in gazebo?

Asked by TouchDeeper on 2020-12-01 08:55:33 UTC

Look at the terminal for any errors when gazebo starts. A simple way to see if a (ros) plugin has been loaded is to check its (ros) interface. Do you see any ros image topics? If not, there are more errors in your description. In that case, start with the example description and gradually modify it.

Asked by nlamprian on 2020-12-01 16:43:21 UTC