Go to Post When I first read this comic, I thought "Awww, how cute!". But then, thoughts of Karthik singing J. Lo's "Love Don't Cost a Thing" started running around through my head, and everything changed. - Travis Hoffman [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 9 votes, 4.89 average. Display Modes
  #1   Spotlight this post!  
Unread 19-11-2010, 23:34
Ryan Gordon Ryan Gordon is offline
Registered User
FRC #2854 (EVHS Robotics)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: San Jose, CA
Posts: 40
Ryan Gordon is an unknown quantity at this point
Kinect LabView Drivers

Hello all,

Based on the work of the OpenKinect initiative, I've been able to begin to write drivers in LabView to interface with the Kinect.

For now I've got the following implemented:
  • Control LED Color
  • Control Motor Position (between +/- 31 degree)
  • View Servo Position
  • View Servo Speed
  • View Servo Status (Stopped/Reached Limits/Moving)
  • View Accelerometer data (ux,uy,uz)

Todo:
  • Turn on Depth & RGB Camera
  • Retrieve Depth & RGB Data
  • Retrieve Audio Data

LabView doesn't support isochronous USB transfer so that will make it harder to interface with the camera and audio data but not impossible.

I'll have source code and instructions available as soon as it I get the camera turned on and retrieving data from them. I'm hoping that this can be a learning experience and a research experience for everyone. It would be awesome to see some old FIRST robots lying around from previous competitions become a lot more autonomous with this technology.

I could see robots that could drive themselves around objects given a desired route, map an entire room, use facial recognition and voice commands to carry out tasks by specific individuals. I'm sure there's lots more useful applications for this type of technology.

All of the information and research that has gone into making this possible and more can be found at http://openkinect.org/

Source code soon!

Ryan
Attached Thumbnails
Click image for larger version

Name:	labview_kinect1.png
Views:	1467
Size:	36.3 KB
ID:	9432  
Reply With Quote
  #2   Spotlight this post!  
Unread 19-11-2010, 23:39
Andrew Schreiber Andrew Schreiber is offline
Data Nerd
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,057
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: Kinect LabView Drivers

How are you connecting the Kinect to the CRIO? I was going to work in a similar project but didn't want to commit funds until I figured out how to connect it.
__________________




.
Reply With Quote
  #3   Spotlight this post!  
Unread 20-11-2010, 00:15
Ryan Gordon Ryan Gordon is offline
Registered User
FRC #2854 (EVHS Robotics)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: San Jose, CA
Posts: 40
Ryan Gordon is an unknown quantity at this point
Re: Kinect LabView Drivers

It's actually just USB to my laptop at the moment, sorry I didn't make that clear beforehand. I don't have a cRIO available to me yet at the moment so I haven't had a chance to investigate that.

However, the USB interface is seriously complex, especially with the fact that we have to deal with isochronous transfers for video and audio. It might be possible to strip the USB and power cables and connect the data wires to the DIO board and the power distribution board respectively.

Just to note, the newer cRIO's have a USB interface port.
Reply With Quote
  #4   Spotlight this post!  
Unread 20-11-2010, 00:30
Andrew Schreiber Andrew Schreiber is offline
Data Nerd
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,057
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: Kinect LabView Drivers

Quote:
Originally Posted by Ryan Gordon View Post
Just to note, the newer cRIO's have a USB interface port.
They do? The NI 9074 I have at work (purchased less than 3 months ago) does not...
__________________




.
Reply With Quote
  #5   Spotlight this post!  
Unread 20-11-2010, 06:09
Ryan Gordon Ryan Gordon is offline
Registered User
FRC #2854 (EVHS Robotics)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: San Jose, CA
Posts: 40
Ryan Gordon is an unknown quantity at this point
Re: Kinect LabView Drivers

Check this one out: http://tinyurl.com/2bjsqx7

Either way we should look for a solution with the DIO board since that will probably be the most natural interface to work with when wiring up the Kinect. It would actually probably be pretty easy to put together a tutorial on creating a male usb to the individual power wire and the I/O wires that can be connected to the Kinect. Could be as simple as buying the Kinect legacy extension from Fry's or the like, and cutting off the ends of the wires, stripping them, and wiring them appropriately.

Last edited by Ryan Gordon : 20-11-2010 at 06:15.
Reply With Quote
  #6   Spotlight this post!  
Unread 20-11-2010, 07:16
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Kinect LabView Drivers

On the USB subject, the cRIO family has lots of variety, and some have a USB port. Last I checked, the USB stack exclusively supported the storage protocol. It was used to provide a file storage interface to a USB stick.

True, drivers for other device types could be written, but doing so for VXWorks and keeping the RT aspects in mind are not so easy, so the other device types will not be supported unless there is a good reason for NI to purchase or build the necessary drivers.

