Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

ar_track_alvar output frame issue

Hi guys i need your help. I try to use ar_track_alvar to detect an ar_tag on gazebo sim using a simulated camera.

Here there is my urdf file of the robot:

<?xml version="1.0"?>

<robot xmlns:xacro="" name="robot">

  <xacro:property name="M_PI" value="3.1415926535897931" />

    <link name="camera_link">

        <origin xyz="0 0 0" rpy="0 0 0" />
          <box size="0.2 0.2 0.2"/>

        <origin xyz="0 0 0" rpy="0 0 0" />
          <box size="0.2 0.2 0.2"/>
        <material name="grey">
            <color rgba="0.2 0.2 0.2 1.0"/>

        <mass value="0.001" />
        <origin xyz="0 0 0" rpy="0 0 0" />
        <inertia ixx="0.0001" ixy="0" ixz="0" iyy="0.0001" iyz="0" izz="0.0001" />


  <!-- camera -->
  <gazebo reference="camera_link">
    <sensor type="camera" name="camera1">
      <camera name="head">
          <!-- Noise is sampled independently per pixel on each frame.
               That pixel's noise value is added to each of its color
               channels, which at that point lie in the range [0,1]. -->
      <plugin name="camera_controller" filename="">


And here my launch file

<?xml version="1.0" ?>


  <arg name="x_robot" default="0.0"/>
  <arg name="y_robot" default="0.0"/>
  <arg name="z_robot" default="0.0"/>
  <arg name="tf_prefix" default="$(optenv ROS_NAMESPACE)"/>

  <arg name="marker_size" default="30.0" />
    <arg name="max_new_marker_error" default="0.08" />
    <arg name="max_track_error" default="0.2" />
    <arg name="cam_image_topic" default="/robot/rrbot/camera1/image_raw" />
    <arg name="cam_info_topic" default="/robot/rrbot/camera1/camera_info" />
    <arg name="output_frame" default="/camera_link" />

  <!-- Init Gazebo -->
  <include file="$(find gazebo_ros)/launch/empty_world.launch"/>

  <group ns="robot">
    <!-- Include the robot.urdf file -->
    <param name="robot_description" command="$(find xacro)/ $(find robot_simulation)/urdf/robot.urdf.xacro"/>

    <!-- Spawn the robot into gazebo -->
    <node name="spawn_robot" pkg="gazebo_ros" type="spawn_model"
            args="-param robot_description
                  -x $(arg x_robot)
                  -y $(arg y_robot)
                  -z $(arg z_robot)
                  -model my_robot"
            respawn="false" output="screen" />

  <group ns="tag">
    <!-- Include the robot.urdf file -->
    <param name="ar_tag_gazebo" command="$(find xacro)/ $(find robot_simulation)/urdf/ar_tag.urdf.xacro"/>

    <!-- Spawn the robot into gazebo -->
    <node name="spawn_tag" pkg="gazebo_ros" type="spawn_model"
            args="-param ar_tag_gazebo
                  -x 0.0
                  -y 0.5
                  -z 0.5
            -R 1.57
            -P 0.0
            -Y 0.0
                  -model ar_gazebo"
            respawn="false" output="screen" />

  <node name="ar_track_alvar" pkg="ar_track_alvar" type="individualMarkersNoKinect" 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)" />

  <param name="tf_prefix" type="string" value="$(arg tf_prefix)" />


When i launch it i obtain the following error:

[ERROR] [1566748744.446264644, 2.572000000]: "camera_link" passed to lookupTransform argument target_frame does not exist.

I don't understand where is the error but i think there is some problem using the output frame argument.

Please help me!

Thank you in advance.