Go to Post This is a game of the mind. Size does not matter. - JohnBoucher [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-01-2016, 00:52
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 222
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Can you view the webcam from the TCP connection?

Hi,

I have been struggling to get the USB Camera to work with the RoboRIO for a long time. Now that I see that the new game has many obstacles that make it hard for the driver to see, I desperately want the camera to work. I was reading the Game Manual for this year and I saw under 2.4 Section this:

Quote:
A. TCP 1180: Camera data from the roboRIO to the Driver Station (DS) when the camera is connected the roboRIO via USB, bi-directional.
So that got me wondering if I could do roboRIO-4480.local:1180 and see if the camera itself isn't working? Also, we have the Logitech C270, is the light supposed to turn green on the webcam when you turn on the robot? Our webcam doesn't(but it does when you use it on a computer).

Many thanks! Can't wait to start building the actual robot!
  #2   Spotlight this post!  
Unread 10-01-2016, 00:53
Thad House Thad House is online now
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,094
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: Can you view the webcam from the TCP connection?

Quote:
Originally Posted by team-4480 View Post
Hi,

I have been struggling to get the USB Camera to work with the RoboRIO for a long time. Now that I see that the new game has many obstacles that make it hard for the driver to see, I desperately want the camera to work. I was reading the Game Manual for this year and I saw under 2.4 Section this:



So that got me wondering if I could do roboRIO-4480.local:1180 and see if the camera itself isn't working? Also, we have the Logitech C270, is the light supposed to turn green on the webcam when you turn on the robot? Our webcam doesn't(but it does when you use it on a computer).

Many thanks! Can't wait to start building the actual robot!
In your robot code, you have to use the CameraServer class, which will stream the images from your camera to your driver station. The robot does not do this by default.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
  #3   Spotlight this post!  
Unread 10-01-2016, 01:03
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 222
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Re: Can you view the webcam from the TCP connection?

Quote:
Originally Posted by Thad House View Post
In your robot code, you have to use the CameraServer class, which will stream the images from your camera to your driver station. The robot does not do this by default.
Yep, I should have added that I am currently using this code(It is in Python but it isn't any different then Java/C++)
Code:
        try:
            self.camera = wpilib.USBCamera()
            self.camera.startCapture()
            self.camServ = wpilib.CameraServer()
            self.camServ.startAutomaticCapture(self.camera)
        except:
            self.camera = None
I put this in the startup __init__ code.
  #4   Spotlight this post!  
Unread 10-01-2016, 09:23
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,567
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Can you view the webcam from the TCP connection?

Quote:
Originally Posted by team-4480 View Post
Hi,

I have been struggling to get the USB Camera to work with the RoboRIO for a long time. Now that I see that the new game has many obstacles that make it hard for the driver to see, I desperately want the camera to work. I was reading the Game Manual for this year and I saw under 2.4 Section this:



So that got me wondering if I could do roboRIO-4480.local:1180 and see if the camera itself isn't working?
no, the protocol isn't http. Also note the men's name changed this year.

Quote:
Originally Posted by team-4480 View Post
Yep, I should have added that I am currently using this code(It is in Python but it isn't any different then Java/C++)
Code:
        try:
            self.camera = wpilib.USBCamera()
            self.camera.startCapture()
            self.camServ = wpilib.CameraServer()
            self.camServ.startAutomaticCapture(self.camera)
        except:
            self.camera = None
I put this in the startup __init__ code.
It isn't going to work if you don't implement the changes from your other thread http://www.chiefdelphi.com/forums/sh...mp;postcount=2
  #5   Spotlight this post!  
Unread 10-01-2016, 11:17
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 222
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Re: Can you view the webcam from the TCP connection?

Quote:
Originally Posted by Joe Ross View Post
It isn't going to work if you don't implement the changes from your other thread http://www.chiefdelphi.com/forums/sh...mp;postcount=2
I did implement the changes in that thread, but I ended up with the same problem. Could it be that our webcam is not supported(Logitech C270)? Maybe next time I should try on a computer that has a Linux distro and see if it works there...
  #6   Spotlight this post!  
Unread 10-01-2016, 20:40
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,058
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Can you view the webcam from the TCP connection?

You might try removing the 'except:' to see if an error gets thrown. It may be instructive and explain what the problem is.

Or better yet:

Code:
try:
    ...
except Exception:
    self.logger.exception("Could not enable camera")
    self.camera = None
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #7   Spotlight this post!  
Unread 10-01-2016, 21:14
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 222
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Re: Can you view the webcam from the TCP connection?

Quote:
Originally Posted by virtuald View Post
You might try removing the 'except:' to see if an error gets thrown. It may be instructive and explain what the problem is.

Or better yet:

Code:
try:
    ...
except Exception:
    self.logger.exception("Could not enable camera")
    self.camera = None
Ah yes! Would that statement show up on the Driver Station then? Or would it be a "py robot.py deploy --nc" thing? Thanks!
  #8   Spotlight this post!  
Unread 10-01-2016, 21:19
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,058
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Can you view the webcam from the TCP connection?

Netconsole, so using --nc
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #9   Spotlight this post!  
Unread 10-01-2016, 21:24
team-4480's Avatar
team-4480 team-4480 is offline
Debug? What's that?
FRC #4480
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Minnesooota
Posts: 222
team-4480 will become famous soon enoughteam-4480 will become famous soon enough
Re: Can you view the webcam from the TCP connection?

Quote:
Originally Posted by virtuald View Post
Netconsole, so using --nc
Awesome, now I will finally know for certain what is happening! Thanks!
  #10   Spotlight this post!  
Unread 10-01-2016, 22:40
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,058
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Can you view the webcam from the TCP connection?

I just tried out the USBCamera class RobotPy 2016.0.0 with the default LabVIEW dashboard, and it doesn't work. Looking at tcpdump, the RoboRIO seems to be rejecting the incoming connections for some reason.

I'll debug this for a little bit, but honestly as I've said before the CameraServer stuff in python is *really* terrible, and if I can't get it to work relatively quickly then I'll probably remove it from the next release.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #11   Spotlight this post!  
Unread 11-01-2016, 00:57
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,058
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Can you view the webcam from the TCP connection?

Well, one possibility is that you don't have pynivision installed. I didn't have it installed, and there was no way to know that it was using the 'dummy camera' instead of the real camera.

When I install pynivision, I get a "Connection reset by peer" error. The problem is that when the LabVIEW dashboard connects to the server and it encounters the wrong version of networktables (we haven't upgraded to 3.0 yet), it disconnects from the camera. When I block the NetworkTables connection, then the camera works fine.

It's pretty terrible, the CPU usage is at 51% without the robot code actually doing anything (as compared to ~7% without the camera code). I wouldn't recommend using it, and I suspect we'll remove the camera stuff from the next release.

I'm tracking this issue here: https://github.com/robotpy/robotpy-wpilib/issues/172
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #12   Spotlight this post!  
Unread 13-01-2016, 11:10
Sperkowsky's Avatar
Sperkowsky Sperkowsky is online now
Professional Multitasker
AKA: Samuel Perkowsky
FRC #2869 (Regal Eagles)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Bethpage, NY
Posts: 1,902
Sperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond reputeSperkowsky has a reputation beyond repute
Quote:
Originally Posted by jijiglobe View Post
Just a fair warning from a New York team. Some regionals have extreme bandwidth issues (New York being one of the most extreme examples). One year(I think 2014) a lot of teams did exactly what you described (using a camera to stream to the driver station) and it created huge amounts of field lag. The event staff had to force everyone to turn off their camera streaming. Probably not relevant to most regionals but if you're reading this thread, it's probably a good idea to talk to other teams at your regional to see if this issue has happened before. If so, it's best not to rely on the camera feed.
I remember this it was rough to say the least.

The Javits center really needs to start being more accommodating they know it's a not for profit holding an extremely expensive event. Last year there were similarly sized halls empty at the time so it's not like it was going to get rented out by someone else.
Closed Thread


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 03:01.

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