Ask Your Question

ar_track_alvar not recognizing an AR tag

asked 2018-12-12 17:04:58 -0500

mjc1021 gravatar image

updated 2018-12-13 14:29:00 -0500

I am running a Gazebo simulation with a hector_quadrotor with a front facing camera. I want to use the ar_track_alvar package to recognize a single AR tag in the camera's field of view, and publish the pose information of the AR tag for me to subscribe to in another node. Running rqt_image_view I can see the AR tag in the camera frame, but when I use rostopic echo /ar_pose_marker it keeps outputting a marker with no information, which I think means it is publishing the topic but not finding any markers to include data of. Why isn't it finding the marker and publishing its pose in /ar_pose_marker? I have included my launch file that spawns the quadrotor in the world and initializes the ar_track_alvar package:

<launch> <arg name="paused" default="false"/> <arg name="use_sim_time" default="true"/> <arg name="gui" default="true"/> <arg name="headless" default="false"/> <arg name="debug" default="false"/>

<include file="$(find gazebo_ros)/launch/empty_world.launch"> <arg name="world_name" value="$(find hector_quadrotor_model)/worlds/"/> <arg name="paused" value="$(arg paused)"/> <arg name="use_sim_time" value="$(arg use_sim_time)"/> <arg name="gui" value="$(arg gui)"/> <arg name="headless" value="$(arg headless)"/> <arg name="debug" value="$(arg debug)"/> </include>

<include file="$(find hector_quadrotor_gazebo)/launch/spawn_quadrotor_with_cam.launch"/>

<arg name="marker_size" default="4.4"/> <arg name="max_new_marker_error" default="0.08"/> <arg name="max_track_error" default="0.2"/> <arg name="cam_image_topic" default="/front_cam/camera/image"/> <arg name="cam_info_topic" default="/front_cam/camera/camera_info"/> <arg name="output_frame" default="/front_cam_optical_frame"/>

<node name="ar_track_alvar" pkg="ar_track_alvar" type="individualMarkersNoKinect" respawn="false" output="screen" args="_image_transport:=compressed">

  <remap from="camera_image/compressed"  to="$(arg cam_image_topic)/compressed" />
  <remap from="camera_info"   to="$(arg cam_info_topic)" />



I spawn the AR tag with a separate launch file:


<arg name="x" default="0.5" />
<arg name="y" default="0.0" />
<arg name="z" default="0.5" />
<arg name="roll" default="0.0"/>
<arg name="pitch" default="1.5708"/>
<arg name="yaw" default="0.0" />

<arg name="urdf_robot_file" default="$(find hector_quadrotor_gazebo)/urdf/ar_0001.urdf" />
<arg name="robot_name" default="ar_0001" />

<include file="$(find hector_quadrotor_gazebo)/launch/spawn_ar0001_urdf.launch">
    <arg name="x" value="$(arg x)" />
    <arg name="y" value="$(arg y)" />
    <arg name="z" value="$(arg z)" />
    <arg name="roll" value="$(arg roll)"/>
    <arg name="pitch" value="$(arg pitch)"/>
    <arg name="yaw" value="$(arg yaw)" />

    <arg name="urdf_robot_file" value="$(arg urdf_robot_file)" />
    <arg name="robot_name" value="$(arg robot_name)" />


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-12-13 14:30:24 -0500

mjc1021 gravatar image

What I was doing was fine. It ended up being a problem with the ar tag itself that I was spawning. I used someone else's dae file and urdf file for their ar tag and spawned it instead of mine and it worked fine.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-12-12 17:04:58 -0500

Seen: 626 times

Last updated: Dec 13 '18