Go to Post I have to remind myself you guys are from Kansas when I hear the country music...I'm not even sure any Texas Teams do that ;) - JohnSchneider [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 06-02-2015, 22:38
Tyfighter98's Avatar
Tyfighter98 Tyfighter98 is offline
Software Lead
FRC #3255 (Super NURDs)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: California
Posts: 17
Tyfighter98 is an unknown quantity at this point
USB Camera Solution

After many hours of trial and error we managed to get the USB camera to work while running the Smart Dashboard (Java). All you need to do is create a new project example for Intermediate Vision and delete lines 39, 44, & 45 (just draws a circle on the viewer of the camera). You will have some unused imports so removed those and then just make sure you have created the object in Smart Dashboard and you will be set.
  #2   Spotlight this post!  
Unread 07-02-2015, 15:54
JavaNoNothing14 JavaNoNothing14 is offline
Registered User
FRC #2681
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2012
Location: Brooklyn, NY
Posts: 12
JavaNoNothing14 is an unknown quantity at this point
Re: USB Camera Solution

how do i create the object for the dashboard? where do i place the line of code?
  #3   Spotlight this post!  
Unread 07-02-2015, 16:47
Team3266Spencer's Avatar
Team3266Spencer Team3266Spencer is offline
Team Captain and Lead Programmer
AKA: Spencer Lanman
FRC #3266 (Robots-R-US)
Team Role: Programmer
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Richmond, Indiana
Posts: 280
Team3266Spencer is an unknown quantity at this point
Re: USB Camera Solution

Quote:
Originally Posted by JavaNoNothing14 View Post
how do i create the object for the dashboard? where do i place the line of code?
You add the USB Camera widget in the dropdown in the smart dashboard program.
__________________
2012: Buckeye Regional, Queen City Regional, Human Player
2013: Queen City Regional, Buckeye Regional, Crossroads Regional
Shooter Operator
2014: Crossroads Regional, Queen City Regional
Catapult Operator
2015: Georgia Southern Classic Regional (Winner), Queen City Regional
Chainsaw Operator
Want to talk? TeamSpeak: team3266.noip.me
  #4   Spotlight this post!  
Unread 07-02-2015, 17:25
Tyfighter98's Avatar
Tyfighter98 Tyfighter98 is offline
Software Lead
FRC #3255 (Super NURDs)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: California
Posts: 17
Tyfighter98 is an unknown quantity at this point
Quote:
Originally Posted by JavaNoNothing14 View Post
how do i create the object for the dashboard? where do i place the line of code?
You can pretty much put the code from the example robot into the Robot.java class. Just pay attention to where each part is location in such as robotInit and what not. There are other ways you can add the code for different results but that is up to the individual teams.
  #5   Spotlight this post!  
Unread 07-02-2015, 23:10
dominik.daners's Avatar
dominik.daners dominik.daners is offline
Member
FRC #4729 (E.M.U (Experimental Mayhem Unit))
Team Role: Mechanical
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Australia
Posts: 19
dominik.daners is an unknown quantity at this point
Re: USB Camera Solution

When you say USB Camera Solution, where do you plug the camera into? The NiRIO?
Also, I have tried using the smart dashboard before without any success (I rage quit), can you give us the line of code required to do this?

thx.
  #6   Spotlight this post!  
Unread 08-02-2015, 02:37
Tyfighter98's Avatar
Tyfighter98 Tyfighter98 is offline
Software Lead
FRC #3255 (Super NURDs)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: California
Posts: 17
Tyfighter98 is an unknown quantity at this point
Quote:
Originally Posted by dominik.daners View Post
When you say USB Camera Solution, where do you plug the camera into? The NiRIO?
Also, I have tried using the smart dashboard before without any success (I rage quit), can you give us the line of code required to do this?

thx.
I am referring to plugging the camera into the roboRIO. And like I said previously, just create the intermediate vision example project and delete the lines of code I listed in the root post.
  #7   Spotlight this post!  
Unread 08-02-2015, 02:42
dominik.daners's Avatar
dominik.daners dominik.daners is offline
Member
FRC #4729 (E.M.U (Experimental Mayhem Unit))
Team Role: Mechanical
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Australia
Posts: 19
dominik.daners is an unknown quantity at this point
Re: USB Camera Solution

Just figured out what you meant my the intermediate image project. thx. I'll give it a a go.
  #8   Spotlight this post!  
Unread 08-02-2015, 16:27
daneelshof's Avatar
daneelshof daneelshof is offline
Programming Mentor
FRC #1619 (Up-A-Creek Robotics)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Broomfield, Colorado
Posts: 30
daneelshof has a spectacular aura aboutdaneelshof has a spectacular aura about
Re: USB Camera Solution

This seems to be working for us! We're using the command-based robot code, so it took a little bit of rejigging to use it.

