Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Technical Discussion (http://www.chiefdelphi.com/forums/forumdisplay.php?f=22)
-   -   Jetson comm to RoboRIO (http://www.chiefdelphi.com/forums/showthread.php?t=148826)

gpetilli 07-06-2016 08:53

Jetson comm to RoboRIO
 
Over the summer, FRC1559 is hoping to port our Stronghold autonomous vision code from Raspberry PI2 to Jetson TX1. We are curious what interfaces team have tried to get the data to the RoboRIO? It seems that the RoboRIO, PI and Jetson all want to be I2C masters, so that is out. Last year we used RS232 from the PI, but we were hoping for something with less latency.

What low latency interfaces have teams been successful with?

Jaci 07-06-2016 08:56

Re: Jetson comm to RoboRIO
 
What's wrong with good old Network Sockets over Ethernet? It's faster than most of the alternatives, pre-existing, and doesn't have any master-slave problems. It also gives you a lot of bandwidth to work with, and most languages have much better support for it than the other protocols.

marshall 07-06-2016 09:05

Re: Jetson comm to RoboRIO
 
Ethernet:

http://www.chiefdelphi.com/media/papers/3269
http://www.chiefdelphi.com/media/papers/3267
http://www.chiefdelphi.com/media/papers/3266

:)

taichichuan 14-06-2016 19:45

Re: Jetson comm to RoboRIO
 
Sockets are simple and fast. You don't need all of the gyrations needed for network tables either. A simple client-server architecture that automatically reconnects if the connection is dropped requires all of about 20 lines of code. Or, use datagrams so there's no connection required. There are lots of samples of that code in all of the typical languages in Linux like C/C++, Java and Python. You could also use an existing system like VLC for piping the video via Ethernet. Again, if your GoogleFu is good, it's an easy search. Alternatively, I could post an example in C.

HTH,

Mike

Greg McKaskle 15-06-2016 08:02

Re: Jetson comm to RoboRIO
 
To add to the other good advice. The latency of a wired ethernet connection is ~1ms. It will degrade if lots of other traffic is present, or if one end is busy, but that is unlikely to happen, is easy to measure, and easy to control. Gigabit ethernet is one of the big standards for industrial camera control and streaming.

Another nice aspect if this is that you can easily modify the connection lengths and topology during the season. The devices can be on bench while the roboRIO is on robot and your laptop is at a desk. When they make room for the devices, you can shorten the cable, remove a switch, etc. And you can substitute devices easily too. If it has the IP or DNS info, it is the droid you are looking for. This allows you to experiment and incrementally deploy while keeping developer tools friendly.

If you decide that you want most of the network table data shared between your targets, then that is a good option -- over TCP by the way. If you only want data shared one direction, or a specific subset of data, it is very easy to serialize your data, send it over either TCP or UDP, and deserialize it on the other target. You can also add it to network tables once received. There plenty examples for doing this in all languages, and the transport of the data is language independent.

Greg McKaskle

gpetilli 15-06-2016 11:39

Re: Jetson comm to RoboRIO
 
Thank you all. It looks like ethernet sockets is the clear winner. I guess we (more likely just me) have some homework to do.

billbo911 15-06-2016 15:36

Re: Jetson comm to RoboRIO
 
Quote:

Originally Posted by gpetilli (Post 1592910)
Thank you all. It looks like ethernet sockets is the clear winner. I guess we (more likely just me) have some homework to do.

Sockets will work. Just make certain you do not saturate the Rio with incoming data. From experience, I can tell you bad things happen.
The issue you may face is causing the Rio to miss command packets from the DS. When this happens, you can loose control of the robot.

As long as you are reasonable with your approach, you "shouldn't" have any issues.
If you find you are having issues, look at using UDP sockets instead of TCP.

feverittm 15-06-2016 16:14

Re: Jetson comm to RoboRIO
 
I have a question regarding talking to the Jetson over a network connection. I have heard a number of stories this year of camera code not working because the FMS was blocking some port or another during competition. Everything would be fine in the pits, but on the field the camera was dead. Are their any know best practices for how to work with this type of network code.

Thanks

frcguy 15-06-2016 16:20

Re: Jetson comm to RoboRIO
 
Quote:

Originally Posted by feverittm (Post 1592976)
I have a question regarding talking to the Jetson over a network connection. I have heard a number of stories this year of camera code not working because the FMS was blocking some port or another during competition. Everything would be fine in the pits, but on the field the camera was dead. Are their any know best practices for how to work with this type of network code.

Thanks

See here: https://wpilib.screenstepslive.com/s...fms-whitepaper

Information on recommended bandwidth usage, open ports, and more.

marshall 15-06-2016 17:52

Re: Jetson comm to RoboRIO
 
Quote:

Originally Posted by feverittm (Post 1592976)
Are their any know best practices for how to work with this type of network code.

Treat FMS like a black box until FIRST provides more details about what it is doing. Refer to the white papers I listed earlier in this thread for the setup that 900 ran this year for vision. We had no issues with vision communication on the robot. We did have issues with our driver station at one event, likely created by a non-constrained loop on the driver console and definitely not the result of our vision configuration.

Anecdotally, all the teams that I heard/saw having issues with cameras were not relying on static addresses but on mDNS. I'm not saying mDNS was the problem but I know that the documentation for both of these is lacking for making forward progress for integrated vision systems.

I would really like to see simple block & wire diagrams from FIRST documenting how all of the components of FMS work together and outlining ports/protocols in use along with what data is collected and when and any exposed APIs that the teams can use. I think having all of this documented would go a long way towards solving the "it works on the practice field" issues that plague a lot of teams.

Quote:

Originally Posted by frcguy (Post 1592977)
See here: https://wpilib.screenstepslive.com/s...fms-whitepaper

Information on recommended bandwidth usage, open ports, and more.

This is severely lacking technical details for what is going on with the FMS and is not a white paper describing FMS so much as a set of guidelines for teams to use. There is a lot of information that is not detailed here.

AustinSchuh 17-06-2016 00:09

Re: Jetson comm to RoboRIO
 
Quote:

Originally Posted by billbo911 (Post 1592968)
As long as you are reasonable with your approach, you "shouldn't" have any issues.
If you find you are having issues, look at using UDP sockets instead of TCP.

We've found UDP to be easier to use and the right answer for communicating controls data (both for work and robotics).

billbo911 17-06-2016 15:38

Re: Jetson comm to RoboRIO
 
Quote:

Originally Posted by AustinSchuh (Post 1593167)
We've found UDP to be easier to use and the right answer for communicating controls data (both for work and robotics).

When Austin speaks, you would be wise to listen!

Besides, he is the one who pointed me to start using UDP. So far It has been fantasic.


All times are GMT -5. The time now is 08:44.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi