<?xml version="1.0"?>
<root xmlns:xacro="http://ros.org/wiki/xacro">

<!-- this controller is pushed into a body scope (previously model scope)
     this will only work with added r36415 patch in simulator_gazebo stack
     otherwise projector will not work without removing the reference tag -->
<xacro:macro name="projector_wg6802418_gazebo_v0" params="name">
  <gazebo reference="${name}_child_frame">
    <projector name="${name}_projector_wg6802418">
      <pose>0 0 0 0 -1.5707 0</pose>
      <texture>stereo_projection_pattern_high_res_red.png</texture>
      <fov>${55.0/180.0*M_PI}</fov>
      <near_clip>0.1</near_clip>
      <far_clip>10</far_clip>
    </projector>
  </gazebo>
  <gazebo>
    <plugin name="${name}_controller" filename="libgazebo_ros_projector.so">
      <projector>${name}_child_frame/${name}_projector_wg6802418</projector>
      <alwaysOn>true</alwaysOn>
      <updateRate>15.0</updateRate>
      <textureName>stereo_projection_pattern_high_res_red.png</textureName>
      <filterTextureName>stereo_projection_pattern_filter.png</filterTextureName>
      <textureTopicName>${name}_controller/image</textureTopicName>
      <projectorTopicName>${name}_controller/projector</projectorTopicName>
    </plugin>
  </gazebo>

</xacro:macro>

</root>
