NVIDIA Jetson TX2 integration - ethz-asl/mav_dji_ros_interface GitHub Wiki

In this page, we can find information on

We hope our framework helps you and please consider to cite us in your work!

Parts list

This page documents the parts required to integrate NVIDIA Jetson Tx2 on the VI-drone. The part ID below counts from part lists to avoid possible confusions.

ID Name Qty Description Where to buy Price (USD/item)
26 NVIDIA Jetson Tx2 module 1 Tx21 webpage 533.32
27 Orbitty Carrier Board 1 Extention board(1 USB 3.0 port) 1 webpage 185.64
28 Active heatsink 1 Heatsink with a fan 1 webpage 27.46
29 64B MicroSD 1 Class 10, 80MB/s, for external storage webpage 22.99
30 Tx2 housing case 1 3D printable using PLA(2 parts) .STL1 / .STL2 --
31 Plastic supporter 4 Hex Spacer M3 X 10 [webpage](add link here) xx
32 Threaded inserts 2 M3 X 3 Knurl Nuts webpage xx
33 WiFi antenna socket 2 RP-SMA to UFL WiFi cable webpage 6.67
34 Screws 4 Socket Head Cap M3 X 6 Bolt N/A
35 Screws 2 Socket Head Cap M3 X 6 Bolt N/A

1 Note that the price excludes VAT that varies depending on countries.

Hardware integration

Tx2 housing parts The housing parts in the description can be printed. The parts above was printed by an Ultimaker 2+ with PLA. Bottom threaded inserts push the knurl nuts into the assembly holes with a soldering iron. Plastic supports for Tx2 Assemble the hex spacers to the Jetson TX2/Carrier board assembly. The design is based on the Orbitty Carrierboard provided by Connection Tech.Inc WiFi antenna sockets mount Assemble the SMA connectors to the housing. Zoom in view Fasten the SMA connectors using washers Tx2 antenna terminal mount Mounting on M100 Use the 3D printed fastener to fix the Jetson assembly to the quadrotor Tx2 power consumption

Multi-device network setup

This tutorial records the basic way to setup the multi-device ROS network, which allows you to control all nodes with the node-manager from the host laptop. As shown in the above figure, the network should be configured:

  • there is a router (e.g. router in the Vicon room) sharing wifi/ethernet with the whole system;
  • the host laptop (Device (1)) is connected via wifi or ethernet cable;
  • the UP board (Device (2)) is connected via wifi, which is based on its network interface wlan0;
  • the Jetson TX2 board (Device (3)) is connected to the UP board (2)'s eth0 interface via Ethernet cable (LAN);

To use the node-manager on the host laptop (1) controlling all nodes from all the three devices, full access to bi-directional connection between each two devices is required. Since the LAN network and the Router's network are in separated domains, a bi-directional gateway should be setup on the UP board (2). More exactly, it's the bi-directional connection between the two interfaces eth0 and wlan0. And for a stable network configuration, the whole network is configured with static IPs.

On the host laptop (1)

On the host computer, simply setup the hostname and connect to the router via either wifi or ethernet cable.

Then set up the IPV4 method to manual with static IP and netmasks. Go to [Edit Connections] under your network-manager, and choose the connection "flynet-an". Then open the window for editing the connection information. Under the tab [IPV4 Settings], make the following changes (DNS server can be set to your router IP if you want to access the websites like www.google.com):

Add one more static route path for your Device (3) with the IP address in the other network domain, which allows you to find the Device (3) via the intermediate Device (2). In the terminal, you may do this with the following command:

$ sudo ip route add 10.42.0.97 via 10.10.10.126 dev wlan0

"10.42.0.97" is the IP address (LAN domain) of the eth0 interface of Device (3), while "10.10.10.126" is the IP address of the wlan1 interface of Device (2), which may serve as a Ubuntu router. "wlan0" is the network interface of your Host laptop (1).

Add the multicasting to your route table for using node_manager. In the terminal, input the following command (wlan0 should be adjusted to the network interface you will be using on your host computer):

$ sudo route add -net 224.0.0.0 netmask 240.0.0.0 wlan0

After the configuration, your route table should be as the following figures. Check your route table with the following commands in the terminal:

$ route -n

On the Up board(2), or Intel Nuc

