Rosanswers logo

Hello, Could someone please provide a hint as to why I might not be able to display an image in rviz?

  • I have added a camera in gazebo and am able to see what the robot is seeing. Secondly a call to rostopic echo /camera/color/image_raw returns data. However rostopic echo /camera/color/camera_info results in:

"WARNING: no messages received and simulated time is active. Is /clock being published?"

  • I am publishing a tf from camera_link_optical to map via the following in my roslaunch file: <node pkg="tf" type="static_transform_publisher" name="camera_link_optical_to_map" args="0.0 0.0 0.0 0.0 0.0 0.0 map camera_link_optical 100"/> but I am unsure if this is correct. This was the solution based on this link here.

  • In rviz I have added a camera, set the "Fixed Frame" to camera_link_optical receive the following message "'n' messages received" but also obtain the warning "No CameraInfo received on [/camera/color/camera_info]. Topic may not exist." I am not sure if this is causing the issue.

  • Essentially it is clear data is being published from rostopic echo as mentioned above and the image is clearly viewable in my gazebo simulation. I am not sure why there is however no image in rviz. I have added a snippet of code from my xacro file which is included by the launchfile below. This is largely based off the blog-post from Articulated Robotics here.

Hopefully I have made the issue clear enough. Thank-you for your help.

<joint name="camera_joint" type="fixed">
        <parent link="base_link"/>
        <child link="camera_link"/>
        <!-- Rotates camera here -->
        <origin xyz="${-base_len/2 - camera_box_dim / 2 - camera_offset} 0 ${vehicle_box_height/2}" rpy="${-pi/2} 0 ${-pi/2}"/>
        <!-- <origin xyz="${-base_len/2 - camera_box_dim / 2 - camera_offset} 0 ${vehicle_box_height/2}" rpy="0 ${pi/2} 0"/> -->

<link name="camera_link">
            <box size="${camera_box_dim} ${camera_box_dim} ${camera_box_dim}"/>
        <material name="red"/>

<joint name="camera_optical_joint" type="fixed">
    <parent link="camera_link"/>
    <child link="camera_link_optical"/>
    <!-- <origin xyz="0 0 0" rpy="${-pi/2} 0 ${-pi/2}"/> -->
    <origin xyz="0 0 0" rpy="0 0 0"/>

<link name="camera_link_optical"></link>

<!-- <gazebo reference="camera_link">
</gazebo> -->

<gazebo reference="camera_link">

    <sensor name="camera" type="camera">
        <pose> 0 0 0 0 0 0 </pose>

        <plugin name="camera_controller" filename="libgazebo_ros_camera.so">

Originally posted by jdgre1 on ROS Answers with karma: 16 on 2023-04-22

Post score: 0

Original comments

Comment by Davies Ogunsina on 2023-04-22:
Do you have a tf from the base_link to camera link frame ?

Comment by Mike Scheutzow on 2023-04-22:
There are many examples of working gazebo camera configurations on this site e.g. #q210695.


1 Answer 1


Rosanswers logo

Thanks for your help guys. This was in the end a simple fix: I was not subscribing to the correct topic in Rviz. I needed to subscribe to topic "Image" rather than "Camera" so this was an amateur mistake on my behalf. Cheers

Originally posted by jdgre1 with karma: 16 on 2023-04-23

This answer was ACCEPTED on the original site

Post score: 0


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.