Getting the Network Tables to work with an off loaded vision system

We have vision software that works on our desktop very well. I would like to further take this system and move it to the Kangaroo computer that we purchased. I have the vision system working there even better. We have tried a few thing to get the NT server and read write stuff working. What needs to be where for this to work?

Questions:
Do we need the dashboard running to process these messages?
Can we communicate directly to the RoboRio from the on board Kangaroo computer?
What if anything do I need to add to my vision software on the Kangaroo?
Do I just add the write function to the vision processing and the server will get the values and store it or is there more to it than that?

Thank you for any advice that is given.

Tim

The Kangaroo would act as another client. Everyone that has access to network tables is a client except for the robot – which is the server. This is, of course, assuming that they all have IP addresses on the same subnet and all clients know the server’s IP.

One that is working, anyone can read and anyone can write. So I’d add writes to the kangaroo code. The dashboard is a completely separate client. There shouldn’t be any need to modify it unless you also want it to show variable values written by the kangaroo. To get the SW running on the kangaroo, make sure that your EXE is built and set to autolaunch. By the way, I don’t have one of these, so I’m making assumptions about how you generally have it setup.

Greg McKaskle

Thanks for the reply Greg.

I do have the Kangaroo on the same IP and subnet mask. I will have to check the IP addresses tonight and make sure that everything is right.

Best I can tell right now for IP Addresses:

RoboRio
IP: 10.1.7.24
Subnet: 255.0.0.0

Camera
IP: 10.1.7.20
Subnet: 255.0.0.0

Kangaroo
IP: 10.1.7.200
Subnet: 255.0.0.0

Right now I have the camera on the same IP address. I am thinking about putting it on its own network 192.168.107.XXX. This way I only have to worry about the coms from the RoboRio to the Kangaroo. The students were programming on the primary system last night so I may have not had something hooked up correctly or assumed an incorrect IP address. I just wanted to make sure that I understood what I needed to do.

Thank you,

Tim

We got a Kangaroo as well. We don’t have enough resources to support a quick turn port to RasPi2 or another CPU family. It would be really cool, but cost reduction or simplification is not on the menu this year. Are you using GRIP, OpenCV or RoboRealm? We have a MS 3000 HD and an Axis 1013 camera, so that’s another choice to be made.
In order to get the network tables from the Kangaroo to the RoboRio you need to use the USB port. We can use USB, Ethernet, RS232 or I2C. (There are device and host USB ports on the RoboRio.) I am trying to figure out which channel to use. I am leaning towards I2C. Anyone have any experiences to share?
I2C normal mode will transfer approx. 12.5K bytes per second, so that is over kill for the network tables. I am nervous about doing anything Ethernet based due to the strange network tricks they pull during the contests.

I am using NI Vision right now. It is working great. I am able to run 640 x 480 at around 25 FPS with 10% compression. I haven’t started trying to make the code more efficient yet but I am sure that I can squeak a few more frames per second out of it. I am hoping to have it running this weekend.

I have the vision system on and have the exe made. I just have not had time to put it all together yet. I am keeping my fingers crossed.

I’m not sure what strange network tricks you are referring to. The configuration of the router and the field is pretty well documented, and if you have questions, someone may just answer them. Network Tables runs over TCP. Modifying it to run without TCP would be a big task. If you want to use I2C or another communication method, just pack or encode the data, transmit, and reverse on the other side. It isn’t hard either, but I wouldn’t advise mixing network tables and anything that doesn’t support TCP.

Greg McKaskle

Hi Greg,

I wasn’t planning to do anything to the NT server stuff. I was simply thinking that I could get a little more efficiency in the video processing and the camera coms. I am sure there is somewhere I can find something. Maybe not but I am going to look and see. I want this to be as fast as possible. If nothing else I get a better understanding of how it all work so I better understand it for following years.

Tim

My response was mostly to the other post. If you want to reduce latency when using network tables, you may want to consider a flush call immediately after you post time-sensitive stuff. You can also change the update rate of the client and server, but as you set it smaller, you do increase network traffic and CPU load, so watch for those side-effects if you make those changes.

Greg McKaskle

Hi Greg,

After a few hours of trying we got the Kangaroo to talk to the RoboRio. What do I need to do to have the Kangaroo set up as it’s own client? I used the Dashboard name for the client on the Kangaroo and it worked. When I switched it to the Kangraoo name I did not get data. I am guessing that I have to set up the Kangaroo as its own client for this not to happen. What are that basic steps to do this?

One other thing that I am not liking is that we talk as long at the RoboRio is connected than we get really long delays when the RoboRio is not connected. This interferes with the vision processing. I would like to have this so if we are not talking to the RoboRio that we do not cause problems with the vision loops. I can build my own client using the vi’s that are provided but if there is something simple that I am not doing I would prefer to play in FIRST’s world. I did chase down where we are having the problem and I am sure that I can program around the problem I’m just wondering if I am not doing something correctly and that is why I am having the problem in the first place.

Thanks for any advice,

Tim

The client name is just an identifier and is just for documenting which client is which. It shouldn’t have any impact on a connection. If not provided, the IP address is formatted and used for the name.

The important parameter is the server IP. You either need to “know” this or have mDNS be able to find it using the name. You may want to install the nimdnsResponder or another mdns tool to help with this. I’m not sure if StrToIP node in LV will work for this situation. The server is the robot, by the way, and if that isn’t present, the clients do not actually communicate to one another. They go into unsynchronized mode and should run locally at full speed. I’m not sure what is causing your vision code to run more slowly. Can you explain it?

Greg McKaskle

Come to find out I only see the overload problem when the driver station is running and not connected to the robot. I was testing on a different computer so it did not have the correct team number in it for the RoboRio. It seemed that the driver station must have been blasting the RoboRio with data and slowing down all of the connections… As sson as I closed the driver station I had vision running normally with or without the RoboRio.

If the DS isn’t connected to the roboRIO, it isn’t directly basting it because it doesn’t know who to blast. But it is making mDNS requests to find it every two seconds, and it may be pinging if you are on the diagnostic tab.

Greg McKaskle