Why does the ar_track_alvar detect the same Markers at different positions?

asked 2018-03-06 06:10:19 -0500

simff gravatar image

updated 2018-03-08 02:56:41 -0500


I am using ROS Kinetic on a Linux 16.04 machine, Gazebo 7.0 and the simulated Kinect camera with the openni_kinect plugin on Husky robot. When starting the ar_track_alvar pkg to detect two markers in the environment (the precise position is known from my Gazebo world). I got the correct position of them,but detecting them from another position while driving gave other pose estimate value. The error is considerably high, around 30 cm, and gets worse the more I drive around.

I have two questions:

  1. Am I seeing the correct behaviour from the ar_alvar package? I was especting to have much less error estimate from the actual marker's position. If yes how to reduce this error?

  2. Is the simulated Kinect camera already calibrated to work with ar_track_alvar? I see (see file below) that distorsions parameter are all 0. I assume that being this a simulation, so "ideal" conditions, the Kinect does not have lens distorsion. Am I right? Should I do some calibration here?

Below on the left the correct detection, and on the right the faulty one.

image description

Here the launch file for the ar_track package, the URDF Kinect code and the outputs of the markers' distance in both scenarios.

Alvar launch file

<?xml version="1.0"?>
    <arg name="marker_size" default="50" /> <!-- 500 mm according to file generation - see thesis documents-->
    <arg name="max_new_marker_error" default="0.02" /> <!-- original 0.08-->
    <arg name="max_track_error" default="0.0001" /> <!-- original 0.2-->

    <arg name="cam_image_topic" default="/camera/depth/points" />
    <arg name="cam_info_topic" default="/camera/rgb/camera_info" />
    <arg name="output_frame" default="/odom" />
    <arg name="marker_resolution" default="5" />

    <node name="ar_track_alvar" pkg="ar_track_alvar" type="individualMarkers" respawn="false" output="screen">
        <param name="marker_size"           type="double" value="$(arg marker_size)" />
        <param name="max_new_marker_error"  type="double" value="$(arg max_new_marker_error)" />
        <param name="max_track_error"       type="double" value="$(arg max_track_error)" />
        <param name="output_frame"          type="string" value="$(arg output_frame)" />

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


Kinect URDF

<gazebo reference="${prefix}_link">
      <sensor type="depth" name="${prefix}">
            <far>4.0</far> <!-- default 8, gave segmentation error problem in the camera--> <!-- How far in meters would the camera see-->
        <plugin name="kinect_${prefix}_controller" filename="libgazebo_ros_openni_kinect.so">

The wrong topic output devation of around 27 cm from reference. The reference is the first detection: id1-> x: 4 y: -1, id2: x: 4 y: 1. The correcteness of this pose is double checked ... (more)

edit retag flag offensive close merge delete