I wouldn't really worry about the USB issue though. Exploring and learning about the kinect using a laptop sounds like an incredibly beneficial journey. Please keep it up. And if you are interested in sharing your results, please consider also posting them to NIWeb as you may get a good number of power users interested.

Greg McKaskle
Reply With Quote
  #7   Spotlight this post!  
Unread 20-11-2010, 07:22
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: Kinect LabView Drivers

Quote:
Originally Posted by Ryan Gordon View Post
Check this one out: http://tinyurl.com/2bjsqx7

Either way we should look for a solution with the DIO board since that will probably be the most natural interface to work with when wiring up the Kinect. It would actually probably be pretty easy to put together a tutorial on creating a male usb to the individual power wire and the I/O wires that can be connected to the Kinect. Could be as simple as buying the Kinect legacy extension from Fry's or the like, and cutting off the ends of the wires, stripping them, and wiring them appropriately.
The problem is not in getting the Kinect physically wired to the cRIO, the problem is that the FRC cRIO does not have a USB Host Controller.

I could see someone getting a Kinect running on a robot using a mini-ITX motherboard with a SSD drive. Another option would be to get it running on a microcontroller. I will likely be working on using the Kinect with a Luminary Micro 3000 series chip at work sometime in the next few months, but I'm not certain I will have anything there before kickoff.
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
Reply With Quote
  #8   Spotlight this post!  
Unread 20-11-2010, 21:03
Ryan Gordon Ryan Gordon is offline
Registered User
FRC #2854 (EVHS Robotics)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: San Jose, CA
Posts: 40
Ryan Gordon is an unknown quantity at this point
Re: Kinect LabView Drivers

Quote:
Originally Posted by Greg McKaskle View Post
On the USB subject, the cRIO family has lots of variety, and some have a USB port. Last I checked, the USB stack exclusively supported the storage protocol. It was used to provide a file storage interface to a USB stick.

True, drivers for other device types could be written, but doing so for VXWorks and keeping the RT aspects in mind are not so easy, so the other device types will not be supported unless there is a good reason for NI to purchase or build the necessary drivers.

I wouldn't really worry about the USB issue though. Exploring and learning about the kinect using a laptop sounds like an incredibly beneficial journey. Please keep it up. And if you are interested in sharing your results, please consider also posting them to NIWeb as you may get a good number of power users interested.

Greg McKaskle
Ah, I did not consider that. Yes, it would be difficult to interface with the Kinect without a host USB controller.

I've attached my source code here even though it doesn't have depth or camera data working yet. I've certainly learned a lot from this experience, it's been really rewarding.

I'll probably end up changing it all up to use a dll generated from the https://github.com/OpenKinect/libfreenect/ library. LabView doesn't have isochronous USB support so that will be necessary in the end anyway but I wanted to see how far I could get with the raw VISA interface.

To setup the Kinect to your PC using the labview libraries you'll need to use the VISA Driver Wizard to create a NI-VISA driver for the Xbox NUI Motor and Xbux NUI Camera. Audio isn't necessary since at the moment it hasn't been reverse engineered yet.

Once that's been done it's as simple as open up core.vi and running it. If the Kinect is working and the driver was setup right it will autodetect the usb port it's running on and initialize the motor and accelerometer, etc.

http://ryangordon.net/libfreenect.zip

Uploading isn't working here for some reason.
Reply With Quote
  #9   Spotlight this post!  
Unread 03-12-2010, 02:46
ygd ygd is offline
Registered User
FRC #3341 (Manhattan Project)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: San Diego
Posts: 26
ygd is an unknown quantity at this point
Re: Kinect LabView Drivers

You could theoretically program the FPGA on the cRIO to act as a USB host, and from there, you could control the Kinect. I haven't actually tried it, but it seams feasable.
Reply With Quote
  #10   Spotlight this post!  
Unread 04-12-2010, 12:23
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Kinect LabView Drivers

Quote:
Originally Posted by ygd View Post
You could theoretically program the FPGA on the cRIO to act as a USB host, and from there, you could control the Kinect. I haven't actually tried it, but it seams feasable.
The FPGA could theoretically implement the host controller features, but you would still need a USB phy (physical layer interface) to host the USB electrically. Also, the host controller is terribly complex and not really a reasonable engineering approach. You would be far better off using a device that already has a USB host controller (such as the cRIO 9022 mentioned earler, a laptop, a TI Beagle Board, or even a Luminary (now TI) Stellaris part with USB OTG support).
Reply With Quote
  #11   Spotlight this post!  
Unread 26-12-2010, 04:18
Ryan Gordon Ryan Gordon is offline
Registered User
FRC #2854 (EVHS Robotics)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: San Jose, CA
Posts: 40
Ryan Gordon is an unknown quantity at this point
Re: Kinect LabView Drivers



