apriltag-ros : tag detected but no messages in /tag-detections

asked 2020-10-01 02:47:00 -0500

felixN gravatar image

Hi,

I installed apriltag_ros using apt (sudo apt ros-melodic-apriltag-ros).

The detection seem to work fine (tags are well detected in the /tag_detections_image topic, and are correctly published to the /tf topic).

However, there seem to be no data published to the /tag_detections topic (which I would like to use to get the covariance of the pose).

Do you have an idea what might be the issue?

OS : ubuntu 18.04

Ros distribution : melodic

launch file :

<launch>
  <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="/zed2/zed_node/left" />
  <arg name="camera_frame" default="zed2_left_camera_frame" />
  <arg name="image_topic" default="image_rect_color" />

  <!-- Set parameters -->
  <rosparam command="load" file="$(find borobo)/params/april_tags/settings.yaml" ns="$(arg node_namespace)" />
  <rosparam command="load" file="$(find borobo)/params/april_tags/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 -->
  </node>
</launch>

settings.yaml :

# AprilTag 3 code parameters
# Find descriptions in apriltag/include/apriltag.h:struct apriltag_detector
#                      apriltag/include/apriltag.h:struct apriltag_family
tag_family:        'tag36h11' # options: tagStandard52h13, tagStandard41h12, tag36h11, tag25h9, tag16h5, tagCustom48h12, tagCircle21h7, tagCircle49h12
tag_border:        1          # default: 1
tag_threads:       2          # default: 2
tag_decimate:      1.0        # default: 1.0
tag_blur:          0.0        # default: 0.0
tag_refine_edges:  1          # default: 1
tag_debug:         0          # default: 0
# Other parameters
publish_tf:        true       # default: false

tags.yaml:

# # Definitions of tags to detect
# ### Syntax
#
# standalone_tags:
#   [
#     {id: ID, size: SIZE, name: NAME},
#     ...
#   ]
standalone_tags:
  [
    {id: 0, size: 0.121, name: TAG_0},
    {id: 1, size: 0.121, name: TAG_1},
    {id: 2, size: 0.121, name: TAG_2}
  ]

tag_bundles:
  [
  ]

And because I have seen a few problems related to it (even if it doesn't seem to be my casse), I also add a sample output from the camera-info topic:

header: 
  seq: 91989
  stamp: 
    secs: 1601390207
    nsecs: 372746857
  frame_id: "zed2_left_camera_optical_frame"
height: 720
width: 1280
distortion_model: "plumb_bob"
D: [0.0, 0.0, 0.0, 0.0, 0.0]
K: [526.5478515625, 0.0, 603.1671142578125, 0.0, 526.5478515625, 371.095703125, 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: [526.5478515625, 0.0, 603.1671142578125, 0.0, 0.0, 526.5478515625, 371.095703125, 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

Do you have any idea how to solve this issue?

Thanks a lot in advance

Best

Felix

PS : I also tried an installation from source, but didn't succeeded

edit retag flag offensive close merge delete

Comments

Did you figure it out? I have exactly the same situation, ros melodic, apriltag_ros build from source. There are visual detections in the image feed as well as in the pose feed but the /tag_detections topic refuses to produce output. I have another node waiting to callback for this topic and it never gets triggered. rostopic echo /tag_detections does not do anything. Strange thing is that I can recieve data using plot_juggler, I can see the list of tag_ids there. So I guess there is some problem with the custom message type but I find that very confusing.

rapit gravatar image rapit  ( 2021-04-29 12:58:01 -0500 )edit

@rapit Please do not post answers that are not actually answers. I've moved your answer to a question comment.

jarvisschultz gravatar image jarvisschultz  ( 2021-04-29 14:15:02 -0500 )edit

No, I didn't figured it out. I ended subscribing to the /tf topic and extracting the information I needed from there

felixN gravatar image felixN  ( 2021-04-30 02:23:58 -0500 )edit