Need Help: FRC Labview with local USB-cam (or laptop Webcam)

I’m trying to get started with some imaging VI’s but I don’t want to have to be connected to the cRio and/or the IP-based Webcam they provided. The only “Camera-Open” that I can find is for the provided Axis cam, and it needs an IP addy.

I’d prefer to do some of my development with either the camera in the lid of my laptop, or some detachable USB webcam.

I’ve done some web-searching and all I’ve come up with so far are some tips on the NI developer forums that say I need to create a custom library reference to the camera’s DLL.

I’m hoping that somebody out here could point me in the right direction so I don’t have to go off and re-invent the wheel. Has anybody already done this? Is there a library/archive I could go search?

I’m running FRC Labview 8.5.1f5 on a HP Pavillion dv5 running Vista. The USB webcam that I’d use would be a Logitech.

Thanks!

to get pictures from a usb web cam the library that is needed is called
NI-IMAQ for USB Cameras
http://zone.ni.com/devzone/cda/epd/p/id/5030

only a few Vi’s need to be changed in your application, only to the point where it recieves the image

NI has more than one vision product, but only two that are shipped with FRC.

The two shipped with FRC are the Vision Analysis functions and Vision Assistant. I believe that you will find that Vision Assistant has support for USB cams, and should work with the ones you are asking about. This will allow you to view the camera image and grab individual images in order to inspect and build up simple algorithms inside Vision Assistant.

The part of IMAQ that provides the various camera protocols is the acquisition product. It supports many camera busses including USB. Ironically, it doesn’t support IP cameras, so it isn’t shipped with the FRC code as it wouldn’t really help much. Instead we wrote simple IP drivers in LV and C on top of TCP.

Your options are to see about downloading a copy of the IMAQ acquisition or perhaps the Suite. You’ll have a 30 day eval to fool around, and it should work with the USB camera, especially if Vision Assistant does. The other option is to use the Axis camera. The TCP driver will work on both desktop an the cRIO. One thing you may encounter is that various errors will come up when run on the desktop. This is because RT doesn’t report unwired errors, but desktop does. The errors I was seeing are spurious, and caused by the web server on the camera occasionally returning errors about being busy. In the future, those errors will be hidden from the WPI layer.

You will likely see a significantly larger lag from a USB camera than the Axis. You’ll also find that the setup and behavior of the camera to be quite different.

Greg McKaskle

on a fresh installation of frc labview, the vision assistant only has support for acquiring pictures from files (and ethernet i think), the imaq for usb enables that feature in the vision assistant and is not a trial.
The vis can also be used in labview, not just the VA

Thanks guys. Funny, bio, I was already at that page once, then clicked something on the left-hand side and never went back to it … I think it was the comments about the memory leak that initially scared me away.

The download installed correctly, now it’s up to me to figure out how to get it all to work! (I got the USB-IMAQ download, not the Vision Assistant)

I’m using the standard FRC bot template as a guide, but it’s still tricky. My standalone app doesn’t need all of those robot/competition conditional cases. So I’m picking up on why/when the template code is doing something, then trying to find a similar function in the USB-IMAQ library. It is definitely kicking it up a notch w.r.t. my fledgeling Labview skills.

Anybody have a sample VI using these USB IMAQ routines to gather and display video from a local cam?

This week I’ll get my hands on our cRio so I’ll be able to use the standard template code for the next few weeks, but one day the team will want the controller back … and I want to be able to work on some prototype vision algorithms without hogging a desired team resource.

Hey NI! Adding USB support to this year’s FRC distribution would be GREAT … I think biojae’s right … the '09 FRC LV installation only has the “Camera Open” function for the Apex IP camera. … at least that’s the only one that I could find.

Thanks again guys.

Is the Axis Camera the desired team resource or is the cRIO? I would recommend using the Axis camera if possible as (baring changes to the kit electronics) is the camera you actually want to be developing for.

The Axis camera can be connected directly to a computer via an ethernet cable and then be used with the Vision Assistant. You can also develop a Labview app for the desktop and interact with the camera using the provided FRC libraries. As Greg mentioned errors may appear on occasion, but they do not affect the functioning of the program.

I almost went down that path … I have the Axis camera at my house, and could’ve re-configured it to work on my home LAN.

It just seemed silly to be on my laptop in the living room, playing with a camera that was hooked to a 100’ ethernet cable that snaked back into my home office. … especially since I was staring at a camera right there in my laptop lid. (and not having the Axis power cord was another reason to try to get my webcam working)

I understand the desire to develop the apps using the same camera we’d use in competition, but I figured that I could still investigate various hi-level methods with any camera, then fine-tune those methods once I was back running on the 'bot.

This all becomes moot in a few days, when I get my team’s controller for the next few weeks. If I still don’t have a USB solution working when I give back the cRio, I’ll simply setup the Axis cam to work on my home network.

[edit] If I had the Axis power cord, I would’ve tried plugging it into my home router and reconfiguring it … I didn’t know that it’d work by plugging directly into my Laptop’s RJ45. I just assumed I had to plug it into my home router. My laptop’s RJ45 is inactive 99.99% of the time, I could reconfigure it to some dummy IP range without affecting it’s wireless surfing etc. This sounds like a very feasible option. Thanks for the tip.