## For instruction on writing tutorials
## http://www.ros.org/wiki/WritingTutorials
####################################
##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= 
## descriptive title for the tutorial
## title = Creating a Simple Hardware Driver
## multi-line description to be displayed in search 
## description = This tutorial shows how to create a simple hardware driver that connects via serial to a Parallax RFID Card Reader.
## the next tutorial description (optional)
## next =
## links to next tutorial (optional)
## next.0.link=
## next.1.link=
## what level user is this tutorial for 
## level= IntermediateCategory
## keywords =
####################################

<<IncludeCSTemplate(TutorialCSHeaderTemplate)>>

<<TableOfContents(4)>>
{{{#!wiki red/solid
This tutorial is under construction
}}}
== Introduction ==
=== Concept ===
This tutorial will show how to create a simple hardware driver for the Parallax RFID card reader that broadcasts RFID transponder tag IDs on a topic when they are detected. This information can then be used in a variety of ways by other nodes to identify people, objects or locations.

=== Setup ===
If you haven't done so already, create a directory for your repository and add it to your ROS_PACKAGE_PATH. To make the change permanent you can add the export statement to your .bashrc after it sources the setup.bash file.
{{{
$ cd ~/ros
$ mkdir mylab-ros-pkg
$ export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/ros/mylab-ros-pkg
}}}

Next create a separate stack to contain RFID related packaged.
{{{
$ cd ~/ros/mylab-ros-pkg
$ roscreate-stack mylab_rfid
}}}

Next edit ~/ros/mylab-ros-pkg/mylab_rfid/stack.xml file to have the appropriate information.
{{{
<stack>
  <description brief="mylab_rfid">RFID Driver and Tools</description>
  <author>Maintained by My Robotics Lab</author>
  <license>BSD</license>
  <review status="unreviewed" notes=""/>
  <url>http://ros.org/wiki/mylab_rfid</url>
  <depend stack="ros" />
</stack>
}}}

Since we want to use libserial to talk to the serial port we need to add that as a dependency. First we can check if it defined anywhere else.
{{{
$ rosdep where_defined libserial
}}}

Since dependencies are handled at the stack level we need to edit ~/ros/mylab-ros-pkg/mylab_rfid/rosdep.yaml so that it looks like this.
{{{
libserial:
  ubuntu: libserial-dev
  debian: libserial-dev
}}}

Next we create the package for the driver. Since we will be writing it in C++, we specify roscpp as a dependency.
{{{
$ roscreate-pkg parallax_rfid roscpp
}}}

Switch to the package directory and we can begin setting up the package.
{{{
$ cd ~/ros/mylab-ros-pkg/mylab_rfid/parallax_rfid
}}}

The manifest.xml file in ~/ros/mylab-ros-pkg/mylab_rfid/parallax_rfid should look something like this.
{{{
<package>
  <description brief="Parallax RFID Card Reader">
    Driver for Parallax 125kHz RFID Card Reader
  </description>
  <author>Me Myself</author>
  <license>BSD</license>
  <review status="unreviewed" notes=""/>
  <url>http://ros.org/wiki/parallax_rfid</url>
  <depend package="roscpp"/>
  <rosdep name="libserial"/>
</package>
}}}

Next, wait for the rest of the tutorial to be written
## AUTOGENERATED DO NOT DELETE 
## TutorialCategory
## FILL IN THE STACK TUTORIAL CATEGORY HERE