Obstacle Avoidance with myRIO and Kinect
This small project uses the Kinect to gather depth data and avoid obstacles. The myRIO is controlling the
first version of the Turtlebot made by Clearpath Robotics, which consists of an iRobot Create and a
Kinect. If you haven’t set up the Kinect to work with the myRIO yet, check out this guide :
o LabVIEW for myRIO module or Robotics Module
LabVIEW Real-Time 13.0.0 – NI myRIO 13.0
iRobot Create LabVIEW interface (already in project, freely available here:
Turtlebot 1 (or Kinect and mobile robot)
Setting up Hardware
The Kinect USB cable gets plugged directly into the myRIO. The Kinect requires an additional 12V
source, which on our robot comes from this board: http://store.iheartengineering.com/ihe-0200-0000fa00.html which plugs directly into the iRobot Create DB25 connector. If you are using a different set
up, you will probably need a voltage regulator connected to your robot’s power supply to set this up.
The myRIO communicates with the iRobot serially through a UART. Either UART on the myRIO can be
used, but our project is using MXP connector B. We connected to the iRobot through the 7 pin mini-DIN
connector. Connect the TX (pin 14 on myRIO) to the RX pin on the mini –DIN (pin 3), and the RX (pin 10
on myRIO) to the TX pin on the mini-DIN (pin 4). It is also important to bridge the myRIO digital ground
(pin 8, 12, etc.) with the iRobot ground (mini-DIN pins 6,7). Full pin outs of the mini-DIN and DB25
connector on the iRobot are on this sheet:
In order to deploy this program and see the outputs of the front panel while running, the project needs
to be using the myRIO’s wifi IP address. After setting up the myRIO’s wifi, copy the IP address. Right
click on myRIO in Project Explorer, select Properties, and enter the IP address into the appropriate box.
This program follows the Initialize, Run, Shutdown sequence that is laid out in the myRIO example
project. The main section of this code does three main things. First, it acquires depth data from the
Kinect. Then it uses the Simple VFH VI from the myRIO module (or from the Robotics Module) to decide
what direction the robot should go. The state machine uses this direction, as well as data from the
bump sensors on the iRobot to decide what action the robot should take: either go in the direction
determined by the Simple VFH, or back up and turn away from a bump.
This step by step approach works alright as the Depth data from the Kinect can be read relatively quickly
(~15 fps), but the use of the bump sensor data is still delayed by waiting for this data. A more robust
architecture for multiple sensors is used in the more advanced project: Color Following & Obstacle
Avoidance with the myRIO and Kinect.
-Depth data from Kinect
-Simple VFH alg.
-Bump sensors on
-Write set points to
Kinect Library & Vis
Credit for the Kinect wrapper library and accompanying Vis go to Vicentiu Neagoe, Mihai Serban and