Go to Post I remember going to Houston in 1998 and seeing a bot that could move sideways. Talk about inspiring... - Ken Patton [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

 
Reply
Thread Tools Rate Thread Display Modes
  #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
  #2   Spotlight this post!  
Unread 17-01-2017, 20:01
AustinShalit's Avatar
AustinShalit AustinShalit is offline
Registered User
AKA: אוסטין
no team (WPILib Suite Developer)
 
Join Date: Dec 2013
Rookie Year: 2008
Location: Los Angeles/Worcester/Israel
Posts: 152
AustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of light
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
__________________
Reply With Quote
  #3   Spotlight this post!  
Unread 17-01-2017, 20:18
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
Re: Axis Camera Not Displaying On Smart Dashboard

Quote:
Originally Posted by AustinShalit View Post
Take a look at this ScreenSteps page for more information about this bug:
http://wpilib.screenstepslive.com/s/...-faqs-for-2017
When we restart all of the network table clients, the driver station floods with errors saying:

Code:
ERROR: connect() to 10.3.3.31 port 80 error 101 - Network is unreachable (TCPConnector.cpp:175)
But the camera still does not connect.
__________________
The opinions expressed in this post are mine and do not necessarily reflect those of my team.
Reply With Quote
  #4   Spotlight this post!  
Unread 17-01-2017, 20:22
AustinShalit's Avatar
AustinShalit AustinShalit is offline
Registered User
AKA: אוסטין
no team (WPILib Suite Developer)
 
Join Date: Dec 2013
Rookie Year: 2008
Location: Los Angeles/Worcester/Israel
Posts: 152
AustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of light
Re: Axis Camera Not Displaying On Smart Dashboard

Can you still access the camera through the web dashboard?
__________________
Reply With Quote
  #5   Spotlight this post!  
Unread 17-01-2017, 20:24
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
Re: Axis Camera Not Displaying On Smart Dashboard

Yes, the web dashboard still works fine.
__________________
The opinions expressed in this post are mine and do not necessarily reflect those of my team.
Reply With Quote
  #6   Spotlight this post!  
Unread 17-01-2017, 20:31
AustinShalit's Avatar
AustinShalit AustinShalit is offline
Registered User
AKA: אוסטין
no team (WPILib Suite Developer)
 
Join Date: Dec 2013
Rookie Year: 2008
Location: Los Angeles/Worcester/Israel
Posts: 152
AustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of light
Re: Axis Camera Not Displaying On Smart Dashboard

I would restart your entire robot (roboRIO, radio, and camera).
__________________
Reply With Quote
  #7   Spotlight this post!  
Unread 17-01-2017, 20:57
Owen Busler's Avatar
Owen Busler Owen Busler is offline
Build Captain
FRC #0303 (Test Team)
Team Role: Leadership
 
Join Date: Aug 2014
Rookie Year: 2014
Location: Bridgewater, NJ
Posts: 147
Owen Busler has a brilliant futureOwen Busler has a brilliant futureOwen Busler has a brilliant futureOwen Busler has a brilliant futureOwen Busler has a brilliant futureOwen Busler has a brilliant futureOwen Busler has a brilliant futureOwen Busler has a brilliant futureOwen Busler has a brilliant futureOwen Busler has a brilliant futureOwen Busler has a brilliant future
Re: Axis Camera Not Displaying On Smart Dashboard

We have restarted multiple times. This problem has persisted for the past 4 days.
__________________
2016: Deans List Semi-Finalist/MAR Mount Olive District Engineering Inspiration Award/Buckeye Regional Second Alliance Captain/MAR Montgomery District Event Imagery Award/MAR Championship Gracious Professionalism Award
2015: MAR Mount Olive District Chairman's Award/MAR North Brunswick District Winners/MAR Championship Finalists
2014: MAR Clifton District Chairman's Award/MAR Championship Regional Chairman's Award
Reply With Quote
  #8   Spotlight this post!  
Unread 17-01-2017, 21:03
AustinShalit's Avatar
AustinShalit AustinShalit is offline
Registered User
AKA: אוסטין
no team (WPILib Suite Developer)
 
Join Date: Dec 2013
Rookie Year: 2008
Location: Los Angeles/Worcester/Israel
Posts: 152
AustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of light
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?
__________________
Reply With Quote
  #9   Spotlight this post!  
Unread 17-01-2017, 21:05
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
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.
__________________
The opinions expressed in this post are mine and do not necessarily reflect those of my team.
Reply With Quote
  #10   Spotlight this post!  
Unread 17-01-2017, 21:09
AustinShalit's Avatar
AustinShalit AustinShalit is offline
Registered User
AKA: אוסטין
no team (WPILib Suite Developer)
 
Join Date: Dec 2013
Rookie Year: 2008
Location: Los Angeles/Worcester/Israel
Posts: 152
AustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of light
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");
    }
}
__________________
Reply With Quote
  #11   Spotlight this post!  
Unread 18-01-2017, 17:25
AustinShalit's Avatar
AustinShalit AustinShalit is offline
Registered User
AKA: אוסטין
no team (WPILib Suite Developer)
 
Join Date: Dec 2013
Rookie Year: 2008
Location: Los Angeles/Worcester/Israel
Posts: 152
AustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of light
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.
__________________
Reply With Quote
  #12   Spotlight this post!  
Unread 19-01-2017, 21:21
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
Re: Axis Camera Not Displaying On Smart Dashboard

The camera stopped working again today, working fine over USB but repeatedly connecting/disconnecting several times a second when connecting via wireless. We were able to resolve the problem, and I would like to share the solution in case anyone else is encountering this issue.

In the NetworkTables outline viewer, our Axis camera had a value "streams" which contained a string array with
1) the wireless URL of the camera (10.3.3.2:something)
2) the USB URL of the camera (172.22.11.2:something)

The solution was to delete the USB URL. I believe what was happening was that the camera would connect over wireless, see that it had another element in the array that took priority and try and connect to it, fail on the connection, and re-connect over wireless.
__________________
The opinions expressed in this post are mine and do not necessarily reflect those of my team.
Reply With Quote
  #13   Spotlight this post!  
Unread 20-01-2017, 04:50
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 269
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
Re: Axis Camera Not Displaying On Smart Dashboard

Quote:
Originally Posted by Bradley Boxer View Post
The camera stopped working again today, working fine over USB but repeatedly connecting/disconnecting several times a second when connecting via wireless. We were able to resolve the problem, and I would like to share the solution in case anyone else is encountering this issue.

In the NetworkTables outline viewer, our Axis camera had a value "streams" which contained a string array with
1) the wireless URL of the camera (10.3.3.2:something)
2) the USB URL of the camera (172.22.11.2:something)

The solution was to delete the USB URL. I believe what was happening was that the camera would connect over wireless, see that it had another element in the array that took priority and try and connect to it, fail on the connection, and re-connect over wireless.
SmartDashboard doesn't apply a priority, it just round-robins over each address if it gets disconnected. I would suspect it's still getting disconnected from the wireless URL, you're just not seeing the disconnects because it reconnects successfully with minimal delay. Can you run SmartDashboard from a command prompt so you can see what's being printed to the console (the executable is located in C:\Users\yourname\wpilib\tools)? In particular, I'm interested in seeing the "Trying to connect to:" and "Connected to:" messages. Can you also state what the URLs actually are?
__________________
Author of cscore - WPILib CameraServer for 2017+
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)
Reply With Quote
Reply


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 05:23.

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