Go to Post I'm a programmer by training and inclination, so my mechanical ideas are sometimes rather, um, loosely constrained by physical reality. - Alan Anderson [more]
Home
Go Back   Chief Delphi > Technical > Programming > Python
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 26-01-2016, 21:41
razar51 razar51 is offline
Registered User
AKA: John Faulkner
FRC #1288 (Raven Robotics)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2007
Location: St. Charles, MO
Posts: 10
razar51 is an unknown quantity at this point
How to get USB camera image to Roborealms?

Our team has been looking into using Roborealms this year but we are having issues.

We can't seem to get a USB camera image over to Roborealms. We can get the feed to show up at the Default Driver station by using StartAutomaticCapture.

I browsed some of the C++/Java forum sections and saw multiple mentions of not using automatic capture but instead using setImage from the cameraserver object. They all mention an intermediate code example (which I don't have since we are not using c++/Java). We are a bit stumped about how we can get the image to feed into setImage.

Does anyone have any ideas?
Reply With Quote
  #2   Spotlight this post!  
Unread 26-01-2016, 22:30
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,040
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: How to get USB camera image to Roborealms?

Quote:
Originally Posted by razar51 View Post
Our team has been looking into using Roborealms this year but we are having issues.

We can't seem to get a USB camera image over to Roborealms. We can get the feed to show up at the Default Driver station by using StartAutomaticCapture.
Are you sure that you've upgraded your RoboRIO to the 2016 image and your driver station to the 2016 tools? If you're using python, it doesn't work in 2016 because of NTCore compatibility issues (see https://github.com/robotpy/robotpy-wpilib/issues/172). We might have something compatible with LabVIEW by the end of this week, which would resolve this bug.

Quote:
I browsed some of the C++/Java forum sections and saw multiple mentions of not using automatic capture but instead using setImage from the cameraserver object. They all mention an intermediate code example (which I don't have since we are not using c++/Java). We are a bit stumped about how we can get the image to feed into setImage.

Does anyone have any ideas?
The USBCamera stuff in python is going to be very low performance, and I wouldn't recommend using it. Instead, I would recommend using mjpg-streamer (see https://github.com/robotpy/roborio-packages for more information on installing packages), and it appears that the HTTP_READ module in RoboRealm will support this type of stream (their docs: http://www.roborealm.com/help/HTTP_Read.php).

Let me know if it works, and we can add notes to the mjpg-streamer notes.
__________________
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
Reply With Quote
  #3   Spotlight this post!  
Unread 26-01-2016, 23:20
razar51 razar51 is offline
Registered User
AKA: John Faulkner
FRC #1288 (Raven Robotics)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2007
Location: St. Charles, MO
Posts: 10
razar51 is an unknown quantity at this point
Re: How to get USB camera image to Roborealms?

Quote:
Originally Posted by virtuald View Post
Are you sure that you've upgraded your RoboRIO to the 2016 image and your driver station to the 2016 tools? If you're using python, it doesn't work in 2016 because of NTCore compatibility issues (see https://github.com/robotpy/robotpy-wpilib/issues/172). We might have something compatible with LabVIEW by the end of this week, which would resolve this bug.



The USBCamera stuff in python is going to be very low performance, and I wouldn't recommend using it. Instead, I would recommend using mjpg-streamer (see https://github.com/robotpy/roborio-packages for more information on installing packages), and it appears that the HTTP_READ module in RoboRealm will support this type of stream (their docs: http://www.roborealm.com/help/HTTP_Read.php).

Let me know if it works, and we can add notes to the mjpg-streamer notes.
We have updated our RoboRIO image and Driverstation. BTW, that compatibility issue github link doesn't seem to work.

I was hoping to not have to do anything super special to get this to work. This will be the first time since 2006 our team is attempting to do any type of image processing so we don't really know what we are doing. If we have to do something special though we will certainly attempt it.

I'll see about trying out the mjpg-streamer (I'll have to read up about installing packages at that link you gave since I have never done that before).

Thanks!
Reply With Quote
  #4   Spotlight this post!  
Unread 27-01-2016, 20:32
razar51 razar51 is offline
Registered User
AKA: John Faulkner
FRC #1288 (Raven Robotics)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2007
Location: St. Charles, MO
Posts: 10
razar51 is an unknown quantity at this point
Re: How to get USB camera image to Roborealms?

We loaded mjpg-streamer onto our Roborio and are able to see the stream at the default page (http://roborio-1288-frc.local:5800) when connected via USB to the roborio.

However, we hit a wall with HTTP_Read since we do not know what url to use that leads to a direct jpeg image. The default url has all html pages.

The HTTP_Read documentation states that "The HTTP_READ module does NOT read HTML pages. You need to provide it with the specific url that will return a jpeg image. If will understand both moving jpeg images (mjpg) OR still jpeg images that refresh each time they are reloaded. "
Reply With Quote
  #5   Spotlight this post!  
Unread 27-01-2016, 20:56
razar51 razar51 is offline
Registered User
AKA: John Faulkner
FRC #1288 (Raven Robotics)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2007
Location: St. Charles, MO
Posts: 10
razar51 is an unknown quantity at this point
Re: How to get USB camera image to Roborealms?

nevermind we were dumb
Reply With Quote
  #6   Spotlight this post!  
Unread 27-01-2016, 23: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,040
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: How to get USB camera image to Roborealms?

Quote:
Originally Posted by razar51 View Post
nevermind we were dumb
I suppose you read the various pages and found the URL there?
__________________
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
Reply With Quote
  #7   Spotlight this post!  
Unread 28-01-2016, 17:08
razar51 razar51 is offline
Registered User
AKA: John Faulkner
FRC #1288 (Raven Robotics)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2007
Location: St. Charles, MO
Posts: 10
razar51 is an unknown quantity at this point
Re: How to get USB camera image to Roborealms?

Quote:
Originally Posted by virtuald View Post
I suppose you read the various pages and found the URL there?
yeah. http://roborio-1288-frc.local:5800/?action=stream worked.
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 19:49.

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