Need help visualizing topics using Rviz and opennicamera plugin

asked 2019-02-11 06:21:58 -0500

Hello, I'm trying to visualize the topics that are being published by my gazebo model using the opennicamera plugin, if I execute rostopic list this is the output:

peroanjo@peroanjoPC:~$ rostopic list

/camera/depth/camera_info
/camera/depth/image_raw
/camera/depth/image_raw/compressed
/camera/depth/image_raw/compressed/parameter_descriptions
/camera/depth/image_raw/compressed/parameter_updates
/camera/depth/image_raw/compressedDepth
/camera/depth/image_raw/compressedDepth/parameter_descriptions
/camera/depth/image_raw/compressedDepth/parameter_updates
/camera/depth/image_raw/theora
/camera/depth/image_raw/theora/parameter_descriptions
/camera/depth/image_raw/theora/parameter_updates
/camera/depth/points
/camera_ir/depth/camera_info
/camera_ir/parameter_descriptions
/camera_ir/parameter_updates
/clock
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/set_link_state
/gazebo/set_model_state
/gazebo_gui/parameter_descriptions
/gazebo_gui/parameter_updates
/p3dx/base_pose_ground_truth
/p3dx/cmd_vel
/p3dx/odom
/rosout
/rosout_agg
/tf

which makes me think that the topics are being published correctly, however when I open rviz and select the /camera/depth/image_raw topic, a warning shows up telling that there is no image being recevied. Does this mean that my .gazebo file isn't configured correctly? This is the part of my .gazebo file regarding the kinect camera:

    <!-- kinect -->
    <gazebo reference="kinect">
    <sensor name="camera" type="depth">
        <update_rate>20</update_rate>
        <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="camera_plugin" filename="libgazebo_ros_openni_kinect.so">
          <baseline>0.2</baseline>
          <alwaysOn>true</alwaysOn>
          <!-- Keep this zero, update_rate in the parent <sensor> tag
            will control the frame rate. -->
          <updateRate>0.0</updateRate>
          <cameraName>camera_ir</cameraName>
          <imageTopicName>/camera/depth/image_raw</imageTopicName>
          <cameraInfoTopicName>/camera/depth/camera_info</cameraInfoTopicName>
          <depthImageTopicName>/camera/depth/image_raw</depthImageTopicName>
          <depthImageInfoTopicName>/camera/depth/camera_info</depthImageInfoTopicName>
          <pointCloudTopicName>/camera/depth/points</pointCloudTopicName>
          <frameName>kinect</frameName>
          <pointCloudCutoff>0.05</pointCloudCutoff>
          <distortionK1>0</distortionK1>
          <distortionK2>0</distortionK2>
          <distortionK3>0</distortionK3>
          <distortionT1>0</distortionT1>
          <distortionT2>0</distortionT2>
          <CxPrime>0</CxPrime>
          <Cx>0</Cx>
          <Cy>0</Cy>
          <focalLength>0</focalLength>
          <hackBaseline>0</hackBaseline>
        </plugin>
      </sensor>
</gazebo>
edit retag flag offensive close merge delete

Comments

Can you use either rostopic echo <topic_name> or rostopic hz <topic_name> to confirm if any messages are being sent over these topics?

PeteBlackerThe3rd gravatar imagePeteBlackerThe3rd ( 2019-02-11 08:37:18 -0500 )edit

I managed to visualize the first one but for the second one I have the following error: Transform [sender=unknown_publisher] For frame [kinect]: Frame [kinect] does not exist. Both topics seem to be working correctly when using rostopic echo.

peroanjo gravatar imageperoanjo ( 2019-02-11 17:33:20 -0500 )edit

Whenever RVIZ says a frame doesn't exist it means there's no TF link between the currently selected fixed frame and that sensors frame. In your case you probably just need to change the fixed frame in RVIZ to kinect.

PeteBlackerThe3rd gravatar imagePeteBlackerThe3rd ( 2019-02-11 17:50:38 -0500 )edit

Also make sure you a viewing the topic as an image not a camera. They are different things, the image view is what will show you the images received more easily.

PeteBlackerThe3rd gravatar imagePeteBlackerThe3rd ( 2019-02-11 17:51:57 -0500 )edit

But the link between my fixed frame (base_link) and my sensor is called kinect, or at least this is the part of my .gazebo file regarding that:

<link name="kinect"> <inertial>....... ....

peroanjo gravatar imageperoanjo ( 2019-02-11 18:04:15 -0500 )edit

Sorry, my .xacro file, not my .gazebo file.

peroanjo gravatar imageperoanjo ( 2019-02-11 18:05:59 -0500 )edit