Robotics StackExchange | Archived questions

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

Hi,

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 artrackalvar 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 artrackalvar? 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"?>
<launch>
    <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)" />
    </node>

</launch>

Kinect URDF

<gazebo reference="${prefix}_link">
      <sensor type="depth" name="${prefix}">
        <always_on>true</always_on>
        <update_rate>20.0</update_rate>
        <camera>
<horizontal_fov>${90.0*M_PI/180.0}</horizontal_fov>
          <image>
            <format>R8G8B8</format>
            <width>640</width>
            <height>480</height>
          </image>
          <clip>
            <near>0.05</near>
            <far>4.0</far> <!-- default 8, gave segmentation error problem in the camera--> <!-- How far in meters would the camera see-->
          </clip>
        </camera>
        <plugin name="kinect_${prefix}_controller" filename="libgazebo_ros_openni_kinect.so">
          <cameraName>${prefix}</cameraName>
          <alwaysOn>true</alwaysOn>
          <updateRate>10</updateRate>
<imageTopicName>rgb/image_raw</imageTopicName>
<depthImageTopicName>depth/image_raw</depthImageTopicName>
<pointCloudTopicName>depth/points</pointCloudTopicName>
<cameraInfoTopicName>rgb/camera_info</cameraInfoTopicName>
<depthImageCameraInfoTopicName>depth/camera_info</depthImageCameraInfoTopicName>
<frameName>${prefix}_frame_optical</frameName>
          <baseline>0.1</baseline>
          <distortion_k1>0.0</distortion_k1>
          <distortion_k2>0.0</distortion_k2>
          <distortion_k3>0.0</distortion_k3>
          <distortion_t1>0.0</distortion_t1>
          <distortion_t2>0.0</distortion_t2>
          <pointCloudCutoff>0.4</pointCloudCutoff>
<robotNamespace>${robot_namespace}</robotNamespace>
        </plugin>
      </sensor>
    </gazebo>

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 with Gazebo coordinates.

header:
      seq: 0
      stamp:
        secs: 176
        nsecs: 124000000
      frame_id: /odom
    id: 1
    confidence: 0
    pose:
      header:
        seq: 0
        stamp:
          secs: 0
          nsecs:         0
        frame_id: ''
      pose:
        position:
          x: 3.96155092332
          y: -0.720825729108
          z: 0.616666278875
        orientation:
          x: 0.707087549376
          y: 0.0052788977451
          z: -0.707086105342
          w: -0.00534512761432
  -
    header:
      seq: 0
      stamp:
        secs: 176
        nsecs: 124000000
      frame_id: /odom
    id: 2
    confidence: 0
    pose:
      header:
        seq: 0
        stamp:
          secs: 0
          nsecs:         0
        frame_id: ''
      pose:
        position:
          x: 3.96155328587
          y: 1.27618849233
          z: 0.61638607159
        orientation:
          x: -0.707095429451
          y: -0.00255244423968
          z: 0.707108731482
          w: 0.00260394695634

Thanks for anyone clarifying my ideas! Regards.

Asked by simff on 2018-03-06 07:10:19 UTC

Comments

Answers