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

Apriltag_ros 'no image received'

asked 2020-08-13 04:31:13 -0500

Davide_970 gravatar image

updated 2022-08-07 08:58:32 -0500

lucasw gravatar image

Hello everyone, I have a bag file where I recorded some tags in a building. When I play the bag file and start the launch file of apriltag, in rviz there isn't any feedback of the 'tag_detections_image' topic, it says 'no image received'. Any suggestion? Thanks

I'm using ubuntu 18.04 with ros melodic

rqt_graph: image description

edit retag flag offensive close merge delete


Could you show the rqt_graph in the moment you run the bag?

Teo Cardoso gravatar image Teo Cardoso  ( 2020-08-16 11:44:22 -0500 )edit

Yes, I put it

Davide_970 gravatar image Davide_970  ( 2020-08-16 12:40:31 -0500 )edit

which image topic are you publishing to? Is this consistent with the topic the april tag node is subscribing to? Are there images published on this topic? --- These would be generally questions to verify when such errors occur

rfn123 gravatar image rfn123  ( 2020-08-17 05:33:28 -0500 )edit

The bag file sends the following topics:

  • clock

  • odom

  • scan

  • usb_cam/image_raw

While apriltag node take as input "image_rect" msg.

I tried to find a solution on internet such as convertion from image_raw to image_rect but I didn't find anything

Davide_970 gravatar image Davide_970  ( 2020-08-17 06:41:34 -0500 )edit

@Davide_970 have a look at image_proc

rfn123 gravatar image rfn123  ( 2020-08-17 08:44:07 -0500 )edit

Thanks! I’ll try

Davide_970 gravatar image Davide_970  ( 2020-08-17 08:48:06 -0500 )edit

Image_proc asks me a manager.

In the wiki manager is "The name of the target nodelet manager. It will need to be globally qualified (e.g. /my_manager), unless the manager is already in the camera namespace."

But I don't understand what I have to do

Davide_970 gravatar image Davide_970  ( 2020-08-17 09:42:54 -0500 )edit

try adding <node ns="usb_cam" name="image_proc" pkg="image_proc" type="image_proc"/> in your camera launch file

rfn123 gravatar image rfn123  ( 2020-08-17 10:07:21 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2020-08-17 12:22:21 -0500

rfn123 gravatar image

updated 2020-08-17 13:13:08 -0500

EDIT: apriltag_ros requires the /camera_info topic to be published. You need a bagfile with that topic in it.


The error in your question occurs when no image is published to the subscribed topic. According to the wiki of the apriltag_ros package, the subscribed topic is image_rect, which is the rectified camera image. Normally you would use the package image_proc to automatically publish the rectified image according to your camera calibration file. Since you don't have the rectified image, you can simply remap your image topic, see below:

Here is a launchfile for apriltag I've found:

  <arg name="launch_prefix" default="" /> <!-- set to value="gdbserver localhost:10000" for remote debugging -->
  <arg name="node_namespace" default="apriltag_ros_continuous_node" />
  <arg name="camera_name" default="/camera_rect" />
  <arg name="camera_frame" default="camera" />
  <arg name="image_topic" default="image_rect" />

  <!-- Set parameters -->
  <rosparam command="load" file="$(find apriltag_ros)/config/settings.yaml" ns="$(arg node_namespace)" />
  <rosparam command="load" file="$(find apriltag_ros)/config/tags.yaml" ns="$(arg node_namespace)" />

  <node pkg="apriltag_ros" type="apriltag_ros_continuous_node" name="$(arg node_namespace)" clear_params="true" output="screen" launch-prefix="$(arg launch_prefix)" >
    <!-- Remap topics from those used in code to those on the ROS network -->
    <remap from="image_rect" to="$(arg camera_name)/$(arg image_topic)" />
    <remap from="camera_info" to="$(arg camera_name)/camera_info" />

    <param name="camera_frame" type="str" value="$(arg camera_frame)" />
    <param name="publish_tag_detections_image" type="bool" value="true" />      <!-- default: false -->

In your case, you publish /usb_cam/image_raw in your bagfile, but apriltag with the above launchfile wants /camera_rect/image_rect: you can see this from line <remap from="image_rect" to="$(arg camera_name)/$(arg image_topic)" />. This line uses the remap function where you can remap a topic to a different name. So you just have to change the args camera_name to "/usb_cam" and image_topic to "image_raw"- Alternatively you could pass these arguments during launching in the command line, something like: roslaunch apriltag_ros launchfile.launch camera_name:="/usb_cam" image_topic:="image_raw"

edit flag offensive delete link more


It didn't work again (rviz tag_detection_image is still in "no image"), but launching the launch file with the new parameters, now rqt_graph is changed: screen

Davide_970 gravatar image Davide_970  ( 2020-08-17 13:02:31 -0500 )edit

when you do rostopic echo /usb_cam/image_raw , is it empty while playing the rosbag?

rfn123 gravatar image rfn123  ( 2020-08-17 13:06:32 -0500 )edit

When looking at the ROS wiki for apriltag_ros, I see that the camera_info topic is required. You probably have to record the bagfile again, this time_with_ the camera_info topic

rfn123 gravatar image rfn123  ( 2020-08-17 13:10:00 -0500 )edit

Mmm if it’s true that I have to record again I have to write to my professor that I record for me that bag file Big trouble :/

Davide_970 gravatar image Davide_970  ( 2020-08-17 13:35:23 -0500 )edit

Question Tools

1 follower


Asked: 2020-08-13 04:31:13 -0500

Seen: 787 times

Last updated: Aug 17 '20