Go to Post One wondered why they couldn't practice in the gym that day - because the robotics team had it reserved was the answer. "Oh, we have a robotics team?" Sigh. This is a team with a low number. They've been around for at least a dozen years. There's still a lot more culture-changing to do. - GaryVoshol [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 01-02-2010, 11:28
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: New Camera Class

The GDC got back to us, and their answer is, in a word, no:

http://forums.usfirst.org/showthread.php?t=14284

We'll have to see what this update brings before moving forward.
__________________
Reply With Quote
  #17   Spotlight this post!  
Unread 01-02-2010, 12:17
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: New Camera Class

It looks like what they really said is no to UDP... can you make it work over TCP?
Reply With Quote
  #18   Spotlight this post!  
Unread 01-02-2010, 14:14
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: New Camera Class

Quote:
Originally Posted by jhersh View Post
It looks like what they really said is no to UDP... can you make it work over TCP?
Sure, but we think that a lot of the slowness was caused by TCP. For example, if a frame of the video being transmitted gets screwed up, it's not that big of a deal using UDP, especially if you have a high framerate. You can just drop the frame and wait for the next one (no big deal if you're getting a good 20 of them every second - the user will barely notice). If we use TCP and the same thing happens to a packet, the receive() function stops the entire program execution, sends a request to resend the packet, and waits for the packet to get sent again, all for just one frame (or even just one part of a frame). You're making the entire system, which could be better spending its time just displaying the next frame(s), wait on just one frame instead of moving on.

We're also aware that some of the latency is being caused by the Classmate not being enough to keep up with the cRIO, but TCP doesn't help in this respect.
__________________

Last edited by slavik262 : 01-02-2010 at 14:17.
Reply With Quote
  #19   Spotlight this post!  
Unread 01-02-2010, 14:26
TheDominis TheDominis is offline
Registered User
FRC #2152
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Port Orange, Florida
Posts: 88
TheDominis has a spectacular aura aboutTheDominis has a spectacular aura about
Re: New Camera Class

They said no to UDP on port 1180. This makes perfect sense as our packets would corrupt the driver station's packets. Currently, the video server works off of port 1234 (25FPS@160x120 resized to 640x480). However, I see a lot of erroneous packets as the robot gets farther away.

TCP hates not being acknowledged...

The GDC does not mention that UDP couldn't be used on another port. They do mention custom TCP protocols are allowed, but not UDP. They do not mention no UDP for all ports or just 1180.

Last edited by TheDominis : 01-02-2010 at 14:30. Reason: UDP on another port
Reply With Quote
  #20   Spotlight this post!  
Unread 01-02-2010, 14:36
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: New Camera Class

We'd need to have clearance to use a port though, because the FMS firewalls off any ports not cleared for use by the robot and driver station.

Also, the video feed and the rest of the driver station data run on different ports. The video uses a TCP connection to port 1180, while the rest of the dashboard data sends 1018 byte packets through UDP on port 1165. They wouldn't corrupt each other at all.

I'll have to post the whitepaper I made about the rest of the dashboard data some time.
__________________
Reply With Quote
  #21   Spotlight this post!  
Unread 01-02-2010, 14:40
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: New Camera Class

Quote:
Originally Posted by TheDominis View Post
The GDC does not mention that UDP couldn't be used on another port. They do mention custom TCP protocols are allowed, but not UDP. They do not mention no UDP for all ports or just 1180.
You should ask for official clarification on this, but my understanding is that UDP is not provisioned on any port on the FMS except for the official control and status packets, and you certainly can't use those.
Reply With Quote
  #22   Spotlight this post!  
Unread 01-02-2010, 14:41
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: New Camera Class

Quote:
Originally Posted by slavik262 View Post
I'll have to post the whitepaper I made about the rest of the dashboard data some time.
That would be great!
Reply With Quote
  #23   Spotlight this post!  
Unread 01-02-2010, 15:37
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: New Camera Class

Quote:
Originally Posted by slavik262 View Post
Sure, but we think that a lot of the slowness was caused by TCP. For example, if a frame of the video being transmitted gets screwed up, it's not that big of a deal using UDP, especially if you have a high framerate. You can just drop the frame and wait for the next one (no big deal if you're getting a good 20 of them every second - the user will barely notice). If we use TCP and the same thing happens to a packet, the receive() function stops the entire program execution, sends a request to resend the packet, and waits for the packet to get sent again, all for just one frame (or even just one part of a frame). You're making the entire system, which could be better spending its time just displaying the next frame(s), wait on just one frame instead of moving on.
I believe you (or someone else) mentioned sending video over the UserData dashboard data mechanism last year... it is implemented as UDP transfers, and only marginally smaller packets that you get with raw datagrams. I'm not aware of any changes that would have made this stop working. Is this method no longer feasible or desirable for some reason? This method has about 47kBytes/s throughput.

