PDA

View Full Version : Connecting Axis camera to cRIO


laultima
01-05-2009, 08:13 PM
We've been having problems getting video data from the Axis camera. Weve set the user and password to FRC, connected with the crossover cable, and tried setting the IP on the camera to both dynamic and static 192.168.0.90, but to no avail. We loaded the DashboardDemo program from Windriver to the cRIO and launched a dashboard from LabView, and all we get on dashboard is the field state and battery voltage.

kyungjin
01-05-2009, 08:33 PM
I'm in pretty much the same predicament as you. So far, we can only get the camera working when its directly plugged into the PC via direct crossover connection (in both NI Vision Assistant and live camera setup). Whenever we plug into the cRIO, the camera isn't recognized by the VA (we get a "Check IP/Cable" error message).

Aside from that, does anyone know how to program the camera to track certain colors or geometric shapes? We're using WindRiver to program using C++ and I can't find a program that will allow us to easily configure the colors and the shapes of the "blobs" we want to track. So I guess simply put, my question is... What program do we use to configure the camera and how will I be able to implement it into my source code?

legend
01-05-2009, 09:52 PM
Did you try reseting the camera to factory defaults? Try that out, and when asked for a username and password use root/pass.

laultima
01-06-2009, 12:32 AM
The camera was reset to defaults today, with the 2 accounts and passwords on it being root/admin and FRC/FRC respectively, does it need the root password to be "pass"?

whitetiger0990
01-06-2009, 01:12 AM
You should hook it to your computer and run Setup Axis Camera. It'll prepare it for you to hook to your cRIO. Past that, I'm really not sure. We use LabVIEW though. We were able to put it on the same subnet as the laptop and then run that utility, plug it into the cRIO and it worked nicely.

kyungjin
01-06-2009, 02:17 AM
I can run the Setup Axis Camera when the camera is directly connected to the computer. It just doesn't like to play nice with the cRIO when connected... I can't get anything to work when it's plugged into the second ethernet port on the cRIO.

laultima
01-06-2009, 02:28 AM
Weve also successfully run the Setup Axis Camera utility, but it still wont work with the cRIO. Im not sure, but I think the only thing that utility does is to add the FRC username to the camera.

kyungjin
01-06-2009, 07:21 AM
Weve also successfully run the Setup Axis Camera utility, but it still wont work with the cRIO. Im not sure, but I think the only thing that utility does is to add the FRC username to the camera.

Really? We had to do that ourselves to get the program running. We're still not sure how it "sets-up" the camera in the first place...

Greg McKaskle
01-06-2009, 07:34 AM
The Camera setup utility uses the http requests on the camera to automate adding an account that the rest of the library can then use.

Creating an account by hand name:FRC and password:FRC would be equivalent. Without this, the first time you connect to the camera via web server, it will prompt to set the root accounts password, and since most will type in something different to the single account on the camera, the robot SW would then need to know your password, know how to encrypt, etc.

The FRC, FRC should allow your code to access the camera.

To see if the camera is working, I'd start with the single color vision example, but modify it to print the size of the particle, then widen the hue and saturation and luminance pretty far out if you need to. If you are getting something other than zero, the camera is working.

Greg McKaskle

kyungjin
01-06-2009, 07:42 AM
Right now though... We can't even configure the camera to play with the cRIO. Everytime we connect it, we can never establish any connection via NI Vision Assistant or any other programs to get live feed data from the camera. As for the creating the account, we've already set the camera to have an account called FRC with a password of FRC so I think we've been able to pass that... As for the Camera Setup Utility, we've successfully ran that too when the camera is directly connected to the computer via Xover cable.

The problem for us though is that the camera isn't accessible when it's connected to the cRIO. Any ideas on how I can configure the camera or my PC so I can get data from the camera?

By the way... As a side question... I'm using WindRiver... Am I still using NI Vision Assistant to configure the camera to track colors/shapes/etc. or is there another program that is going to manage that? Right now... These two problems are giving me a major migrain...

omalleyj
01-06-2009, 08:45 AM
kyungjin:
I am using the VisionDemo that came with the example code for WindRiver and it tracks a red object (Santa Hat :) ) without any trouble.
Try using that and see if it works for you. All you need to do is create a new project from example code. There is an enum with several colors and luminance values predefined in one of the headers. Going through the example code should tell you what you need to know.

laultima:
It (the demo) is not sending actual video frames anywhere, just analyzing them, but this would tell you if the firmware recognizes and controls the camera properly.

hth
good luck!
Jim

kyungjin
01-06-2009, 09:23 AM
I believe I've tried this and it didn't work... Is your camera recognized by NI Vision Assistant? I guess a better question would be whether NI VA is needed at all? Right now... I don't think the camera is being recognized at all... How do you know if you're camera has been configured correctly and how will you be able to determine the colors/shapes that you want to recognize in the game?

