Autonomous Robotic Car using Kinect (with source)
Kinect is one of the greatest inventions of our life-time. If you havent tried it yet, you are missing the taste of future. It is revolutionizing the technical innovations and is the biggest thing since the iphone, maybe bigger.
Foradian is experimenting with Kinect to build futuristic application like virtual shopping. We are also building a cool virtual UI for Project Fedena similar to the ones you see in hollywood films. Keep tuned to the updates.Story of Kinect
Kinect was launched in on November 4, 2010 and Kinect holds the Guinness World Record of being the "fastest selling consumer electronics device". Even though Kinect was meant to use with XBox, the hacking community started reverse engineering the drivers and published opensource drivers within weeks of launch of Kinect. You can read more about Kinect at http://en.wikipedia.org/wiki/Kinect
How Kinect works
Kinect is based on software technology developed internally by Rare, a subsidiary of Microsoft Game Studios owned by Microsoft, and on range camera technology by Israeli developer PrimeSense, which interprets 3D scene information from a continuously-projected infrared structured light. This 3D scanner system called Light Coding employs a variant of image-based 3D reconstruction. The beauty of Kinect is in its simplicity of depth detection. If you are an electronics student/engineer have a look at their patent document. http://www.freepatentsonline.com/20100118123.pdfKinect Hacks
With the availability of opensource drivers, hackers around the world started experimenting on Kinect, which caused a kinect hack revolution. You can also download the drivers and start hacking Kinect from http://openkinect.org
You can get more hacks at http://www.kinecthacks.com/. Dont forget to see their list of Top 10 Kinect hacks - http://www.kinecthacks.com/top-10-best-kinect-hacks/
Our robotic car hack
It all started with the blog post by Brad Templeton "Where will 3-D cameras like Kinect lead?". There was a already Kinect hack in youtube which demonstrated an autonomous robotic car.
Team Violator contacted its creators, but there was no response. So Team Violator with the help of Srihari (Internet Engineer - Foradian) built a quick hack using a Kinect and OpenKinect drivers. The aim was to study the use of Kinect as a depth detector for indoor uses. Entire thing was built on two to three days.
Limitations
- It wont work outdoor
- Area of movement of the car depends on the length of power/data cable of the kinect (Can be improved with a wifi hack or Carrying Laptop along with the Kinect on top of the car with DC power)
Tools used
- PC running Ubuntu 10.04
- Openkinect drivers
- RC Car
- Kinect
- Breadboard
- Transistors switch electronics
How to clone the hack
Difficulty level: High
You should have system level knowledge on linux. You should know how to compile a custom C program using "cmake" utilities. Also information on i/o programming and some electronics knowledge on switching circuits using transistors.
Warning: This is a quick and dirty hack which can damage your PC and other things around you. We are not responsible for any damages. Do it at your own risk.
Our suggestion: If you have plenty of time available, we suggest you to use a good electronic prototyping hardware like "Adruino". We used a dirty hack of parallel port, since there was some issue with interface using USB and it needed more time.
Here we go. We strongly suggest you to play with the glview functionality of the openkinect library before you begin step4.
Step1: Buy Kinect Hardware with all the interfacing cables
Step2: Buy an RC car, which has the ability to carry a Kinect on its top. Preferably a laptop too, incase you plan to improvise the hack.
Step3: Reverse engineer the RC car and its control system. Remove the cover of the remote control of the RC Car. Study how it works. We need to interface this remote control with the PC which process the depth data using kinect. There are various ways to do this. We used the parallel port available in the PC and used the data pins to control the remote control and thereby controlling the car. The main controls are "steer-left", "steer-right", "start", "stop". We can forget the other controls for the moment. Our aim is to build a car, which thinks on its own. An awakened machine :)
Step4: Install Parapin Library in the PC (Ubuntu).
How to install - http://parapin.cvs.sourceforge.net/viewvc/parapin/parapin/INSTALL
About parapin library - http://parapin.sourceforge.net/doc/parapin.html
Why the parapin Library ? We first wanted to do a laptop mounted car, so that it will have good coverage and it is more flexible. But the I/O program using USB to Parallel/Serial converters are a bit tricky and demanded more time and research. So we decided to go for the classic parallel cable communication to save time.
Step5: Hack ! Download the freenect library from github - https://github.com/OpenKinect/libfreenect .
We modified the glview.c in the examples directory to suit our need.
We also need to compile this file with parapin library headers. Modify the cmake file to do this. (Line No. 54)
Modifications in glview.c
For locating the obstacle , we divide the screen into three areas(Left,Center,Right).The following function returns which area a particular point is in:
Now in the glview main loop , we locate the area with minimum obstacle :
Download the modified CMakeLists.txt file
Download the modified glview.c file
Step6 : Compile the modified program, you can find the compiled executable in the examples directory itself.You will need to run it as a superuser for accesing the usb devices.Step7: Connect the parallel port cable to the remote. Port number 2,3 and 4. You can test the port numbers using an LED.
Step8: Powerup the remote control and switch on the car. Your car will have its own life.
Happy hacking. If you have any doubt, you can leave it as comment below.
Future of this hack
We have no plans to improvise this hack since more powerful hacks are available as opensource from the ROS user community. See the video given below.
This hack was part of the Driverless car project done by Divya R Pillai, Arun Asok, Varun K, Arun Ramesh and Aparna Rajeevan. They have successfully completed the project. If you want to do internship at foradian, contact us via [email protected]





