Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   Porting Tower Tracker to CPP (http://www.chiefdelphi.com/forums/showthread.php?t=145898)

Bernstern 18-03-2016 17:03

Porting Tower Tracker to CPP
 
Does anyone have a good way to translate (or if it already works its ok) the TowerTracker.java program into CPP to run on a Coprocessor (Tk1)?

jreneew2 18-03-2016 17:20

Re: Porting Tower Tracker to CPP
 
I ported it to c++ here: https://github.com/team2053tigertron...bot/src/vision

It's a little rough, but worked for us in Pittsburgh very well.

lethc 18-03-2016 17:35

Re: Porting Tower Tracker to CPP
 
Quote:

Originally Posted by Bernstern (Post 1559492)
Does anyone have a good way to translate (or if it already works its ok) the TowerTracker.java program into CPP to run on a Coprocessor (Tk1)?

Just a heads up, we tried running TowerTracker on a TK1 at Greater Kansas City and spent literally all of Thursday trying to get it to communicate over ethernet. We got the calibration images we needed from the field about 30 seconds before we had to leave. The competition router image disables DHCP, and we hadn't planned for this. To fix it we had to set all of our devices' (Driver station, TK1, RoboRIO) IPs to static which took awhile because we hadn't planned for it.

Basically if you're planning on communication with the Jetson over ethernet make sure you account for the fact that the router competition image is different from the 'home use' image. I really don't want anybody to go through what we went through on Thursday:D

Arhowk 19-03-2016 07:17

Re: Porting Tower Tracker to CPP
 
Quote:

Originally Posted by lethc (Post 1559509)
. The competition router image disables DHCP, and we hadn't planned for this.

No it doesn't? The field uses pure DHCP communications except for the router. You get assigned a dhcp IP address in the range of 10.xx.yy.zzz in contrast to the 169.254.xx.xx address in the pits.

Ben Wolsieffer 19-03-2016 12:54

Re: Porting Tower Tracker to CPP
 
Quote:

Originally Posted by lethc (Post 1559509)
Just a heads up, we tried running TowerTracker on a TK1 at Greater Kansas City and spent literally all of Thursday trying to get it to communicate over ethernet. We got the calibration images we needed from the field about 30 seconds before we had to leave. The competition router image disables DHCP, and we hadn't planned for this. To fix it we had to set all of our devices' (Driver station, TK1, RoboRIO) IPs to static which took awhile because we hadn't planned for it.

Basically if you're planning on communication with the Jetson over ethernet make sure you account for the fact that the router competition image is different from the 'home use' image. I really don't want anybody to go through what we went through on Thursday:D

We ran into the same problem at our event. The competition bridge configuration doesn't disable DHCP, it just doesn't have a DHCP server (because it expects to use the one on the field). This causes the driver station and robot to get an autoconfigured IPv4 address (169.254.x.x), but the Jetson does not.

We fixed this at the competition by using static IPs, but it could likely also be fixed using avahi-autoipd (see: https://wiki.ubuntu.com/ZeroConfNetworking) to assign an IP without DHCP, but I have not tried this yet.

jreneew2 19-03-2016 15:39

Re: Porting Tower Tracker to CPP
 
So when giving devices that run network tables an ip you can give it roboRIO-XXXX-frc.local? Or a static ip that you set?

Arhowk 19-03-2016 16:31

Re: Porting Tower Tracker to CPP
 
Quote:

Originally Posted by jreneew2 (Post 1559735)
So when giving devices that run network tables an ip you can give it roboRIO-XXXX-frc.local? Or a static ip that you set?


The former if you are using DHCP, the latter if your team is moved to static ip for some reason (the former still works in the second case but it is more reliable to go straight to the IP address if it is known)

jreneew2 19-03-2016 17:08

Re: Porting Tower Tracker to CPP
 
Ok thanks!

Bernstern 20-03-2016 14:30

Re: Porting Tower Tracker to CPP
 
Quote:

Originally Posted by jreneew2 (Post 1559501)
I ported it to c++ here: https://github.com/team2053tigertron...bot/src/vision

It's a little rough, but worked for us in Pittsburgh very well.

You're a lifesaver but how do i send the distance to center (all we need) over networktables and into our java code?

-Freshmen :)

jreneew2 20-03-2016 14:43

Re: Porting Tower Tracker to CPP
 
Our team is actually working on that now! Except we are using a raspberry pi. For us, we compiled the network tables code onto to pi and included in our code. Then you just send the data as with any other code. Here is a wpi screensteps page I found that was helpful.

https://wpilib.screenstepslive.com/s...client-pc-side

Bernstern 20-03-2016 15:39

Re: Porting Tower Tracker to CPP
 
Quote:

Originally Posted by jreneew2 (Post 1559995)
Our team is actually working on that now! Except we are using a raspberry pi. For us, we compiled the network tables code onto to pi and included in our code. Then you just send the data as with any other code. Here is a wpi screensteps page I found that was helpful.

https://wpilib.screenstepslive.com/s...client-pc-side

Thanks a ton, we spent the last week trying to flash our tk1 then trying grip but this may be our answer :)

waialua359 20-03-2016 15:53

Re: Porting Tower Tracker to CPP
 
Quote:

Originally Posted by lethc (Post 1559509)
Just a heads up, we tried running TowerTracker on a TK1 at Greater Kansas City and spent literally all of Thursday trying to get it to communicate over ethernet. We got the calibration images we needed from the field about 30 seconds before we had to leave. The competition router image disables DHCP, and we hadn't planned for this. To fix it we had to set all of our devices' (Driver station, TK1, RoboRIO) IPs to static which took awhile because we hadn't planned for it.

Basically if you're planning on communication with the Jetson over ethernet make sure you account for the fact that the router competition image is different from the 'home use' image. I really don't want anybody to go through what we went through on Thursday:D

We went through the same thing as you folks on that Thursday!😬 Spent 3 hours on it!

jreneew2 20-03-2016 16:01

Re: Porting Tower Tracker to CPP
 
Quote:

Originally Posted by waialua359 (Post 1560037)
We went through the same thing as you folks on that Thursday!😬 Spent 3 hours on it!

So would you say it is better to set static ips for everything for competition? I have seen conflicting information about static and dynamic ips.

If so, how do you go about setting ips to static on the roborio, raspberry pi etc?

waialua359 20-03-2016 16:05

Re: Porting Tower Tracker to CPP
 
Quote:

Originally Posted by jreneew2 (Post 1560039)
So would you say it is better to set static ips for everything for competition? I have seen conflicting information about static and dynamic ips.

If so, how do you go about setting ips to static on the roborio, raspberry pi etc?

According to the manual, it is not recommended. However, FTA finally said to go ahead and setup using a static IP and gave us a range to work with. I'm not the Control Systems person, but I can tell you that he tried troubleshooting everything to get it to work. It was our only option.
It's worked fine for 2 events already.

jkelleyrtp 20-03-2016 16:53

Re: Porting Tower Tracker to CPP
 
Quote:

Originally Posted by waialua359 (Post 1560043)
According to the manual, it is not recommended. However, FTA finally said to go ahead and setup using a static IP and gave us a range to work with. I'm not the Control Systems person, but I can tell you that he tried troubleshooting everything to get it to work. It was our only option.
It's worked fine for 2 events already.

What range did he give you? I want to make sure ours is good-to-go beforehand so we won't have to debug comms during practice matches.


All times are GMT -5. The time now is 09:10.

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