Go to Post Please drill responsibly! - IKE [more]
Home
Go Back   Chief Delphi > Technical > Electrical
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #31   Spotlight this post!  
Unread 26-01-2011, 22:03
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 511
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: Multiple Axis Cams?

sounds easy enough
  #32   Spotlight this post!  
Unread 28-01-2011, 12:06
321liftoff 321liftoff is offline
Registered User
FRC #0801
 
Join Date: Jan 2011
Location: Merritt Island, FL
Posts: 2
321liftoff is an unknown quantity at this point
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?

Last edited by 321liftoff : 28-01-2011 at 12:15.
  #33   Spotlight this post!  
Unread 03-02-2011, 11:34
elbuo elbuo is offline
Teams #2884 and #1144
AKA: Yamil Asusta
FRC #1144 (Coquitron)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Puerto Rico
Posts: 89
elbuo has a spectacular aura aboutelbuo has a spectacular aura aboutelbuo has a spectacular aura about
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.
__________________


  #34   Spotlight this post!  
Unread 03-02-2011, 11:49
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
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.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #35   Spotlight this post!  
Unread 03-02-2011, 13:05
321liftoff 321liftoff is offline
Registered User
FRC #0801
 
Join Date: Jan 2011
Location: Merritt Island, FL
Posts: 2
321liftoff is an unknown quantity at this point
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.
  #36   Spotlight this post!  
Unread 03-02-2011, 19:43
Anupam Goli's Avatar
Anupam Goli Anupam Goli is offline
PCH Q&A co-founder/Scouting Mentor
AKA: noops
FRC #1648 (G3 Robotics)
Team Role: Mentor
 
Join Date: Dec 2010
Rookie Year: 2008
Location: Atlanta, Georgia
Posts: 1,242
Anupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond reputeAnupam Goli has a reputation beyond repute
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.
__________________
Team 1002: 2008-2012
Team 1648: 2012-2016
Georgia Tech Class of 2016
  #37   Spotlight this post!  
Unread 04-02-2011, 01:06
keericks's Avatar
keericks keericks is offline
Registered User
AKA: Kent
FRC #1671 (Buchanan Bird Brains)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1998
Location: Clovis
Posts: 55
keericks is a glorious beacon of lightkeericks is a glorious beacon of lightkeericks is a glorious beacon of lightkeericks is a glorious beacon of lightkeericks is a glorious beacon of light
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?
  #38   Spotlight this post!  
Unread 04-02-2011, 01:15
waialua359's Avatar
waialua359 waialua359 is offline
Mentor
AKA: Glenn
FRC #0359 (Hawaiian Kids)
Team Role: Mentor
 
Join Date: Apr 2003
Rookie Year: 2000
Location: Waialua, HI
Posts: 3,316
waialua359 has a reputation beyond reputewaialua359 has a reputation beyond reputewaialua359 has a reputation beyond reputewaialua359 has a reputation beyond reputewaialua359 has a reputation beyond reputewaialua359 has a reputation beyond reputewaialua359 has a reputation beyond reputewaialua359 has a reputation beyond reputewaialua359 has a reputation beyond reputewaialua359 has a reputation beyond reputewaialua359 has a reputation beyond repute
Re: Multiple Axis Cams?

team 375 used two cameras and got lots of awards for it, in 2007.
__________________

2016 Hawaii Regional #1 seed, IDesign, Safety Award
2016 NY Tech Valley Regional Champions, #1 seed, Innovation in Controls Award
2016 Lake Superior Regional Champions, #1 seed, Quality Award, Dean's List
2015 FRC Worlds-Carver Division Champions
2015 Hawaii Regional Champions, #1 seed.
2015 Australia Regional Champions, #2 seed, Engineering Excellence Award
2015 Inland Empire Regional Champions, #1 seed, Industrial Design Award
2014 OZARK Mountain Brawl Champions, #1 seed.
2014 Hawaii Regional Champions, #1 seed, UL Safety Award
2014 Dallas Regional Champions, #1 seed, Engineering Excellence Award
2014 Northern Lights Regional Champions, #1 seed, Entrepreneurship Award
2013 Championship Dean's List Winner
2013 Utah Regional Champion, #1 seed, KP&B Award, Deans List
2013 Boilermaker Regional Champion, #1 seed, Motorola Quality Award
2012 Lone Star Regional Champion, #1 seed, Motorola Quality Award
2012 Hawaii Regional Champions #1 seed, Motorola Quality Award
  #39   Spotlight this post!  
Unread 04-02-2011, 09:54
jcbc's Avatar
jcbc jcbc is offline
Registered User
AKA: Julie
no team
 
Join Date: Aug 2010
Rookie Year: 2011
Location: PA
Posts: 53
jcbc is a jewel in the roughjcbc is a jewel in the roughjcbc is a jewel in the roughjcbc is a jewel in the rough
Re: Multiple Axis Cams?

Quote:
Originally Posted by keericks View Post
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.
  #40   Spotlight this post!  
Unread 06-02-2011, 10:35
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,756
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: Multiple Axis Cams?

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
Attached Files
File Type: vi Read MJPG.vi (24.3 KB, 53 views)
  #41   Spotlight this post!  
Unread 13-07-2011, 11:59
computergeek125's Avatar
computergeek125 computergeek125 is offline
Registered User
FRC #3727
 
Join Date: Jul 2011
Rookie Year: 2011
Location: Texas
Posts: 2
computergeek125 is an unknown quantity at this point
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.
  #42   Spotlight this post!  
Unread 01-08-2011, 16:50
computergeek125's Avatar
computergeek125 computergeek125 is offline
Registered User
FRC #3727
 
Join Date: Jul 2011
Rookie Year: 2011
Location: Texas
Posts: 2
computergeek125 is an unknown quantity at this point
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".
  #43   Spotlight this post!  
Unread 30-08-2011, 07:49
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,114
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: Multiple Axis Cams?

reported
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android
Closed Thread


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


All times are GMT -5. The time now is 20:55.

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