Go to Post You mean i can do something with the Kinect other than put large dents in wall with a robot? Rad.. - rachelholladay [more]
Home
Go Back   Chief Delphi > Technical > Control System
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 17-01-2017, 19:16
Bradley Boxer's Avatar
Bradley Boxer Bradley Boxer is offline
Registered User
AKA: Bradley Boxer
FRC #0303 (TEST Team 303)
Team Role: Programmer
 
Join Date: May 2015
Rookie Year: 2015
Location: United States
Posts: 26
Bradley Boxer is an unknown quantity at this point
Post Axis Camera Not Displaying On Smart Dashboard

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
EDIT: We can access the camera through the web dashboard, so we know its probably not a problem with the camera.

Any help would be greatly appreciated.
__________________
The opinions expressed in this post are mine and do not necessarily reflect those of my team.

Last edited by Bradley Boxer : 17-01-2017 at 19:23. Reason: clarity
Reply With Quote
 


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 11:43.

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