Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

Thermal Camera Plugin not defined in SDF error

I'm trying to use the hector_gazebo_thermal_camera in a simulation for my graduation project. It returns the error:

Warning [] XML Element[sensor:camera], child of element[link] not defined in SDF. Ignoring[sensor:camera]. You may have an incorrect SDF file, or an sdformat version that doesn't support this element.

I've made a simple code only with the camera and the plugin in order to validate the plugin:

This is the urdf.xacro file:

<?xml version="1.0" ?>
<robot name="robo_teste" xmlns:xacro="">
<xacro:property name="M_PI" value="3.141592" />
<xacro:include filename="$(find teste_thermal_cam)/urdf/model_test.gazebo.xacro" />
 <link name="my_box">
  <origin xyz="2 0 0" rpy = " ${-M_PI/2} 0 0"/>
  <mass value="1.0" />
  <inertia  ixx="1.0" ixy="0.0"  ixz="0.0"  iyy="100.0"  iyz="0.0"  izz="1.0" />
  <origin xyz="0 0 0"/>
    <box size=".1 .1 .2" />
  <origin xyz="2 0 1"/>
    <box size=".1 .1 .2" />
<gazebo reference="my_box">

<link name="flir_camera">
    <origin xyz="0 0 0" rpy="0 0 0"/>
            <mesh filename="package://mybot_description/meshes/LeptonBreakoutBoardWithLepton3.stl" scale="0.001 0.001 0.001"/>
        <material name="light_grey">
            <color rgba="0.8 0.8 0.8 0.8"/>
<joint name="flir_camera_joint" type="fixed">
    <parent link="my_box"/>
    <child link="flir_camera"/>
<origin rpy="0 ${-M_PI/2} 0" xyz="-0.05 0.0 0.00"/>

and this is the .gazebo.xacro file that contains the plugin:

<?xml version="1.0" ?>
  <robot name="test_robot" xmlns:sensor=""

  <xacro:macro name="thermal_camera_gazebo_v0" params="name camera_name image_format image_topic_name camera_info_topic_name hfov update_rate focal_length frame_id hack_baseline image_width image_height">
<gazebo reference="my_box">
  <sensor:camera name="${name}_sensor">
    <imageSize>${image_width} ${image_height}</imageSize>
    <controller:gazebo_ros_thermal_camera name="${name}_controller" plugin="">
      <!-- image_width / (2*tan(hfov_radian /2)) -->
      <!-- 320 for wide and 772.55 for narrow stereo camera -->
      <interface:camera name="${name}_iface" />
<xacro:thermal_camera_gazebo_v0 name="flir_camera" camera_name="flir_camera" image_format='R8G8B8' image_topic_name="thermal" camera_info_topic_name='detection/flir' hfov='90' update_rate='30' focal_length='320' frame_id='thermal_cam_optical_frame' hack_baseline='0' image_width ='640' image_height='480'/>


I'm using ros Kinetic and Gazebo 7 , i've found on github some projects that uses this thermal camera, and I took them as base , the race_pr2 but they are only on ros indigo. And i don't use aditional paramaters to my launch file:

<param name="robot_description" command="$(find xacro)/xacro --check-order $(find teste_thermal_cam)/urdf/model_test.urdf.xacro " />

I already know that some arguments changed in the sdf definitions, and have already used another plugins like stereo camera and the hector sonar plugins.