chip updates: biggggg communications day [updates]
So today is all about figuring out how to get things to talk to each other.
(1) Get the Jetson to talk to the RIO
(2) Get the Jetson to talk to the ArduPilot
(3) Get our development computers to talk to the Jetson (what's the best way?)
There's a lot of cables running to and from things, there's a lot of things connected to this robot. I mean I have my MacBook hooked up to the roborio to push/deploy code, I have the Jetson TX1 connected to my monitor so I can program that, I have a windows laptop connected to the RoboRIO so we can enable/disable the robot. So much going on man - so much!
Yea... there's a lot going on here. So we want to simplify it as much as possible. We'll figure out how to do that eventually, but hopefully, after today, we won't need to get into the RoboRIO at all.
So yesterday, there was a lot that happened because there were many things we needed to figure out making it really hard to log things as we were going so let's summarize what we did.
On the RoboRIO:
On the RIO code itself, Ronak went in and added a network tables code that continuously publishes information about the robot's state and any given timestep. For each leg it publishes the following info:
- Foot X, Y, Z positons
- Positions of the joints Theta_1, Theta_2, Theta_3
- TOTAL, unsigned output current to the leg actuators
It publishes this information over the Network Tables protocol over the Ethernet Bus the RIO has in-built.
It publishes that data in a table called "chip"
NOW, On the Jetson:
On the Jetson, things are slightly different. What we did a while ago is:
(1) we've installed Jetpack, we've connected the Jetson to WiFi
(2) we've installed ROS Melodic
(3) we've installed MAVROS and added geographic libs like instructed
Anytime we want to SSH: ssh email@example.com
As long as we are all on the same WiFi this should work. The thing is, we don't know what wifi we will be on at anytime, so we CAN setup a wifi network on-board the robot with a router, but we won't yet, that's for later.
It's also worth to note, that currently we're trying NOT to use the SD Card we bought. Just have everything on the Jetson itself. That's faster, and much easier.
So here's now what we've done: we've created a Catkin_WS and an src folder, and we did catkin_make, now we have a workspace we can work in.
After all that stuff above, we created a TEST folder that will allow us to write a test-program to use PyNetworkTables just to see if that would work.
- Installed PIP using sudo apt install python-pip
- Installed PY Network tables 2018.2.0 b/c python 2 pip install pynetworktables==2018.2.0
Now we did get the test program printing values to the console, but that's basic stuff, what we want to log, really, is HOW DID WE GET THE JETSON AND RIO TO TALK TO EACH OTHER.
So here's the thing. In FRC, all devices are DHCP and they're assigned IP addresses with the FRC Radio that is on-board the robot (a specially configured router). We do NOT HAVE an FRC radio which means if we plug the ethernet cable straight from the Jetson into the RIO, the Jetson doesn't actually connect to the network because nothing is assigning it an IP. It's waiting to get assigned an IP and it isn't happening. SAME with the RIO.
So to get them to talk to each other (not to mention NetworkTables needs to know the IP of the RIO) we need to assign static IPs. https://elinux.org/Jetson/FRC_Setup this link gave us an idea of what the IP should be.
On the Jetson side, we went into the settings next to "WiredConnection1" and changed the following things.
DNS Servers: 126.96.36.199, 188.8.131.52
We saved that and then the Wired Network connected with no issue. The problem is NOW we don't know what the IP of the RIO is. So we go to the RIO web client.
On a PC with DriverStation and Internet Explorer. I typed in "roboRIO-FRC-2020.local" into the web browser and it brought up the following client. Then in network settings, we changed the IP address to MANUAL and set it to: 10.20.20.2
INTERNAL ROBOT NETWORK
RoboRIO IP: 10.20.20.2
Jetson IP: 10.20.20.12
And then everything worked!