-Joe

Last edited by jhersh : 01-02-2010 at 15:42.
Reply With Quote
  #24   Spotlight this post!  
Unread 01-02-2010, 16:56
TheDominis TheDominis is offline
Registered User
FRC #2152
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Port Orange, Florida
Posts: 88
TheDominis has a spectacular aura aboutTheDominis has a spectacular aura about
Re: New Camera Class

Quote:
Originally Posted by jhersh View Post
I believe you (or someone else) mentioned sending video over the UserData dashboard data mechanism last year... it is implemented as UDP transfers, and only marginally smaller packets that you get with raw datagrams. I'm not aware of any changes that would have made this stop working. Is this method no longer feasible or desirable for some reason? This method has about 47kBytes/s throughput.

-Joe
Our team implemented this last year. We were trying to get a good video stream this year at high FPS with good quality. Each frame at 0 compression takes 5 packets. That's 10 FPS . We did something high around 70-80 and got 16 FPS, but the quality couldn't be used for image tracking.

The stream uses 100KB/s at 160x120 and we resize it to 640x480. It looks good actually.
Reply With Quote
  #25   Spotlight this post!  
Unread 01-02-2010, 17:01
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: New Camera Class

Quote:
Originally Posted by jhersh View Post
I believe you (or someone else) mentioned sending video over the UserData dashboard data mechanism last year... it is implemented as UDP transfers, and only marginally smaller packets that you get with raw datagrams. I'm not aware of any changes that would have made this stop working. Is this method no longer feasible or desirable for some reason? This method has about 47kBytes/s throughput.

-Joe
We could definitely try using the user data to send video; the obvious drawback is it leaves less room for other data. From the testing my team has done with the user data stream, the data it sends is often redundant, so the actual useful bytes/second value is lower than the potential.
__________________
Reply With Quote
  #26   Spotlight this post!  
Unread 01-02-2010, 17:05
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: New Camera Class

Quote:
Originally Posted by slavik262 View Post
We could definitely try using the user data to send video; the obvious drawback is it leaves less room for other data. From the testing my team has done with the user data stream, the data it sends is often redundant, so the actual useful bytes/second value is lower than the potential.
I only see redundant data sent if the user data is updated by a task that is not synchronized with the control packets.
Reply With Quote
  #27   Spotlight this post!  
Unread 02-02-2010, 08:37
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: New Camera Class

We'll have to check it out. Right now we're putting this project on the backburner for a week or so until this supposed update comes out.
__________________
Reply With Quote
  #28   Spotlight this post!  
Unread 05-02-2010, 15:49
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: New Camera Class

Quote:
Originally Posted by slavik262 View Post
We'll have to check it out. Right now we're putting this project on the backburner for a week or so until this supposed update comes out.
Have you tried out the new update yet?
Reply With Quote
  #29   Spotlight this post!  
Unread 05-02-2010, 18:13
TheDominis TheDominis is offline
Registered User
FRC #2152
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Port Orange, Florida
Posts: 88
TheDominis has a spectacular aura aboutTheDominis has a spectacular aura about
Re: New Camera Class

I get about 150-250ms delay on the new camera.
Reply With Quote
  #30   Spotlight this post!  
Unread 05-02-2010, 21:00
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: New Camera Class

Quote:
Originally Posted by TheDominis View Post
I get about 150-250ms delay on the new camera.
Is that something that you are happy with? It seems to be a lot better than you were getting before. How about frame rate?

Also, if you look at the code and have any suggestions for improvement, please let me know.

Joe
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
define a new class(C++) nadavsen2 C/C++ 15 02-11-2010 13:21
Camera using IterativeRobot class Steve Warner C/C++ 2 24-01-2010 21:47
New class for Logitech Dual Action Gamepad Mike Soukup C/C++ 8 11-02-2009 20:08
Camera Help (New to Camera Programming) Idaman323 Programming 6 14-01-2006 03:56
**FIRST EMAIL**/FIRST Announces New Class of Senior Mentors. Billfred FIRST E-Mail Blast Archive 1 23-12-2004 13:32


All times are GMT -5. The time now is 14: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