<?xml version="1.0"?>

<robot name="turtlebot_gazebo"
       xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
       xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
       xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
       xmlns:xacro="http://ros.org/wiki/xacro">

<!-- ASUS Xtion PRO camera for simulation -->
<!-- gazebo_ros_wge100 plugin is in kt2_gazebo_plugins package -->
	<xacro:macro name="turtlebot_sim_xtion">
	  <gazebo reference="camera_link" >
	    <sensor:camera name="camera" >
	      <imageSize>640 480</imageSize>
	      <imageFormat>R8G8B8</imageFormat>
	      <hfov>62.8</hfov>
	      <nearClip>0.1</nearClip>
	      <farClip>10</farClip>
	      <updateRate>2.0</updateRate>
	      <controller:gazebo_ros_wge100 name="kinect_camera_controller" plugin="libgazebo_ros_wge100.so">
		<alwaysOn>true</alwaysOn>
		<updateRate>5000.0</updateRate>
		<cameraName>camera/rgb</cameraName>
		<frameName>camera_rgb_optical_frame</frameName>
		<hackBaseline>0.0</hackBaseline>
		<CxPrime>320.5</CxPrime>
		<Cx>320.5</Cx>
		<Cy>240.5</Cy>
		<baseline>0.09</baseline>
		<!-- image_width / (2*tan(hfov_radian /2)) -->
		<!-- 320 for wide and 772.55 for narrow stereo camera -->
		<focal_length>525</focal_length>
		<cameraNamespace>camera/rgb</cameraNamespace>
		<depthData>true</depthData>
		<interface:camera name="camera_iface" />
	      </controller:gazebo_ros_wge100>
	    </sensor:camera>
	  </gazebo>
	</xacro:macro>

	<xacro:macro name="turtlebot_sim_kinect">
	  <gazebo reference="camera_link">
	    <sensor:camera name="camera">
<!-- 	      <always_on>1</always_on> -->
<!-- 	      <update_rate>30</update_rate> -->
<!-- 	      <visualize>true</visualize> -->
<!-- 	      <pose>0 0 0 0 0 0</pose> -->
<!-- 	      <topic>default</topic> -->
<!-- 	      <plugin></plugin> -->
<!--         <camera> -->
<!-- 	        <horizontal_fov>60</horizontal_fov> -->
<!-- 					<image> -->
<!-- 					   <width>640</width> -->
<!-- 					   <height>480</height> -->
<!-- 					   <format>R8G8B8</format> -->
<!-- 					</image> -->
<!-- 					<clip> -->
<!-- 					  <near>0.05</near> -->
<!-- 					  <far>3.0</far> -->
<!-- 					</clip> -->
<!-- 				</camera> -->
<!-- 				<save>false</save> -->
<!--         <depth_camera> -->
<!--           <output>default</output> -->
<!--         </depth_camera> -->

	      <always_on>true</always_on>
	      <imageFormat>R8G8B8</imageFormat>
	      <imageSize>640 480</imageSize>
	      <hfov>60</hfov>
	      <nearClip>0.05</nearClip>
	      <farClip>3</farClip>
	      <updateRate>20</updateRate>
	      <baseline>0.1</baseline>
<!-- 	      <controller:gazebo_ros_openni_kinect name="kinect_camera_controller" plugin="libgazebo_ros_openni_kinect.so"> -->
<!-- 	        <cameraName>kinect</cameraName> -->
<!-- 	        <alwaysOn>true</alwaysOn> -->
<!-- 	        <updateRate>20</updateRate> -->
<!-- 	        <imageTopicName>/camera/image_raw</imageTopicName> -->
<!-- 	        <pointCloudTopicName>/camera/depth/points</pointCloudTopicName> -->
<!-- 	        <cameraInfoTopicName>/camera/camera_info</cameraInfoTopicName> -->
<!-- 	        <frameName>camera_depth_optical_frame</frameName> -->
<!-- 	        <CxPrime>0.0</CxPrime> -->
<!-- 	        <Cx>0.0</Cx> -->
<!-- 	        <Cy>0.0</Cy> -->
<!-- 	        <focalLength>0.0</focalLength> -->
<!-- 	        <hackBaseline>0.0</hackBaseline> -->
<!-- 	        <distortionK1>0.0</distortionK1> -->
<!-- 	        <distortionK2>0.0</distortionK2> -->
<!-- 	        <distortionK3>0.0</distortionK3> -->
<!-- 	        <distortionT1>0.0</distortionT1> -->
<!-- 	        <distortionT2>0.0</distortionT2> -->
<!-- 	      </controller:gazebo_ros_openni_kinect> -->
	    </sensor:camera>
	  </gazebo>
	</xacro:macro>
</robot>