omalleyj
01-06-2009, 12:38 PM
I have not used the Vision Assistant.
I setup the vision demo in WindRiver, changed the debug flag to output to the console, built and loaded it. Flip the DS switch to autonomous and the output is visible in the console. I have a laptop connected directly to the serial port and if there is a red object in the camera's field it give the XY coordinates. When a pan/tilt servo is connected to the PWM 3 & 4 it moves the camera to track the object. I did need to fiddle with the tracking a little, the tilt was inverted, but otherwise it works out of the box.

Also, make sure your camera is focused by connecting directly to a PC. Ours was very out of focus as received, that might be messing some people up.

kyungjin
01-06-2009, 02:34 PM
When you said that you output directly to the console... Does the console mean the DSU screen or a console window is WindRiver?

Also, can I ask how your network has been set up? Mine is:

PC -> DSU -> Router ~> Wireless Adapter -> cRIO ePort 1
cRIO ePort2 => Camera

Where -> is a regular ethernet connection...
~> is a wireless connection...
=> is a crossover connection...

Jill
01-19-2009, 12:06 PM
I'm having the same problem.

The camera is connected via crossover cable to the cRIO. It's in a wireless configuration, and I can "ping" the first cRIO port, 10.21.97.2, but not the second one, 192.168.0.3, which is the problem. (When the camera is hooked directly to my computer, I can see a live feed, but when I do that, the static IP address has to be different.)

Is there a setting on my computer that's wrong? Right now, I have it set to a static IP of 10.21.97.6.

Russ Beavis
01-19-2009, 12:10 PM
You can't ping "through" the cRIO. The only way to obtain images when it's connected to the cRIO is by having the cRIO redirect the data. I don't believe that you'll be able to open a web browser and "see" the camera. Check out the default Basic Robot Main VI and the Dashboard app to see how they do it. The Dashboard displays camera images for you (although this port will be disabled, I believe, during competition).

Russ

Kory
01-19-2009, 01:05 PM
I am having the same issue as Jill. The camera works when connected to everything but port 2 on the cRIO. Our team captain talked to a network guru who told him that it will not work because of a subnet error. All the devices besides port 2 on the cRIO have an IP of 10.xx.yy.zz (xxyy is based on the team number, zz is decided by what device it is) Port 2 on the cRIO however, is 192.168.0.3. I'm not sure if this is correct but he said when a subnet mask is set to 255.255.255.0 it means ignore the first three sets on numbers because they are the same. However the first three numbers of port 2 on the cRIO are not the same. I believe this is what's causing the problem. Is there a way to change the IP adress on port 2 of the cRIO. The documentation says there is but doesn't specify exactly how. Do any of you have it working with 192.168.0.3? Did you configure it that way or is that the default? I am out of ideas.

Jill
01-19-2009, 04:18 PM
I did get it to work... thanks Russ Beavis!

Kory- can you get to the camera to work when it's plugged directly into your computer? If it's all set up properly, when you plug it into port 2 on the cRIO, the cRIO "redirects" the feed. Run an example tracking program on LabView and see if that works. You cannot go directly to the camera with a browser.

EDIT: New issue... I can get a live feed in LabView, but it's red and black, and pixelated. I'm using the LV color-tracking example. I can see vague outlines of my hand when I wave in front of the camera. It's not a focus problem- it's clear when it's plugged directly into the computer. I've tried adjusting the color settings, but it's not any clearer, and it's still only red. Are there other settings somewhere that I haven't configured properly?

Greg McKaskle
01-20-2009, 09:37 AM
What you describe sounds like the Find Color example's display. The image being displayed isn't what is sent back from the camera, but has been thresholded to only show a mask of certain colors. To see the unaltered image, you can flip to the example's diagram and probe using a right click menu on the purple wire between Get Image and Find Color.

Or you can move forward with the example. Hold something colored near the camera. Choose the Red, Green, or Blue hint, and hit the calibrate button.

You can also play with the color space by going to the knob and slider pane or to the HSL numbers pane.

That is about it for that example. The gimbal/servo one is probably the next to go to once the color numbers make sense.

Greg McKaskle

Steve Ketron
01-21-2009, 09:42 AM
Our camera was working for the last two weeks on port 2 of the cRIO. We tried working with it this morning and LabVIEW would not find the camera. The AXIS software will not bring up the camera when plugged into the cRIO port 2 either. We can plug the camera directly into the router and find it. Does anyone have a quick fix for the cRIO?

Greg McKaskle
01-21-2009, 04:56 PM
Just a guess, but if you disconnected and are no longer using the orange crossover cable, it would work with a PC, due to auto sensing, but not with the cRIO.

Greg McKaskle