Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   USB Camera Solution (http://www.chiefdelphi.com/forums/showthread.php?t=134102)

Tyfighter98 06-02-2015 22:38

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.

JavaNoNothing14 07-02-2015 15:54

Re: USB Camera Solution
 
how do i create the object for the dashboard? where do i place the line of code?

Team3266Spencer 07-02-2015 16:47

Re: USB Camera Solution
 
Quote:

Originally Posted by JavaNoNothing14 (Post 1439799)
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.

Tyfighter98 07-02-2015 17:25

Quote:

Originally Posted by JavaNoNothing14 (Post 1439799)
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.

dominik.daners 07-02-2015 23:10

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.

Tyfighter98 08-02-2015 02:37

Quote:

Originally Posted by dominik.daners (Post 1440071)
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.

dominik.daners 08-02-2015 02:42

Re: USB Camera Solution
 
Just figured out what you meant my the intermediate image project. thx. I'll give it a a go.

daneelshof 08-02-2015 16:27

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?

Tyfighter98 08-02-2015 17:04

Quote:

Originally Posted by daneelshof (Post 1440319)
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.

schleprock 14-02-2015 13:44

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

Merfoo 15-02-2015 01:14

Re: USB Camera Solution
 
Quote:

Originally Posted by schleprock (Post 1443976)
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.

schleprock 15-02-2015 13:33

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??


All times are GMT -5. The time now is 03:35.

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