ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Gazebo Kinect plugin flickering

asked 2019-09-04 16:45:20 -0500

Marseiliais gravatar image

Im using plugin code from gazebosim

<gazebo reference="camera_link">   <sensor name="kinect_camera" type="depth">
    <update_rate>40</update_rate>
    <visualize>true</visualize>
    <camera>
      <horizontal_fov>1.047198</horizontal_fov>
      <image>
        <width>640</width>
        <height>480</height>
        <format>R8G8B8</format>
      </image>
      <clip>
        <near>0.05</near>
        <far>3</far>
      </clip>
    </camera>
    <plugin name="kinect_controller" filename="libgazebo_ros_openni_kinect.so">
      <baseline>0.2</baseline>
      <alwaysOn>true</alwaysOn>
      <updateRate>1.0</updateRate>
      <cameraName>kinect_camera_ir</cameraName>
      <imageTopicName>/kinect_camera/depth/image_raw</imageTopicName>
      <cameraInfoTopicName>/kinect_camera/depth/camera_info</cameraInfoTopicName>
      <depthImageTopicName>/kinect_camera/depth/image_raw</depthImageTopicName>
      <depthImageInfoTopicName>/kinect_camera/depth/camera_info</depthImageInfoTopicName>
      <pointCloudTopicName>/kinect_camera/depth/points</pointCloudTopicName>
      <frameName>kinect_frame</frameName>
      <pointCloudCutoff>0.5</pointCloudCutoff>
      <pointCloudCutoffMax>3.0</pointCloudCutoffMax>
      <distortionK1>0.00000001</distortionK1>
      <distortionK2>0.00000001</distortionK2>
      <distortionK3>0.00000001</distortionK3>
      <distortionT1>0.00000001</distortionT1>
      <distortionT2>0.00000001</distortionT2>
      <CxPrime>0</CxPrime>
      <Cx>0</Cx>
      <Cy>0</Cy>
      <focalLength>0</focalLength>
      <hackBaseline>0</hackBaseline>
    </plugin>   </sensor> </gazebo>

and when im using command

rosrun image_view image_view image:=/kinect_camera/depth/image_raw

the image is flickering and changing colours. Do u know where is my problem?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2020-01-02 20:26:46 -0500

jalbury gravatar image

Both the RGB images and the depth images produced by the plugin are being published to the same topic (/kinect_camera/depth/image_raw), so the flickering you described is image_view alternating between showing the RGB image and the depth image. To fix this, make the RGB images and depth images be published to different topics.

For example, replace the block in your code that specifies the topics for the RGB image and depth image with the following:

<imageTopicName>/kinect_camera/rgb/image_raw</imageTopicName>
<cameraInfoTopicName>/kinect_camera/rgb/camera_info</cameraInfoTopicName>
<depthImageTopicName>/kinect_camera/depth/image_raw</depthImageTopicName>
<depthImageInfoTopicName>/kinect_camera/depth/camera_info</depthImageInfoTopicName>

Now, to view the RGB image, run:

rosrun image_view image_view image:=/kinect_camera/rgb/image_raw

To view the depth image, run:

rosrun image_view image_view image:=/kinect_camera/depth/image_raw

edit flag offensive delete link more

Comments

Both the RGB images and the depth images produced by the plugin are being published to the same topic

to be specific: because of how @Marseiliais has configured the plugin.

This is not default behaviour.

gvdhoorn gravatar image gvdhoorn  ( 2020-01-03 06:32:20 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-09-04 16:45:20 -0500

Seen: 368 times

Last updated: Jan 02 '20