scout updates: flashing the core-controller with software [updates]
Now that we figured out a few days ago that we can control the Spark Max controllers over a USB/CAN emulator. I figure we can wire them straight to the Jetson and not worry at all about an Arduino controlling things. With their unique CAN-IDs the USB port should also not be a problem.
So the setup would look something like, JETSON-->USB HUB-->SENSORS JOYSTICKS AND FIRST SPARK MAX CONTROLLER-->SPARK MAX TO ALL OTHER SPARK MAXS.
There are a Few Pieces of Software to Install:
(1) ROS Melodic http://wiki.ros.org/melodic/Installation/Ubuntu
(2) Install the latest Java
(3) Go Through the Install of WPILIB and CAN Controllers for Spark Max! Refer to this post for all of those.
(4) Ardupilot AP Sync Libraries for Use with the GPS Later
Step 1: Installing ROS
Anyways. Before we get there we need to start by flashing some other very very ver important software. ROS!!!! WE NEED ROS!!! Since this Jetson TX1 is running on Ubuntu 18.04 LTS, we will flash ROS Melodic to the controller.
http://wiki.ros.org/melodic/Installation/Ubuntu These are the instruction for the ROS Melodic Install. I believe it will install python 2.7 as well. Which is what ROS runs on. We have Python 2.7.15+ running on this Jetson TX1 anyways. Connect the Jetson TX1 to the wifi and install ROS Melodic.
Step 2: Installing Java JDK 11.0.6
This isn't as simple as it sounds. We can't just download it from online and install. So we are going to use the openjdk-11 packages online. So type:
sudo apt install openjdk-11-jdk openjdk-11-jre
We don't want the WHOLE of the Java universe so we won't install openjdk-11* because that's irresponsible when we have 14.7GB of free space. The ONLY reason we are installing Java is to help compile the WPILIB FRC Libraries we will install in the next step.
Step 3: Install VSCode Tools
We're going to follow the following set of instructions to do this. They were figured out a few days ago on my Mac. We just need to transfer all of the commands to linux. SAME THING just the linux version.
EXCEPT FOR ONE THING: YOU CAN'T DOWNLOAD VS CODE AND JUST RUN IT ON THE TX1, WE NEED TO BUILD IT FROM SCRATCH. FOLLOW THESE INSTRUCTIONS TO DO THAT: https://github.com/zenetio/Install-VScode-On-TX2
Note: On the above install list, when it says you MIGHT need gcc and g++ and make, you DO need gcc and g++ and make so install those as well.
ISSUES: We did run into an issue in the last steps when running yarn it says ERROR use nodejs >=10 or <=12 --> we have node's version 8.
When looking at the preinstall.js file, we notice that this version of VSCode requires nodejs 10 or greater. We have to install that instead. Take a look at: https://stackoverflow.com/questions/10075990/upgrading-node-js-to-latest-version
This is the NodeJS version manager that upgrades you to the latest stable version:
(1) sudo npm install n -g
(2) sudo n stable
NOW WE ARE USING JS 12.14.1 and we can build VS code - now go to the yarn command and run that. Then go onto the vscode install.
OKAY NEXT ISSUE: we don't have enough MEMORY to build VS Code on the Jetson TX1. So we need to use a swap partition. Swap partitions allow the computer to use some of the STORAGE as MEMORY temporarily during a high-resource build.
So the intuition is - since this computer has 4GB of RAM, the issue isn't in the amount of RAM we have, it's in the face we've had Firefox open for quite some time. Let's restart the computer, thereby clearing the RAM and then run the build again.
Then run ./vscode/scripts/code.sh every time you want to open VS Code!
Step 3: Install WPILIB
We're going to follow the following set of instructions to do this. They were figured out a few days ago on my Mac. We just need to transfer all of the commands to linux. SAME THING just the linux version. (See VSCode install above).
Before we did this - we went to the App center and uninstalled all the unnecessary programs that come with ubuntu to free up space. This includes all the games, and all of Libre-Office (sorry). This way we can extract WPILIB. Even then - we may not have enough free-space to extract WPILIB so we're going to add some storage to this Jetson board. We're going to get this SD Card. To add memory to the Jetson. We know it is compatible. This will serve as an extracting workspace. For today we used a USB.
So we have NOW INSTALLED WPILIB ON THE JETSON WOOO!!!!!!
Step 4: Install and Build the CANBridge by REV
So here the instructions change a little. We got it wrong in the last post. We are going to copy this repository to the USB. And then follow the instructions to build in on the GitHub. Remember to run ./gradlew command with super user sudo -s.
BOTH THE BUILD AND THE PUBLISH WERE SUCCESSFUL WHEN WE RAN AS ROOT WOO!
So it built, we have no idea where it went but it built. So we should be able to use the USB-to-CAN Bridge.
So what we are going to do now is do the SAME thing as above but clone the repository into the HOME directory instead of the USB drive. I think that may be the issue. So let's do that and run the build. This time it build-and I believe this means it is usable. We will find out soon enough. I've asked a question online to see if this is all correct.