Go to Post The ideals that are held by myself and by many of the longtime FRC mentors and volunteers whom I consider friends and colleagues are bigger than FIRST, and we will find (or make) another vehicle for them if we are forced to. - Jared Russell [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 21-01-2017, 17:11
dmelcer9 dmelcer9 is offline
Registered User
AKA: Daniel
FRC #0810 (Mechanical Bulls)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2012
Location: Smithtown
Posts: 51
dmelcer9 is an unknown quantity at this point
URL for MjpegServer from CameraServer/USB Camera

I'm looking to use a USB camera connected to the robot for GRIP development. I know that GRIP doesn't accept the dashboard stream, but the MJPG stream supposedly works. However, I can't figure out what URL to point GRIP to if I want to actually use the stream.

Currently, our code looks something like this (forgot to commit to github so don't have the exact code):

Code:
//Robot.java -> RobotInit

UsbCamera c = CameraServer.getInstance().startAutomaticCapture();
MjpegServer s = CameraServer.getInstance().addServer("gripStream");
s.setSource(c);
What URL would I point the "Add IP Camera" source to in GRIP to get the camera to work properly?
Reply With Quote
  #2   Spotlight this post!  
Unread 22-01-2017, 00:07
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,107
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: URL for MjpegServer from CameraServer/USB Camera

Quote:
Originally Posted by dmelcer9 View Post
I'm looking to use a USB camera connected to the robot for GRIP development. I know that GRIP doesn't accept the dashboard stream, but the MJPG stream supposedly works. However, I can't figure out what URL to point GRIP to if I want to actually use the stream.

Currently, our code looks something like this (forgot to commit to github so don't have the exact code):

Code:
//Robot.java -> RobotInit

UsbCamera c = CameraServer.getInstance().startAutomaticCapture();
MjpegServer s = CameraServer.getInstance().addServer("gripStream");
s.setSource(c);
What URL would I point the "Add IP Camera" source to in GRIP to get the camera to work properly?
You actually don't need that MjpegServer definition or the setSource line. startAutomaticCapture will automatically create the stream.

The way to access the code from GRIP would be
Code:
http://roborio-TEAM-frc.local:1181/?action=stream
__________________
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.
Reply With Quote
  #3   Spotlight this post!  
Unread 22-01-2017, 00:18
dmelcer9 dmelcer9 is offline
Registered User
AKA: Daniel
FRC #0810 (Mechanical Bulls)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2012
Location: Smithtown
Posts: 51
dmelcer9 is an unknown quantity at this point
Re: URL for MjpegServer from CameraServer/USB Camera

Really? Thank you! I'm guessing any additional streams (for example if we have 2 cameras) would use port 1182? I saw some sort of reference to using the next available port.
Reply With Quote
  #4   Spotlight this post!  
Unread 22-01-2017, 01:38
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,107
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: URL for MjpegServer from CameraServer/USB Camera

Quote:
Originally Posted by dmelcer9 View Post
Really? Thank you! I'm guessing any additional streams (for example if we have 2 cameras) would use port 1182? I saw some sort of reference to using the next available port.
Yeah any additional cameras will just increase the port number, so cam 2 will use 1182, cam 3 will use 1183 etc...
__________________
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.
Reply With Quote
  #5   Spotlight this post!  
Unread 24-01-2017, 22:01
dmelcer9 dmelcer9 is offline
Registered User
AKA: Daniel
FRC #0810 (Mechanical Bulls)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2012
Location: Smithtown
Posts: 51
dmelcer9 is an unknown quantity at this point
Re: URL for MjpegServer from CameraServer/USB Camera

Thanks! Didn't get a chance to test until today (building was closed for bad weather) but it worked really nicely. One (hopefully) last question: is there any way to increase the resolution of the mjpg stream? Currently GRIP shows the stream as a tiny thumbnail which is workable but a little annoying.
Reply With Quote
  #6   Spotlight this post!  
Unread 24-01-2017, 22:39
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,107
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: URL for MjpegServer from CameraServer/USB Camera

Quote:
Originally Posted by dmelcer9 View Post
Thanks! Didn't get a chance to test until today (building was closed for bad weather) but it worked really nicely. One (hopefully) last question: is there any way to increase the resolution of the mjpg stream? Currently GRIP shows the stream as a tiny thumbnail which is workable but a little annoying.
When you call startAutomaticCapture, it will return a UsbCamera object. Call setResolution on that object, and that will set the resolution to whatever you put in.
__________________
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.
Reply With Quote
  #7   Spotlight this post!  
Unread 24-01-2017, 22:41
dmelcer9 dmelcer9 is offline
Registered User
AKA: Daniel
FRC #0810 (Mechanical Bulls)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2012
Location: Smithtown
Posts: 51
dmelcer9 is an unknown quantity at this point
Re: URL for MjpegServer from CameraServer/USB Camera

Thanks! Didn't know that the USBCamera object affected the stream like that. Good to know.
Reply With Quote
  #8   Spotlight this post!  
Unread 25-01-2017, 07:40
ryan.mitchell ryan.mitchell is offline
Registered User
FRC #1512 (Big Red)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2015
Location: Middletown, Delaware
Posts: 14
ryan.mitchell is an unknown quantity at this point
Re: URL for MjpegServer from CameraServer/USB Camera

What would the mjpegserver be if I am accessing the camera from a raspberry pi? Currently I am just typing raspberrypi.local:1185 into a browser to see the camera image but I would like to get it to appear on my smartdashboard.
Reply With Quote
  #9   Spotlight this post!  
Unread 25-01-2017, 08:29
ryan.mitchell ryan.mitchell is offline
Registered User
FRC #1512 (Big Red)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2015
Location: Middletown, Delaware
Posts: 14
ryan.mitchell is an unknown quantity at this point
Re: URL for MjpegServer from CameraServer/USB Camera

Quote:
Originally Posted by ryan.mitchell View Post
What would the mjpegserver be if I am accessing the camera from a raspberry pi? Currently I am just typing raspberrypi.local:1185 into a browser to see the camera image but I would like to get it to appear on my smartdashboard.
Oh wait...it should be the same thing just port 1185, I'll give that a go and relay how it goes.
Reply With Quote
  #10   Spotlight this post!  
Unread 01-02-2017, 21:50
thecoopster20 thecoopster20 is offline
4th Year Programmer - Java
FRC #3602 (Robomos)
Team Role: Programmer
 
Join Date: Mar 2016
Rookie Year: 2014
Location: Escanaba, MI
Posts: 27
thecoopster20 is an unknown quantity at this point
Re: URL for MjpegServer from CameraServer/USB Camera

Quote:
Originally Posted by ryan.mitchell View Post
Oh wait...it should be the same thing just port 1185, I'll give that a go and relay how it goes.
Any success? I am on the same boat as you are currently.
Reply With Quote
  #11   Spotlight this post!  
Unread 01-02-2017, 22:34
MuskieProgramme MuskieProgramme is offline
Registered User
FRC #6420
Team Role: Programmer
 
Join Date: Dec 2016
Rookie Year: 2014
Location: Muscatine, IA
Posts: 33
MuskieProgramme is an unknown quantity at this point
Re: URL for MjpegServer from CameraServer/USB Camera

I would also like to know how to get the camera stream from the raspberry pi on the dashboard. Even better would be an unmodified Labview Dashboard, as nobody on my team is interested in using the other options. I'm fairly certain it is possible with the right things published to network tables, but who knows...
Reply With Quote
  #12   Spotlight this post!  
Unread 01-02-2017, 23:12
ryan.mitchell ryan.mitchell is offline
Registered User
FRC #1512 (Big Red)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2015
Location: Middletown, Delaware
Posts: 14
ryan.mitchell is an unknown quantity at this point
Re: URL for MjpegServer from CameraServer/USB Camera

Quote:
Originally Posted by thecoopster20 View Post
Any success? I am on the same boat as you are currently.
Well, I'm upset...I hit submit post and it just went *poof*...anyway a rundown of my current situation is that it didn't work however I an idea that I just thought of which I will test tomorrow (and paste my code). I believe I have just been making a stupid mistake. As for MuskieProgrammes question, I would use the SmartDashboard definitely because I believe LabView can only handle Usbcameras, could be wrong though. Also, network tables can only publish/get variables (again, 99% positive).

Ryan
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 15:27.

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