We're running the image grabbing in Teleop Periodic and only every tenth call. Otherwise we had issues with not sending CAN commands to the Talons often enough. The frame rate of the camera is extremely low because of this. Anyone have any ideas on improving performance?
  #9   Spotlight this post!  
Unread 08-02-2015, 17:04
Tyfighter98's Avatar
Tyfighter98 Tyfighter98 is offline
Software Lead
FRC #3255 (Super NURDs)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: California
Posts: 17
Tyfighter98 is an unknown quantity at this point
Quote:
Originally Posted by daneelshof View Post
This seems to be working for us! We're using the command-based robot code, so it took a little bit of rejigging to use it.

We're running the image grabbing in Teleop Periodic and only every tenth call. Otherwise we had issues with not sending CAN commands to the Talons often enough. The frame rate of the camera is extremely low because of this. Anyone have any ideas on improving performance?
I noticed the frame rate issue as well. I know FIRST regulates the amount of data you can send so it may not be possible to improve it.
  #10   Spotlight this post!  
Unread 14-02-2015, 13:44
schleprock's Avatar
schleprock schleprock is offline
Code Jockey
FRC #4905 (AndromedaOne)
Team Role: Mentor
 
Join Date: Feb 2015
Rookie Year: 2014
Location: massachusetts
Posts: 21
schleprock is an unknown quantity at this point
Question Re: USB Camera Solution

we just got some ms lifecam hd-3000 cameras and we're getting an exception thrown from the vision code with no camera output. i'm using the intermediate vision example with the lines indicated in a previous post deleted. the exception is:

Unhandled exception: VisionException [com.ni.vision.VisionException: IMAQdxError: -1074360311: Camera not found] at [com.ni.vision.NIVision._IMAQdxOpenCamera(Native Method), com.ni.vision.NIVision.IMAQdxOpenCamera(NIVision.j ava:24455), org.usfirst.frc.team4905.robot.Robot.robotInit(Rob ot.java:27), edu.wpi.first.wpilibj.SampleRobot.startCompetition (SampleRobot.java:121), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:234)]

does anyone have any suggestions for fixing this?? i'm using the latest eclipse plugin's from wpi.

also i verified that the webcamera is working by plugging it into my laptop and viewing it.

thanks

Last edited by schleprock : 14-02-2015 at 13:51. Reason: new info
  #11   Spotlight this post!  
Unread 15-02-2015, 01:14
Merfoo's Avatar
Merfoo Merfoo is offline
Registered User
FRC #0955 (CV Robotics)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2012
Location: America
Posts: 48
Merfoo is an unknown quantity at this point
Re: USB Camera Solution

Quote:
Originally Posted by schleprock View Post
we just got some ms lifecam hd-3000 cameras and we're getting an exception thrown from the vision code with no camera output. i'm using the intermediate vision example with the lines indicated in a previous post deleted. the exception is:

Unhandled exception: VisionException [com.ni.vision.VisionException: IMAQdxError: -1074360311: Camera not found] at [com.ni.vision.NIVision._IMAQdxOpenCamera(Native Method), com.ni.vision.NIVision.IMAQdxOpenCamera(NIVision.j ava:24455), org.usfirst.frc.team4905.robot.Robot.robotInit(Rob ot.java:27), edu.wpi.first.wpilibj.SampleRobot.startCompetition (SampleRobot.java:121), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:234)]

does anyone have any suggestions for fixing this?? i'm using the latest eclipse plugin's from wpi.

also i verified that the webcamera is working by plugging it into my laptop and viewing it.

thanks
Does the name of the camera that shows up on the roborio web interface match the one that is being supplied in the code? The name of the camera in the code is "cam0", but it may be something else. To find the name of the camera go to "roborio-xxxx.local/" in a web browser where the x is your team numbers, which would be "roborio-4905.local/" for you.

Last edited by Merfoo : 15-02-2015 at 01:16.
  #12   Spotlight this post!  
Unread 15-02-2015, 13:33
schleprock's Avatar
schleprock schleprock is offline
Code Jockey
FRC #4905 (AndromedaOne)
Team Role: Mentor
 
Join Date: Feb 2015
Rookie Year: 2014
Location: massachusetts
Posts: 21
schleprock is an unknown quantity at this point
Re: USB Camera Solution

because the CameraServer is throwing an exception when it's trying to create the instance there is no "Cam0" or anything else. i had another webcam "sortof" working a few weeks ago, at least it did not throw this exception just a different problem when it tried to stream. i was reasonably sure the problem was no support for that camera. so we bought the "supported" webcam and now i get this exception. my guess is that the latest update to the firmware for the roborio has broken the webcam ability. unless someone else has it working on the newest wpi plugins??
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 19:34.

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