|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
My team has been trying to get an Axis Camera (M1011) working for about a week now, with little success.
The Axis Camera light blinks green (we configured it to do that when it was being accessed), but the SmartDashboard "CameraServer Stream Viewer" displays red with "NO CONNECTION" text in the top left, for both the "Rectangle" and "Axis Camera" drop-downs that appear in the properties window. We are running this code, with the camera static addressed at 10.3.3.31. Code:
public void enableRawCam() {
rawThread = new Thread(() -> {
rawCamera = CameraServer.getInstance().addAxisCamera("10.3.3.31");
rawCamera.setResolution(160, 120);
rawCvSink = CameraServer.getInstance().getVideo();
rawOutputStream = CameraServer.getInstance().putVideo("Rectangle", 160, 120);
rawMat = new Mat();
while(!Thread.interrupted()) {
String sdOutput = runRawCam();
SmartDashboard.putString("vision thread output", sdOutput);
}
});
rawThread.setDaemon(true);
rawThread.start();
}
public String runRawCam() {
if(rawCvSink.grabFrame(rawMat)==0) {
rawOutputStream.notifyError(rawCvSink.getError());
return "errored";
} else {
rawOutputStream.putFrame(rawMat);
return "did not error";
}
}
enableRawCam() is run in the constructor of another class, which is initialized in robotInit(). No errors display in the driverstation, but when we FTP into the Rio and get the log, we get errors as follows: Code:
Exception in thread "CSListener" VideoException [edu.wpi.cscore.VideoException: wrong property type] at edu.wpi.cscore.CameraServerJNI.getEnumPropertyChoices(Native Method) at edu.wpi.first.wpilibj.CameraServer.lambda$new$0(CameraServer.java:432) at edu.wpi.first.wpilibj.CameraServer$$Lambda$2/5854261.accept(Unknown Source) Exception in thread "CSListener" VideoException [edu.wpi.cscore.VideoException: wrong property type] at edu.wpi.cscore.CameraServerJNI.getEnumPropertyChoices(Native Method) at edu.wpi.first.wpilibj.CameraServer.lambda$new$0(CameraServer.java:432) at edu.wpi.first.wpilibj.CameraServer$$Lambda$2/5854261.accept(Unknown Source) Exception in thread "CSListener" VideoException [edu.wpi.cscore.VideoException: invalid property] at edu.wpi.cscore.CameraServerJNI.getPropertyMin(Native Method) at edu.wpi.first.wpilibj.CameraServer.putSourcePropertyValue(CameraServer.java:313) at edu.wpi.first.wpilibj.CameraServer.lambda$new$0(CameraServer.java:418) at edu.wpi.first.wpilibj.CameraServer$$Lambda$2/5854261.accept(Unknown Source) Default IterativeRobot.disabledInit() method... Overload me! Default IterativeRobot.robotPeriodic() method... Overload me! NT: server: client CONNECTED: 10.3.3.95 port 59487 NT: server: client CONNECTED: 10.3.3.30 port 62920 Any help would be greatly appreciated. Last edited by Bradley Boxer : 17-01-2017 at 19:23. Reason: clarity |
|
#2
|
||||
|
||||
|
Re: Axis Camera Not Displaying On Smart Dashboard
Take a look at this ScreenSteps page for more information about this bug:
http://wpilib.screenstepslive.com/s/...-faqs-for-2017 |
|
#3
|
||||
|
||||
|
Re: Axis Camera Not Displaying On Smart Dashboard
Quote:
Code:
ERROR: connect() to 10.3.3.31 port 80 error 101 - Network is unreachable (TCPConnector.cpp:175) |
|
#4
|
||||
|
||||
|
Re: Axis Camera Not Displaying On Smart Dashboard
Can you still access the camera through the web dashboard?
|
|
#5
|
||||
|
||||
|
Re: Axis Camera Not Displaying On Smart Dashboard
Yes, the web dashboard still works fine.
|
|
#6
|
||||
|
||||
|
Re: Axis Camera Not Displaying On Smart Dashboard
I would restart your entire robot (roboRIO, radio, and camera).
|
|
#7
|
||||
|
||||
|
Re: Axis Camera Not Displaying On Smart Dashboard
We have restarted multiple times. This problem has persisted for the past 4 days.
|
|
#8
|
||||
|
||||
|
Re: Axis Camera Not Displaying On Smart Dashboard
If you open OutlineViewer (Eclipse Menubar -> WPILib -> Run Outline Viewer) What do you see listed under /CameraPublisher/{Camera name}/streams?
|
|
#9
|
||||
|
||||
|
Re: Axis Camera Not Displaying On Smart Dashboard
I just got back from our workshop, so I don't have access to the robot at the moment, but I will check tomorrow.
|
|
#10
|
||||
|
||||
|
Re: Axis Camera Not Displaying On Smart Dashboard
Tomorrow please also try running this code in a new project and test if the camera connects.
Code:
import edu.wpi.first.wpilibj.CameraServer;
import edu.wpi.first.wpilibj.IterativeRobot;
public class Robot extends IterativeRobot {
public void robotInit() {
CameraServer.getInstance().addAxisCamera("10.3.3.31");
}
}
|
|
#11
|
||||
|
||||
|
Re: Axis Camera Not Displaying On Smart Dashboard
After a private message discussion, we discovered another antivirus program was running and preventing SmartDashboard from connecting to the camera.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|