On the UP Device (2), you may want to use one ethernet interface eth0 and one wifi interface wlan1! wlan1 is used to connect to the router network, while eth0 shares the wifi via a LAN network {ethernet cable with Device (3)}. Basically, you may follow the links below on how to setup such a sharing network and configure the gateway between wlan1 and eth0 interfaces.

Useful link1

Useful link2

There are several important things to be noted.

  1. Enable the net.ipv4.ip_forward by setting the corresponding parameter to 1 in the system configuration file /etc/sysctl.conf.
$ sudo vi /etc/sysctl.conf

Set the line to

net.ipv4.ip_forward=1

Apply the change without rebooting your machine:

$ sudo sysctl -p
  1. Remove all the entries with "Reject" in the iptable chain FORWARD to remove the icmp firewall:
$ sudo iptables -L --line-number

$ sudo iptables -D FORWARD 5
$ sudo iptables -D FORWARD 4

Check your iptables with the following commands in the terminal:

$ sudo iptables -L

3. Save your modified iptable to a iptable rule file .rules or .save.

$ sudo iptables-save > /etc/iptables/rules.v4
  1. Load the saved iptable before you want to use it:
$ sudo iptables-restore < /etc/iptables/rules.v4

You may try with other tools to manage your iptables.

  1. (Question: which interface should be used?) Add the multicasting to your route table for using node_manager as you do for Device (1). In the terminal, input the following command:
$ sudo route add -net 224.0.0.0 netmask 240.0.0.0 eth0

Check your route table with the following commands in the terminal:

$ route -n

On the Jetson TX2 Device(3)

Here just a LAN network connection should be connected via your eth0 interface. Add the multicasting to your route table for using node_manager as you did for previous two devices. In the terminal, input the following command:

$ sudo route add -net 224.0.0.0 netmask 240.0.0.0 eth0

Check your route table with the following commands in the terminal:

$ route -n

Verifying the successful configuration

After configuring all the devices, you may check the iptables or route tables on all the devices to see if they are just as you expected!

On each device, try to ping other two devices. If all the pinging operations are successful, then congratulations! Your ROS network should be ready!

Save your iptable {on UP board Device (2)} and load it by default on startup, (still not working)

Method 1: Adding the commands to the file /etc/rc.local.

$ sudo vim /etc/rc.local

Just edit the file and put some stuff like below.

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# iptbles configuration for internet connection sharing
iptables-restore < /etc/iptables/rules.v4
# Enable multicasting on the network interface
# (for node manager and should be added on every device)
route add -net 224.0.0.0 netmask 240.0.0.0 dev wlan0
exit 0

Method 2:

  1. save your iptable to a local file
$ sudo iptables-save > /etc/iptables.rules
  1. In the file /etc/network/if-pre-up.d/iptables, write:
#!/bin/sh
iptables-restore < /etc/iptables.rules
exit 0
  1. Then, in the file /etc/network/if-post-down.d/iptables, write:
#!/bin/sh
iptables-save -c > /etc/iptables.rules
if [ -f /etc/iptables.rules ]; then
iptables-restore < /etc/iptables.rules
fi
exit 0
  1. Finally, give executable permission to the scripts:
$ sudo chmod +x /etc/network/if-post-down.d/iptables
$ sudo chmod +x /etc/network/if-pre-up.d/iptables

How to setup the devices' hostnames and add them in the router admin tools

  1. To change your hostname temporarily and it will work until you reboot the machine: In terminal / command console, run the command:
$ sudo hostname NEW_NAME_HERE
  1. To permanently change your device's hostname, you may edit in the files “/etc/hostname” and “/etc/hosts”. Open terminal and run command (or use whatever text editor with sudo):
$ sudo gedit /etc/hostname /etc/hosts

When the files open, set the new hostname:

  • /etc/hostname is a simple one-line file, change the name to the hostname you want.
  • /etc/hosts maps IP addresses to host names, change the name in the second line and make it SAME to the name in /etc/hostname.

Without restarting your machine/re-login, just run the command below to restart hostname service to apply changes (otherwise just reboot your machine):

$ systemctl restart systemd-logind.service

P.S. Add the corresponding IP addresses and hostnames of other devices in your network in the file /etc/hosts, in case that your router doesn't broadcast the hostnames.

Acknowledgement

We would like to thank Jaeyoung-Lim from ETH-ASL in providing 3D cad models of NVIDIA Jetson2 housing and Qixuan Zhang for testing/documenting Multi-device network setup.

⚠️ **GitHub.com Fallback** ⚠️