I've got the LabView drivers fully working but still not completely stable yet. The dlls that run behind the scenes still need a lot of polishing but this is a great start so far. The next big challenge will be to find a reliable/easy way to get the Kinect to run through the cRIO as we wait for the dlls to stabilize.

I'll hopefully have the development source code up in my github repository within the next weeks.

Cheers,
Ryan

Last edited by Ryan Gordon : 26-12-2010 at 04:21.
Reply With Quote
  #12   Spotlight this post!  
Unread 27-12-2010, 23:01
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,357
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: Kinect LabView Drivers

Aside from getting the data into the c-rio, there is the raw computational power of doing anything useful with the data. Wouldn't a better strategy be getting the data back to the driver station lap top and do the processing there?
A 400 mhz power pc vs. a dual core x86? The c-rio could be by passed completely. A usb host controller interfaces to the kinect and then sends it by lan to the gaming router back to the laptop. First would have to change the
ruling on no lasers. I believe the Kinect has a true infrared laser. The kinect could have tremendous affect on our robots in the future. You may want to keep an eye on Microsoft's robotic studio. Word has it they may be releasing some drivers.
Reply With Quote
  #13   Spotlight this post!  
Unread 28-12-2010, 20:10
Ryan Gordon Ryan Gordon is offline
Registered User
FRC #2854 (EVHS Robotics)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: San Jose, CA
Posts: 40
Ryan Gordon is an unknown quantity at this point
Re: Kinect LabView Drivers

Quote:
Originally Posted by Gdeaver View Post
Aside from getting the data into the c-rio, there is the raw computational power of doing anything useful with the data. Wouldn't a better strategy be getting the data back to the driver station lap top and do the processing there?
A 400 mhz power pc vs. a dual core x86? The c-rio could be by passed completely. A usb host controller interfaces to the kinect and then sends it by lan to the gaming router back to the laptop. First would have to change the
ruling on no lasers. I believe the Kinect has a true infrared laser. The kinect could have tremendous affect on our robots in the future. You may want to keep an eye on Microsoft's robotic studio. Word has it they may be releasing some drivers.
This wasn't ever meant to be used during competition in FIRST The laser is a Level 1 Class laser but it's perfectly safe as there is a million safety features that PrimeSense and Microsoft built in to make sure it stays safe.

But the showstopper here is that there is too much interference with multiple Kinect's moving around. I'm just building this so I can make a robot do things by itself autonomously; The idea of true autonomy is very poorly implemented in FIRST, mainly because the complexity and lack of technology to make it more plausible. I quite think this would help others interested in exploring truly autonomous robots. Every year that passes by goes more decommissioned pieces of metal that never get put into competition again and I quite think this would make for some interesting projects with those old robots. That is certainly what I'd like to do off-season with them.

Last edited by Ryan Gordon : 28-12-2010 at 20:17.
Reply With Quote
  #14   Spotlight this post!  
Unread 29-12-2010, 00:05
Brandon_L Brandon_L is offline
The color orange triggers me
AKA: Brandon Liatys
FRC #2180 (Zero Gravity)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Newark, NJ
Posts: 1,195
Brandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond repute
Re: Kinect LabView Drivers

I am EXTREMELY interested in this. Do you plan on releasing it when its done?
__________________
FRC 2495 - Hamilton West Robotics [2007-2014] - whats a..."hive mind"?
FRC 3929 - Atomic Dragons [2012-2013]
FRC 2180 - Zero Gravity [2017-]

Just trying to collect all the possible team colors
Reply With Quote
  #15   Spotlight this post!  
Unread 29-12-2010, 03:05
SuperS_5's Avatar
SuperS_5 SuperS_5 is offline
[Certified LabVIEW Developer]
FRC #1219
 
Join Date: Dec 2010
Rookie Year: 2010
Location: Canada
Posts: 140
SuperS_5 will become famous soon enoughSuperS_5 will become famous soon enough
Re: Kinect LabView Drivers

Hi, this has grabbed my interest. I believe that LabVIEW does support isochronous connections. Although I could only find documentation on Firewire and isochronous data transfer, I have successfully used every USB webcam that I have tried with LabVIEW. The IMAQ USB drivers have to be installed. They are available to download from NI, but, I am unsure of any licensing. (I think only the NI Vision module has to be activated, not the drivers) If the device can be enumerated via USB devices, it should work via IMAQ USB capture.
__________________
Mike B
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
M$ Kinect controlling robots! basicxman FRC Control System 28 17-11-2010 23:33
Using Kinect to Design Your Robot JesseK General Forum 6 17-11-2010 13:03
Drivers JulieB General Forum 22 03-02-2005 13:23
drivers esellers Rules/Strategy 5 24-01-2003 08:46


All times are GMT -5. The time now is 03:42.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi