Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Electrical (http://www.chiefdelphi.com/forums/forumdisplay.php?f=53)
-   -   Multiple Axis Cams? (http://www.chiefdelphi.com/forums/showthread.php?t=89368)

tomy 26-01-2011 22:03

Re: Multiple Axis Cams?
 
sounds easy enough

321liftoff 28-01-2011 12:06

Re: Multiple Axis Cams?
 
Has anyone had any success with viewing two cameras on the Driver Station?

We are using LabVIEW. Our setup has two Axis cameras (10.xx.yy.90 and 10.xx.yy.91 addresses) on the D-Link with the cRIO (10.xx.yy.2 address). We can put either of the camera addresses as an input to the "Camera Open" VI in the "Begin". Each camera functions correctly when setup this way.

Our idea is to have the robot send one camera feed, then have the user press a button to switch cameras and start sending the other camera feed. We are only using the cameras for the drivers to get a better view, not to do image processing.

Implementation #1
We put .90 in the Begin code to start sending camera images to the Driver Station. In the Vision processing, we setup some code to run "Camera Close" on the current camera reference and run "Camera Open" on the .91 address when a joystick button is pressed.

When running the code, the camera sends images as normal. When the button is not pressed, the .90 camera continues to send images. When the button press occurs, the "Camera Close" code seems to lock up our program and no images are sent.

We haven't delved too deep into the camera code, but we think that the "Camera Close" code kills the camera's connection to the Driver Station. Can someone confirm?

Implementation#2
Another idea is to modify the driver station and have a webbrowser view the camera feed and we could switch between camera feeds on the dashboard. We think this implementation would be technically feasible and would actually provide a better image for the team. It would also take the cRIO out of the imaging loop. Is viewing the Axis camera by webbrowser instead of through the cRIO/Dashboard interface allowed by the rules? Will sending the camera data by this method consume too much bandwidth for the Field Management System?

elbuo 03-02-2011 11:34

Re: Multiple Axis Cams?
 
Have you tried this already?

I think method #1 would be the way to go. Just don't close the camera before the end and you will be fine.

apalrd 03-02-2011 11:49

Re: Multiple Axis Cams?
 
If you dig deep enough into the camera VI's, you will see that it gets the image over HTTP from the camera. If you find the right VI's (WPI_CameraIsssue HTTP Request With Authentication.vi and WPI_CameraRead JPG.vi especially), you can make copies of them (with different names) in your code folder, modify them all to call the correct copy, and use them on the Dashboard to get the image directly from the camera.

If you had WPI_CameraIssue HTTP Request With Authentication.vi, WPI_CameraRead JPG.vi, and WPI_CameraDecodeJPEGString.vi, you could get the image as a LabVIEW image and use it just like any other part of the Dashboard.

This would require that both cameras were directly connected to the D-Link router, and not the cRio. It would probably be faster than running through the cRio anyway. Since all communications to the camera happens on port 80, it is allowed by the field.

Super important note: The cRio would have no control of the cameras at all. The Dashboard information packet would have to include which camera to use.

321liftoff 03-02-2011 13:05

Re: Multiple Axis Cams?
 
Thanks for the detail! Here's what we ended up implementing:

We put a webpage window on the dashboard using code from Labview's Example Finder: see the link here. We created two html files, one for each camera, using the htmlcode provided by Axis to connect to the camera video feed over http. I used the code from the link above because it removed all text and borders around the video feed. We put a switch in the dashboard code to switch between these two html files within the one webpage window, causing the video feed to switch. The quality is definitely better than that of the feed provided by cRIO processing.

Using the existing VIs, as you suggest, to get the images may be a simpler solution because you don't have to mess with managing html files separate from the Labview dashboard code.

Anupam Goli 03-02-2011 19:43

Re: Multiple Axis Cams?
 
I was actually thinking of just running a firefox window in the background with a laptop of resolution 1920 x 1080, but i knew that probably wouldn't take me far.

keericks 04-02-2011 01:06

Re: Multiple Axis Cams?
 
I've seen a couple of folks in this thread inquiring about running the camera directly through the switch (legally bypassing the cRio) and then viewing the stream via web browser session on the driver station pc. Is the use of simple web browser legal, or must we rewrite the dashboard to accommodate connecting to the camera via the switch?

waialua359 04-02-2011 01:15

Re: Multiple Axis Cams?
 
team 375 used two cameras and got lots of awards for it, in 2007.

jcbc 04-02-2011 09:54

Re: Multiple Axis Cams?
 
Quote:

Originally Posted by keericks (Post 1015365)
I've seen a couple of folks in this thread inquiring about running the camera directly through the switch (legally bypassing the cRio) and then viewing the stream via web browser session on the driver station pc. Is the use of simple web browser legal, or must we rewrite the dashboard to accommodate connecting to the camera via the switch?

I haven't seen anything in the rules saying that we can't connect to the camera over HTTP 80 or HTTP 443 using a Web browser. That's what we're planning on doing. We make the camera feed full screen from the browser and then put the Driver Station window on top of the full screen feed. The Driver Station covers the bottom part of the camera feed (we're going to test to make sure we still see enough of the camera view to be useful), but the rules state that the Driver Station must be visible throughout a match so we have to have it on the screen too.

Greg McKaskle 06-02-2011 10:35

Re: Multiple Axis Cams?
 
1 Attachment(s)
decibel.ni.com seems to be down, but there should soon be a tutorial up about integrating mpg support into the dashboard. I've attached the core VI and I'll explain how it is used.

This VI expects for the camera to be plugged into the switch and be accessible to the dashboard. The camera needs a team IP such as 10.te.am.11. When correct, you will be able to log into the camera from other te.am computers such as the dashboard, programming laptops, etc. You log into it by typing the IP address into the web browser, and the camera will ask for a login and will show test image and let you change settings.

You will also be able to use NI Vision Assistant to the camera without any cable or IP changes. Just type the camera IP into the field inside Vision Assistant. You don't even need code or a cRIO, just power to the camera and dlink.

Finally, the attached VI is a replacement for the Get Image From Controller VI in the default dashboard. This VI will initiate an MJPG stream with the camera, and process it just a bit differently than the Read JPG that apaird mentioned. The IP needs to the be the camera IP, not the cRIO. Also, if you change parameters to the session, you should reopen the connection.

I haven't used this enough to know exactly how this will interact with any jpg requests from the cRIO, but if this is used exclusively for dashboard updates, it has performance advantages in that it allows the camera to overlap acquisitions with other operations. I was able to use three camera at 640x480 at near 30fps. The limit was the old laptop's ability to decode the images.

Greg McKaskle

computergeek125 13-07-2011 11:59

Re: Multiple Axis Cams?
 
We don't have two cameras to use, but our robot is configured to do so. I've actually got our camera and vision processing to run directly from the dashboard, while [attempting] to send the vision state back to the robot for processing. The ReadMJPEG.vi is helpful in this process! Before I came to this, i figured out that the Open Camera.vi will target a connection on cRIO port 1 when I changed the IP of the camera to 10.xx.yy.8. So, the camera was on the D-LINK for access from a computer if need be. As for power, the Axis camera ended up next to the 5v converter for the D-LINK physically, so it got tied in to that circut. THIS PASSED INSPECTION. If we ever added another camera, it could be put on the 5v regulated output on the power distribution board, and be connected to the D-LINK for net access, probably on 10.xx.yy.9. Images that come through on Read MJPEG.vi also are more in real-time, rather than a slight delay. Modifying the Image Processing.vi was as simple as getting rid of the access camera Device Reference, changing the "Original" display to be a control (right-click menu), and connecting the new control to one of the pins on the Vision Processing.vi icon. Then wire the output of Read MJPEG.vi to that pin (assuming that Vision Processing is now in the loop on the dashboard that has all of the vision stuff)

As for simultaneous image requests, I have not experimented with the Read MJPEG.vi either, but I do know that the cRIO image stream (Open Camera.vi / Get On PC.vi) stops when I log in as an HTML user with a web browser, however, 2 computers using HTML can simultaneously view the image stream. I assume the Read MJPEG.vi works similarly.

computergeek125 01-08-2011 16:50

Re: Multiple Axis Cams?
 
EDIT TO ABOVE POST:
The loop condition terminal IN the Vision Processing.vi (the stop sign, probably at the bottom right of the while loop) needs to have a boolean false constant instead of a true, or you could just remove the loop by right-clicking the gray part, and selecting "Remove while loop".

plnyyanks 30-08-2011 07:49

Re: Multiple Axis Cams?
 
reported


All times are GMT -5. The time now is 07:27.

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