Go to Post Short answer, the GDC has ruled it legal explicitly through Q&A, implicitly through Q&A, and implicitly through the Manual. - EricH [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 20-03-2016, 10:11
vScourge's Avatar
vScourge vScourge is offline
Videogame Developer
AKA: Adam Pletcher
FRC #4096 (Ctrl-Z)
Team Role: Coach
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Champaign, IL
Posts: 33
vScourge is on a distinguished road
problems with camera feeds at CIR

Just returned from Central Illinois Regional, and wanted to post something about camera issues we had on the field.

We have two Logitech C920 USB cameras on our robot, connected to a Raspberry Pi 2. We have two instances of mjpg_streamer running on the Pi, sending HTTP feeds to SmartDashboard on the DS for the driver to use. We're using this SmartDashboard extension to display the feeds.

This worked great in the shop before CIR, and when tethered in the pits and practice field. When we hit the competition field the feeds didn't work.

After a lot of help from FTA Nick Luther, we set the RPi, Roborio and DS laptop to static IPs. This also seemed to work great off the field, but failed when connected to FMS.

One of our students went through the FMS whitepaper again and saw that the port range we were using for those feeds (5800 and 5801) are TCP/UDP only. He tried changing them to ports 80 and 443, which are dedicated to HTTP traffic. The very next match the feeds worked flawlessly on the field. The FTA was surprised to learn this, since HTTP just uses TCP under the hood anyway.

Trouble is, it only worked for that one match. The matches that followed the feeds refused to display in SmartDashboard again. We did not resolve this at CIR, so we plan to dig into it this week before MWR. One thing I did notice was SD has a "use mDNS" option that's on by default. That's one thing we can try next time we're on FMS. We're also going to try changing mjpg_streamer to use UDB instead of HTTP.

Just wanted to post this in case anyone had similar setup/experiences/advice to offer. It's frustrating not being able to reproduce issues like this off the field.
  #2   Spotlight this post!  
Unread 20-03-2016, 10:17
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,731
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: problems with camera feeds at CIR

If you switch to static IPs for SmartDashboard then you do need to unclick the use mdns option in Preferences.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #3   Spotlight this post!  
Unread 20-03-2016, 10:34
vScourge's Avatar
vScourge vScourge is offline
Videogame Developer
AKA: Adam Pletcher
FRC #4096 (Ctrl-Z)
Team Role: Coach
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Champaign, IL
Posts: 33
vScourge is on a distinguished road
Re: problems with camera feeds at CIR

Thanks. I figured as much, just didn't realize SD had preferences. Probably just dumb luck it worked that one match.
  #4   Spotlight this post!  
Unread 20-03-2016, 11:01
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: problems with camera feeds at CIR

Just an FYI, we use a very similar setup except we use two MS LifeCam 3000 HDs.

We had a few "panic" moments on the field where we though the feeds weren't working, but for some reason it took a long time for the SmartDashboard extension to pick up and start displaying the feed after the robot was powered on on the field.

We would stand there staring at two pink screens until just seconds before the match started, and the feeds would come alive. They always did without fail, but it was nerve-wracking.

We kept the RPi set up on DHCP, with a hostname of "raspberrypi" - which is how we addressed it in SmartDashboard. We broadcast over ports 5800 and 5801. FYI, HTTP traffic is actually broadcast over TCP, so that restriction is not the issue.

I think it is just a time-out/retry delay with the SmartDashboard extension being a tad too long.

Just before our matches, if we were really nervous, we would open a browser on our DS, and navigate to the MJPG Streamer web interface (http://raspberrypi:5800 and http://raspberrypi:5801). This showed the streams working perfectly fine, even though the SmartDahsboard extension hadn't kicked in yet.

Hope this helps!
__________________
In life, what you give, you keep. What you fail to give, you lose forever...
  #5   Spotlight this post!  
Unread 20-03-2016, 11:10
vScourge's Avatar
vScourge vScourge is offline
Videogame Developer
AKA: Adam Pletcher
FRC #4096 (Ctrl-Z)
Team Role: Coach
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Champaign, IL
Posts: 33
vScourge is on a distinguished road
Re: problems with camera feeds at CIR

Thanks. Our streams weren't just slow to start, though, they flat-out didn't appear for the entire match, except that one.

Maybe the switch to ports 80 and 443 prior to the match where it worked were just coincidental. I did baffle me and the TSA why that would fix anything, given HTTP still uses TCP.
  #6   Spotlight this post!  
Unread 20-03-2016, 11:24
gerthworm's Avatar
gerthworm gerthworm is offline
Making the 1's and 0's
FRC #1736 (Robot Casserole)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Peoria, IL
Posts: 60
gerthworm has a spectacular aura aboutgerthworm has a spectacular aura about
Re: problems with camera feeds at CIR

We were using a pretty similar setup at CIR too - dual mjpg streamers running to smartdashboard. Never saw any issues related to coms on the field. Some crucial differences: We stuck with the default ports of 5800 and 5801, did not see any issues. We addressed our rio with the roboRIO-1736-FRC.local address. Our streamers were hosted on the RIO itself, not a coprocessor. Additionally, we had made some modifications to that same smartdashboard plugin to allow it to stream from either feed and only display one, depending on which direction we were driving. Finally, we had generic wide-angle cameras, not the Logitech ones you had.

I'll try to keep you posted if we run into any issues - next field we'll be on will be at Midwest. The non-reproducible problems are always the worst to try to solve...

Last edited by gerthworm : 20-03-2016 at 11:32. Reason: More Details
  #7   Spotlight this post!  
Unread 20-03-2016, 11:53
Hadi379's Avatar
Hadi379 Hadi379 is offline
Registered User
FRC #0379
 
Join Date: Jan 2007
Location: Girard
Posts: 163
Hadi379 is a splendid one to beholdHadi379 is a splendid one to beholdHadi379 is a splendid one to beholdHadi379 is a splendid one to beholdHadi379 is a splendid one to beholdHadi379 is a splendid one to beholdHadi379 is a splendid one to behold
Re: problems with camera feeds at CIR

Quote:
Originally Posted by vScourge View Post
Just returned from Central Illinois Regional, and wanted to post something about camera issues we had on the field.

We have two Logitech C920 USB cameras on our robot, connected to a Raspberry Pi 2. We have two instances of mjpg_streamer running on the Pi, sending HTTP feeds to SmartDashboard on the DS for the driver to use. We're using this SmartDashboard extension to display the feeds.

This worked great in the shop before CIR, and when tethered in the pits and practice field. When we hit the competition field the feeds didn't work.

After a lot of help from FTA Nick Luther, we set the RPi, Roborio and DS laptop to static IPs. This also seemed to work great off the field, but failed when connected to FMS.

One of our students went through the FMS whitepaper again and saw that the port range we were using for those feeds (5800 and 5801) are TCP/UDP only. He tried changing them to ports 80 and 443, which are dedicated to HTTP traffic. The very next match the feeds worked flawlessly on the field. The FTA was surprised to learn this, since HTTP just uses TCP under the hood anyway.

Trouble is, it only worked for that one match. The matches that followed the feeds refused to display in SmartDashboard again. We did not resolve this at CIR, so we plan to dig into it this week before MWR. One thing I did notice was SD has a "use mDNS" option that's on by default. That's one thing we can try next time we're on FMS. We're also going to try changing mjpg_streamer to use UDB instead of HTTP.

Just wanted to post this in case anyone had similar setup/experiences/advice to offer. It's frustrating not being able to reproduce issues like this off the field.
We had issues at Buckeye, never did get it working on the field with FMS. It worked great at home wireless, tethered, tethered during calibration time on the field, but never during an actual match.

We are running an Axis IP camera, and using Labview. I'm not at all a programmer, but have some understanding. The connection is camera via ethernet to the radio, ethernet from the radio to roborio. We do still get the live feed during the match, but no vision tracking.

I also believe the FTA did something with static IP's with us. I would really like to get this working, so if anyone has any suggestions, it would be greatly appreciated.

Thanks
  #8   Spotlight this post!  
Unread 20-03-2016, 14:55
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,731
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: problems with camera feeds at CIR

The other obvious cause would be the video stream is trying to use too much bandwidth and the field drops it.
Images compress differently depending on how complicated the picture is, so if the camera happens to point at an easily compressed picture the bandwidth use can be small, but if the field image is too complicated and it isn't easily compressed then it takes up a lot more bandwidth. I've seen camera bandwidth vary on the field by 2 or 3 Mb/s depending on what the camera was looking at.

As a test for the next time you are on the field, temporarily cut your image stream way down to 320x240 / 10fps / 50% compression. And in the Pit measure your bandwidth using the standard Windows Task Manager->Performance tab.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 20-03-2016 at 15:00.
  #9   Spotlight this post!  
Unread 20-03-2016, 15:17
vScourge's Avatar
vScourge vScourge is offline
Videogame Developer
AKA: Adam Pletcher
FRC #4096 (Ctrl-Z)
Team Role: Coach
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Champaign, IL
Posts: 33
vScourge is on a distinguished road
Re: problems with camera feeds at CIR

Those are exactly the settings we use for our two streams. They were reasonable off the field and in the one match our feeds worked we didn't notice any loss of controls response or other symptoms of hitting the bandwidth limit.

I would say we looked in the log, but on a related note it looked to us (and the FTA) there's a bug in the Driver Station logging this year that causes the bandwidth value to always be zero. Can anyone confirm? We're on the required DS 16.0.2.
  #10   Spotlight this post!  
Unread 20-03-2016, 15:52
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,731
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: problems with camera feeds at CIR

There won't be any loss of controls evident due to the camera exceeding bandwidth limitations.
Command packets are prioritized over all other traffic through the robot radio.

If the camera traffic gets dropped by the field then the bandwidth log won't show any of that, it'll just be the control packet and other non-camera user traffic.

P.S.
The bandwidth is recorded by the field logs.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 20-03-2016 at 16:12.
  #11   Spotlight this post!  
Unread 20-03-2016, 18:33
RyanShoff RyanShoff is offline
Registered User
FRC #4143 (Mars Wars)
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2012
Location: Metamora, IL
Posts: 145
RyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to beholdRyanShoff is a splendid one to behold
Re: problems with camera feeds at CIR

We also switched to static IPs at the event. We used mjpgstreamer on the Nvidia TK1 on port 5801. We had a small Chrome window connecting to the static IP of the Jetson. Something like HTTP://10.41.43.11:5801/&stream

That worked good for us.

If you still have trouble at Midwest, I'll help you out.
__________________
Ryan Shoff
4143 Mars/Wars
CheapGears.com
  #12   Spotlight this post!  
Unread 20-03-2016, 18:54
vScourge's Avatar
vScourge vScourge is offline
Videogame Developer
AKA: Adam Pletcher
FRC #4096 (Ctrl-Z)
Team Role: Coach
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Champaign, IL
Posts: 33
vScourge is on a distinguished road
Re: problems with camera feeds at CIR

Thanks, all, appreciate it. I suspect the mDNS option in SD was our final hurdle. And thanks for the alliance at CIR, Ryan.
  #13   Spotlight this post!  
Unread 20-03-2016, 20:26
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,349
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: problems with camera feeds at CIR

Quote:
Originally Posted by Mark McLeod View Post
There won't be any loss of controls evident due to the camera exceeding bandwidth limitations.
Command packets are prioritized over all other traffic through the robot radio.....
Mark, can you elaborate on this a bit more?

Is this "filtering" of packet types for all traffic through the radio, Lan traffic only, or WiFi traffic only?

Will it depend on which port on the radio the camera and/or RoboRio are connected to?

What impact on throughput in the radio does this packet prioritizing have? Is it progressively restrictive as non-command traffic incresses, or does it just kick in at a certain threshold?
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #14   Spotlight this post!  
Unread 21-03-2016, 10:30
nightpool's Avatar
nightpool nightpool is offline
robotRectifier
AKA: Evan
no team (formerly of CORE 2062)
Team Role: Alumni
 
Join Date: Oct 2011
Rookie Year: 2011
Location: Waukesha, WI
Posts: 81
nightpool is on a distinguished road
Re: problems with camera feeds at CIR

Quote:
Originally Posted by billbo911 View Post
Mark, can you elaborate on this a bit more?

Is this "filtering" of packet types for all traffic through the radio, Lan traffic only, or WiFi traffic only?

Will it depend on which port on the radio the camera and/or RoboRio are connected to?

What impact on throughput in the radio does this packet prioritizing have? Is it progressively restrictive as non-command traffic incresses, or does it just kick in at a certain threshold?
All of these answers are in the FMS Whitepaper: https://wpilib.screenstepslive.com/s...24193/l/291972 (specifically, the sections you're looking for are "Are there any bandwidth limits on the playing field?" and "What is Quality of Service (QoS)? Are there any QoS priorities on the competition field?")
__________________
Proud alum of CORE 2062.
www.core2062.com
  #15   Spotlight this post!  
Unread 21-03-2016, 13:39
imdunne8 imdunne8 is offline
Registered User
FRC #1736
 
Join Date: Jan 2008
Location: Peoria, IL
Posts: 15
imdunne8 has a spectacular aura aboutimdunne8 has a spectacular aura aboutimdunne8 has a spectacular aura about
Re: problems with camera feeds at CIR

I would highly recommend dumping the Raspberry Pi and running MJPG-Streamer directly on the RoboRIO using the link below. I installed using offline instructions which can be found in the readme at the root of the repository. You'll also have to SSH in and edit the /etc/default/mjpg-streamer file and then restart to enable streaming of the second camera and change resolution. This is what we had running all of CIR and it worked great. I helped 4156 install this on practice day and I believe 4143 and one other team were running it. No issues at all as far as I know. None of us were using a static IP for anything. Come talk to me on Thursday at Midwest if you're still having issues or just want help getting it set up.

https://github.com/robotpy/roborio-p...amer/README.md
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 08:37.

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