####################################
##FILL ME IN
####################################
## for a custom note with links:
## note =
## for the canned note of "This tutorial assumes that you have completed the
## previous tutorials:" just add the links
## note.0.link=[[turtlebot/Tutorials/indigo/TurtleBot Bringup|TurtleBot Bringup]]
## descriptive title for the tutorial
## title = Adding New 3D Sensor
## multi-line description to be displayed in search
## description = Add support for a new 3D sensor to the turtlebot stack.
## next.0.link=[[turtlebot/Tutorials/indigo/Adding a lidar to the turtlebot using hector_models (Hokuyo UTM-30LX)|Adding a lidar to the turtlebot]]
## next.1.link=
## what level user is this tutorial for
## level= IntermediateCategory
## keywords = turtlebot camera 3D sensor
####################################
<<IncludeCSTemplate(TutorialCSHeaderTemplate)>>

## AUTOGENERATED DO NOT DELETE
## TutorialCategory
## FILL IN THE STACK TUTORIAL CATEGORY HERE
<<TOC(4)>>

== Goal ==
The goal of this tutorial is to describe the steps necessary for a developer to add support for a new 3D sensor to the turtlebot stack.

== 3D Sensor Driver Package ==
This tutorial assumes you have a 3D sensor driver package that emulates the standard ROS camera API, like [[openni_camera]] or [[freenect_camera]]. The standard pattern is to have a driver in a package named '''<TURTLEBOT_3D_SENSOR>_camera''' (e.g., astra_camera) and a launch package with runtime dependencies on this driver package named '''<TURTLEBOT_3D_SENSOR>_launch''', which includes a launch file for bringing up the sensor with a standard layout.

== Turtlebot Bringup ==
There are several changes you will need to make to the [[turtlebot_bringup|turtlebot bringup]] package to add support.

=== Launch Files ===
You will need to create a launch file for your 3D sensor called '''<TURTLEBOT_3D_SENSOR>.launch.xml''' in the ''turtlebot_bringup/launch/includes/3dsensor/'' directory. This launch file will likely include the standard bring-up launch file from your sensor's driver launch package (mentioned above). See the other existing 3D sensor launch files in this directory for examples.

=== URDF Files ===
In order for you to visualize your sensor on the turtlebot in rviz, you will need to add URDF files into the [[turtlebot_description|turtlebot description]] package.

Add a sensor description file called '''<TURTLEBOT_3D_SENSOR>.urdf.xacro''' in the  ''turtlebot_description/urdf/sensors/'' directory.  This file should describe the location and shape of your camera, and include any visualization meshes (located in ''turtlebot_description/meshes/sensors/'') that you wish to include.  See the other existing 3D sensor URDF files for examples.

Add a top-level robot description URDF xacro file called '''<TURTLEBOT_BASE>_<TURTLEBOT_STACKS>_<TURTLEBOT_3D_SENSOR>.urdf.xacro''' in the ''turtlebot_description/robots/'' directory. The values for these need to match the values users will set in the corresponding environment variables.  Follow the examples in this directory for how to include the '''turtlebot_description/urdf/turtlebot_library.urdf.xacro''' file.

Lastly, modify the '''turtlebot_description/urdf/turtlebot_library.urdf.xacro''' file to include a link to the 3D sensor urdf.xacro file you created above.

=== Package Files ===
If you intend to upstream support for this sensor, modify the '''turtlebot_bringup/package.xml''' file to include a run-time dependency on your 3D sensor's driver package.

== Turtlebot Navigation ==
There are several changes you will need to make to the [[turtlebot_navigation|turtlebot navigation]] package to add support.

=== Parameter Files ===
In order for your sensor to perform optimally, you will need too add a costmap parameter file. See the other existing 3D sensor parameter files for examples.

Add a yaml file called '''<TURTLEBOT_3D_SENSOR>_costmap_params.yaml '''to the ''turtlebot_apps/turtlebot_navigation/param/'' directory.

=== Launch Files ===
You will need to add your sensor specific launch files for gmapping and amcl. See the other existing 3D sensor launch files in this directory for examples.

Add a gmapping launch file called '''<TURTLEBOT_3D_SENSOR>_gmapping.launch.xml '''to the ''turtlebot_apps/turtlebot_navigation/l''''aunch/includes/gmapping ''''''''directory. '''

'''Add an amcl launch file called '''<TURTLEBOT_3D_SENSOR>_amcl.launch.xml '''to the ''turtlebot_apps/turtlebot_navigation/launch/includes/amcl'' directory. '''