![]() |
Programming for the Camera
Okay, so I've been working on Vision Processing in the off season, and I've built my LED light ring, and all that. Now, all I have to do is get the code to work. I'm using the Sample code for Java processing, the one where it filters out particles that are not red, and are smaller than a certain size. I've got the code to work with the images that have been loaded onto the cRIO, but I can't get an image capture. Now, I've gotten the camera to stream to the SmartDashboard, so the camera is working. The error I get is no camera image available. If I could get some assistance, that would be great. Thank you in advance.
|
Re: Programming for the Camera
My guess would be that the axis camera isn't at the IP that the Java program is looking at.
So the example makes the camera as follows: Axiscamera camera; <-- creates an instance in the class body camera = AxisCamera.getInstance(); <-- initializes it in the constructor The getInstance() method creates a new camera instance if one doesn't already exist. The code in the library is as follows. Code:
/**The getInstance method is overloaded. So if you don't want to change the IP of the camera, you should be able to define it by modifying the getInstance call in your example code as shown below Code:
camera = AxisCamera.getInstance("192.168.0.90"); |
Re: Programming for the Camera
I can stream the camera live feed to the smartDashboard by using the same IP that I use in the code. 10.38.81.11. I can post the code if that would be helpful.
|
Re: Programming for the Camera
Yes, please do.
|
Re: Programming for the Camera
I'm just using the example vision code, with a few minor alterations to get it to work.
Code:
package edu.wpi.first.wpilibj.templates; |
Re: Programming for the Camera
Let me add a few more details, as I have been attempting to help Ben on this one. getInstance() returns without error, and there appears to be some AxisCamera object there. However, getImage() throws an AxisCameraException.
|
Re: Programming for the Camera
The AxisCameraException thrown on getImage() is indicative of there being a connection problem.
Obviously your camera is on the network since you can connect to it, but maybe the username and password aren't right? For some reason the cRIO isn't able to connect to the device. I would suggest going through the camera setup instructions here: http://www.usfirst.org/sites/default...ystem_RevA.pdf If you're still having problems, can you describe how your devices are networked together? |
Re: Programming for the Camera
Quote:
|
Re: Programming for the Camera
I've done all of the setup for the Camera through the Camera set up tool. I have also enabled the anonymous viewing for the camera, so we can actually connect. I have also been able to "login" to the camera using a web browser, so the passwords I've used are correct, and I've not been asked to input passwords anywhere else, aside from the set up of the camera. I will see if I can go through the camera set up again tomorrow.
Sorry, I'm not familiar with all of the terminology, what exactly do you mean by how the devices are networked? |
Re: Programming for the Camera
Quote:
My assumption is that the cRIO and camera are plugged into your wireless bridge (in access point mode), and your laptop with the driverstation & dashboard on it is connected over wifi. IPs hopefully are likely as follows: cRIO - 10.xx.xx.2I just want to confirm my assumptions so that we don't overlook any obvious problems. Since you have communications between the laptop and crio, and the laptop and the camera, everything is probably physically wired together correctly. But it can't hurt to ask. |
Re: Programming for the Camera
Those assumptions are correct, although, I am not currently sure what the Classmate's IP is.
EDIT The Classmates IP is 10.38.81.5 if the classmate is wired up, and the IP is 10.38.81.6 if the classmate is tethered. |
| All times are GMT -5. The time now is 09:58. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi