Companion: TK1

3691291283?profile=original

Here is a progressive guide to using my Nvidia Jetson TK1 as a companion computer with an Ardupilot/APM/Pixhawk flight board.

Things will be added as I get through my list of experiences, hopefully by the end I will have a nice .img file of everything I tried/did, so others may just make a copy and install.

All in time.

*Please note, I migrated my experiences here to continue to ensure I can be a part of an open source project, sharing ideas for others to use freely*

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Hi - i am really interested in how far you got with the TK1 as a Flight Controller - i have one and a kinect sitting idle - (it was driving my ground rover) and now i would like to put it in a UAV if possible - did you ever get a useful working img setup that you would share - cheers - look forward to your reply..

  • Got the TK1 today, super simple to setup:

    First time setup =

    1)Plug in power

    2)command: cd NVIDIA-INSTALLER

    3)command: sudo ./installer.sh //(installs the desktop environment)

    4)command: sudo reboot

    /---------------------------------------/

    Ubuntu is pre-installed to the TK1's onboard 16GB fast eMMC (i think)

    Things I want to setup this week:

    1)3d print a case

    2)look at the mini pcie options: wifi + bt 4.0

    3)look into the db9-uart port, see if it's possible to have mavproxy run through this into the APM board

    4)hardware button shutdown?

    5)look into an ssh app + remote keyboard/mouse app to control using my android tablet. (I would like to do away with keyboard & mouse)

    /--------------------------------------/

    Soon:

    1) look at available vision systems. I had a few rejection emails for dev kits, and too costly ($$$$) for me to buy as a diy tech developer, so in true DIY style it might be some kinda hack of a laser range finder, or a kinect-mod with a brighter ir-led installed. see how that goes.

    2) the sata power port looks like a neat option for +5v & +12v outlet for devices. time will tell.

    3)look into gpio for servo control/sweep

    Thanks, look forward to DiyDrone input.

    • 3702628824?profile=original

      Things I've learned over coffee:

      1) Soft power button brings up Ubuntu shutdown options menu.

      2) There's an Android app which enables ssh control, and also acts as a mouse & keyboard for Ubuntu. There is a guide to making it work here, however i'm currently having issues after executing 'sudo apt-get install xdotool'. console says 'unable to locate xdotool', so I have to fix that.

      That's all today.

      Home Remote Control - Apps on Google Play
      The one Remote Control for your Windows/OSX/Linux/Kodi system. Key Features • Control mouse/keyboard • Control the sound volume • List/manage/downl…
    • There is a way to modify the power button to shutdown on press.

    • Update:

      So I decided to get myself a mini pcie wifi & bt 4.0 module (Atheros AR5B225 WLAN Bluetooth 4.0 Mini PCIE WiFi Card > eBay > $2)

      3702802044?profile=original

      I also required a pair of antenna (which strangely cost more than the pcie card):
      3702802407?profile=original
      Unfortunately (or fortunately if you are a developer wanting to start from scratch) the TK1 does not have a vast array of driver handling as it arrives in the box.

      So I had to install the Grinch kernel:

      My board: Jetson TK1 R19 Rev 2.0 (important to check using: "sudo head -n 1 /etc/nv_tegra_release")

      Therefore for my R19 version: Grinch Kernel version: 19.3.6

       -install guide worked first time: (https://gist.github.com/jetsonhacks/928d84f159e1c7c2eacb)

       -few tweaks used here: (https://gist.github.com/jetsonhacks/9259acbd31b2dfc6dfe6)

       -bit more information: http://jetsonhacks.com/2014/10/12/installing-grinch-linuxfortegra-l...

      Result:

      Amazingly, everything compiled and installed smoothly and without issue first time. Coming from an Arduino background, it is pretty similar to using a host computer with Arduino IDE > connecting the Arduino to the computer > compiling > uploading.

      In the case of the TK1, it requires a host computer running linux (to use terminal commands), I used the latest Ubuntu on a (ghetto) laptop. Compiling, then installing to the TK1 is all done using USB cable & Terminal window.

      3702812990?profile=original

      It took about an hour and a half to compile and upload the Grinch code.

      The Grinch works well. I have my Mini Pcie WIFI + Bt 4.0 adapter working straight away. 

      As a test, I connected & played some youtube using audio over bluetooth A2DP to a small speaker.

      Future:

      Anyway, I just wanted a pcie wifi device to allow me to setup and use ssh with my android device. it cost me very little, and works without issues. It was a gamble on which devices are compatible with the TK1.

      I'll be testing the ssh + android app soon.

      Hope this helps others.

      For this process you will need:

      • A host desktop or laptop computer running Ubuntu Linux 12.04. This may be a VM, I've used VirtualBox.
      • Micro USB cable provided with the Jetson TK1 kit
      • Jetson TK1 and power supply
      • Optional: DB9 null modem cable if you want to use the serial console during boot
      1. On your host computer open a Terminal, then create a directory to operate from, and switch to it. As an example:
      mkdir ~/Grinch
      cd ~/Grinch
      
      1. Download NVIDIA Linux4Tegra (L4T) Board Support Package (BSP) and Sample Root Filesystem from NVIDIA
      
      wget https://developer.nvidia.com/sites/default/files/akamai/mobile/files/L4T/Tegra124_Linux_R19.3.0_armhf.tbz2
      wget https://developer.nvidia.com/sites/default/files/akamai/mobile/files/L4T/Tegra_Linux_Sample-Root-Filesystem_R19.3.0_armhf.tbz2
      
      1. Extract NVIDIA files (BSP and rootfs)
      
      tar -xvf Tegra124_Linux_R19.3.0_armhf.tbz2
      cd Linux_for_Tegra/rootfs
      sudo tar xpf <path_to>/Tegra_Linux_Sample-Root-Filesystem_R19.3.0_armhf.tbz2
      # E.G. ~/Grinch for <path_to>
      
      1. Grab Grinch custom kernel files
      
      cd ..
      wget http://www.jarzebski.pl/files/jetsontk1/grinch-19.3.6/zImage -O kernel/zImage
      wget http://www.jarzebski.pl/files/jetsontk1/grinch-19.3.6/kernel_supplements.tbz2 -O kernel/kernel_supplements.tbz2
      wget http://www.jarzebski.pl/files/jetsontk1/grinch-19.3.6/tegra124-pm375.dtb -O kernel/dtb/tegra124-pm375.dtb
      
      1. Apply binaries
      #sudo is important here
      sudo ./apply_binaries.sh
      
      1. Enable support for USB 3.0 (OPTIONAL) According to the L4T R19.2 Release Notes, you should modify the odmdata settings in "jetson-tk1.conf" (located in the top directory) to enable USB 3.0:
      
      #USB 2.0 operation on USB2 port(J1C2 connector)/for use as root device use ODMDATA=0x6009C000;
      #USB 3.0 operation on USB2 port(J1C2 connector) use ODMDATA=0x6209C000, requires firmware load from userspace or initial ramdisk
      ODMDATA=0x6209C000;
      

      make sure to save the file.

      1. Connect the Jetston TK1 to the flashing Linux computer via the micro-usb cable, and place the Jetson TK1 into recovery mode (by holding down the hardware Recovery button on the board and either pushing the Reset button if power is already plugged in, or plug in power for the first time).
      2. Run lsusb on your flashing computer and make sure you see some kind of NVIDIA device
      3. Flash the entire board from flashing computer command line (this will take some time to build the image and then download everything via usb)
      
      sudo ./flash.sh -S 14580MiB jetson-tk1 mmcblk0p1
      

      If you get an error loop device failed, edit flash.sh on your flashing computer to replace this line:

      losetup /dev/loop0 system.img > /dev/null 2>&1
      

      with this line:

      losetup --find --show system.img
      
      1. You should eventually see Reset the board to boot from internal eMMC. on the host computer. At that point, press the Reset button on the Jetson board or power cycle it.

      2. You should boot messages scroll by on a monitor connected to the Jetson. Optionally, you can connect to your Jetson using the DB9 null modem cable and screen /dev/cu.usbserial-A602FDXV 115200 8N1 on the host computer and verify that boot messages scroll by after reset.

      3. Default login is user ubuntu, password ubuntu. You can sudo su to change to root user if necessary.

      Note: if you just want to flash the kernel (this should be fast):

      
      sudo ./flash.sh -k 6 jetson-tk1 mmcblk0p1
      

      You should be good to go at this point.

    • Update:

      For the record, I got an Android ssh + mouse + keyboard app working with the TK1.

      The android app is called 'Home Remote Control'.

      Negative points:

       - It has a nag screen to upgrade to a pro version which I.....blah.

       - It seems that when TK1 is started, without a keyboard or mouse initially connected, I'm not getting the mouse cursor on screen showing up, even though I can move around, forcing me to guess, or replug/unplug the mouse which brings up the cursor and fixes the issue. Bit of a pain. Maybe fixable somehow? SSH works well.

      Maybe try a different remote app in future....There's lots of them.

      To use a remote app on the TK1 you have to install SSHserver & XDOtool:

      sudo apt-get install openssh-server
      sudo apt-get install openssh-client
      sudo service ssh restart

      ssh localhost

      sudo apt-get install xdotool

      That is all.

      Later on, I'll be upgrading again to L4T 21.3 (Grinch), but for now some discovery and exploring.

      - I have a good idea to create a 3d-printed case/drone mount for the TK1 which i'll get around to making this next week or so. I hope to integrate a decent LED-Ring switch to allow me to boot/shutdown with a little bit of $swag$.

      I would really like it if there are some device developers out there who would offer me test devices, right now, i'm looking at Kinect & Webcam + OpenCV, but would be pleased to get involved with Zed/Lidarlite. Any offers just get in touch. Thanks

      Home Remote Control - Apps on Google Play
      The one Remote Control for your Windows/OSX/Linux/Kodi system. Key Features • Control mouse/keyboard • Control the sound volume • List/manage/downl…
    • Figuring out how to mount this to F450. It is do-able:

      3702888076?profile=original

      I mean, how much is the DJI Matrice 100 + Manifold again?

    • I have belief that the tk1/tx1 module is going to create a next generation of drones that are complete packages > I can see why DJI added it to their system. The TK1, i'm certain, is capable of flight control + 4gmetry + vision system + on-the-fly image processing + more. All in one package. - a downward facing webcam to manage optical flow & precision landing, a depth camera such as zed/or a DIY 360 lidar controlling obstacle avoidance & point cloud mapping.

      I think 3DR would be wise to create a standalone IMU unit for the TK1, an install script for Ardupilot + 4gmetry, and the vision systems will arrive and develop separately.

    • Coming along, I think.

      3702931410?profile=original

    • 3702605855?profile=original

      Cover:

      3702727648?profile=original

      Today I also contacted Ericsson & Huawei to help me find a Half-mini pcie 4g lte board so I can make better use of 4gmetry with APM. Fingers crossed I get some good support form these guys. 

      Update:

      Unfortunately I have no reply yet. I have looked around the internet and only seem to find full-mini 4g lte boards, it would make the TK1 look a bit clumsy, i'd have to 3D-print a holder to keep it flat.

      The good news is, that my 3.5G HSDPA+ dongle works with Grinch Kernel without having to install anything (wvdial, ppp, qt) to Ubuntu. It already has a neat setup wizard. Here's a picture:

      3702728409?profile=original

      (Green for Go)

      Now, I need to read up on enabling UDP over 3G/3.5G/4G, sending webcam video to the New Droidplanner app, installing and configuring mavproxy.

      I'd also be interested in learning about 4Gmetry from @Silvio.

      I'm sure it's a neat collection of scripts, i'm wondering if it is:

      - using wvdial, ppp qt, to make the 3G connection for boards not running ubuntu such as Odroid & Rpi2?
      - is it therefore limited to certain usb modems & supported/tested drivers?

      - is it also including mavproxy?

      - is it also including gstreamer?

      It's all really interesting anyhow. It's a totally new level of drone use. Too complicated for general users, but eventually should be good as a package.

      Update #2:

      Looks like whole 'TK1 on a Drone' thing is taking off.

      Even at low-entry & poorly funded institutions such as MIT

      I wish I had a doctoral and funding...

      3702803476?profile=original

      video here

      Update #3:

      Power Switch (Auto Shutdown) Mod:

      https://www.youtube.com/watch?v=lSCIaMG4plE

      Update #4:

      Kinect room scanning:

       

This reply was deleted.