├── .gitmodules ├── LICENSE ├── README.md ├── docs ├── _config.yml ├── additional_pkgs.md ├── archer_dongle.md ├── batman_setup.md ├── connecttech_elroy.md ├── detailed_back_end.md ├── detailed_front_end.md ├── detailed_setup.md ├── doorslam.png ├── flash_jetpack4_2.md ├── gpu_docker.md ├── index.md ├── kernel_module.md ├── network.md ├── quick_setup.md ├── realsense_setup.md ├── simulation.md ├── simulation_details.md ├── tx2_setup.md └── wifi_setup.md └── tx2-setup └── docker ├── Dockerfile ├── aliases.txt ├── entrypoint.sh └── instructions.md /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "simulation/robust_distributed_slam_simulation"] 2 | path = simulation/robust_distributed_slam_simulation 3 | url = https://github.com/lajoiepy/robust_distributed_slam_simulation.git 4 | [submodule "tx2-setup/robust_pose_graph_optimization"] 5 | path = tx2-setup/robust_pose_graph_optimization 6 | url = https://github.com/lajoiepy/robust_distributed_slam_module.git 7 | [submodule "tx2-setup/slam_front_end"] 8 | path = tx2-setup/slam_front_end 9 | url = https://github.com/bramtoula/multi_robot_SLAM_separators.git 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Pierre-Yves Lajoie 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Check out our latest work on Collaborative Multi-Robot SLAM! https://github.com/MISTLab/Swarm-SLAM 2 | 3 | 4 | ### DOOR-SLAM 5 | 6 | [Read the paper!](https://arxiv.org/abs/1909.12198) 7 | [Code documentation here!](https://mistlab.ca/DOOR-SLAM/) 8 | 9 | [](http://www.youtube.com/watch?v=h0bqURQlZGA "DOOR-SLAM: Distributed, Online, and Outlier Resilient SLAM for Robotic Teams") 10 | 11 | If you reuse parts of this work, please cite: 12 | ``` 13 | P.-Y. Lajoie, B. Ramtoula, Y. Chang, L. Carlone, and G. Beltrame, “DOOR-SLAM: Distributed, Online, and Outlier Resilient SLAM for Robotic Teams,” IEEE Robotics and Automation Letters, vol. 5, no. 2, pp. 1656–1663, Apr. 2020, doi: 10.1109/LRA.2020.2967681. 14 | ``` 15 | BibTex: 16 | ``` 17 | @ARTICLE{Lajoie2020DOORSLAM, 18 | author={P. {Lajoie} and B. {Ramtoula} and Y. {Chang} and L. {Carlone} and G. {Beltrame}}, 19 | journal={IEEE Robotics and Automation Letters}, 20 | title={DOOR-SLAM: Distributed, Online, and Outlier Resilient SLAM for Robotic Teams}, 21 | year={2020}, 22 | volume={5}, 23 | number={2}, 24 | pages={1656-1663},} 25 | ``` 26 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-hacker -------------------------------------------------------------------------------- /docs/additional_pkgs.md: -------------------------------------------------------------------------------- 1 | # Additional Packages 2 | On the TX2 itself, we need libraries used in our Docker containers. 3 | ``` 4 | sudo apt-get install rhash curl libuv1 libsqlite3-dev libsuitesparse-dev libfreenect-dev libdc1394-22-dev libglvnd-dev libopencv-contrib3.2 libmetis-dev libboost-all-dev libpcl-dev liblz4-dev libogre-1.9-dev liburdfdom-dev liblog4cxx-dev libtinyxml2-dev libassimp4 libyaml-cpp0.5v5 geographiclib-tools 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/archer_dongle.md: -------------------------------------------------------------------------------- 1 | ## Install drivers for the TP-Link Archer T2UH dongle. 2 | ``` 3 | git clone https://github.com/xtknight/mt7610u-linksys-ae6000-wifi-fixes.git 4 | cd mt7610u-linksys-ae6000-wifi-fixes 5 | make clean 6 | make 7 | sudo make install 8 | ``` 9 | 10 | Now if you connect the dongle and reboot, you should see it, probably on ra0, when running `iwconfig`. 11 | 12 | ## Clean up 13 | We can clean the repos used to rebuild the kernel and the dongle driver, and remove the kernel sources: 14 | ``` 15 | cd ~/buildLibrealsense2AndBatmanTX2 16 | ./removeAllKernelSources.sh 17 | cd .. 18 | rm -rf mt7610u-linksys-ae6000-wifi-fixes buildLibrealsense2AndBatmanTX2 19 | ``` 20 | -------------------------------------------------------------------------------- /docs/batman_setup.md: -------------------------------------------------------------------------------- 1 | # B.A.T.M.A.N Routing Protocol 2 | First you need some [additional kernel modules](kernel_module.md). 3 | 4 | Then to use batman: 5 | ``` 6 | sudo batctl if add ra0 7 | sudo ip link set up dev bat0 8 | ``` 9 | 10 | To obtain an IPv4 address associated to the batman interface, run: 11 | ``` 12 | sudo avahi-autoipd bat0 & 13 | ``` 14 | 15 | You can now check if you see other devices using batman either by using ping with their bat0 IPv4 addresses, or checking the neighbors: 16 | ``` 17 | sudo batctl n 18 | ``` 19 | 20 | 21 | ### Setting ra0 and bat0 interfaces automatically on boot, with a static IP. 22 | We have a script ready which can run on boot and sets up the interface with a static and manually set IP. 23 | You can find the script here: [run_batman.sh](run_batman.sh). 24 | 25 | You should copy this script in `/etc/init.d/`, and modify the `192.168.10.150` by the static IP address you want on the bat0 interface. 26 | 27 | Then run the following commands for the script to run on boot: 28 | ``` 29 | cd /etc/init.d 30 | sudo chmod +x run_batman.sh 31 | sudo update-rc.d run_batman.sh defaults 32 | ``` 33 | 34 | Once you'll reboot you should be able to check that the ra0 interface is of type IBSS connected to the NVIDIA SSID with: 35 | ``` 36 | sudo iw dev ra0 info 37 | ``` 38 | 39 | You should see the bat0 interface when running `ifconfig`, with the static IP you chose. -------------------------------------------------------------------------------- /docs/connecttech_elroy.md: -------------------------------------------------------------------------------- 1 | # Connecttech Elroy Carrier Board 2 | 3 | We used the Connectech Elroy Carrier Board on our drones for our online experiments. 4 | The TX2 should work "out-of-the-box" with the newer version of the carrier board. 5 | 6 | ### Older Connecttech Elroy Carrier Board (revision E and earlier) with USB 3. 7 | In this case, you have to install the Connecttech Board Support Package. 8 | 9 | First, flash the TX using the instructions found here: http://connecttech.com/resource-center/cti-l4t-nvidia-jetson-board-support-package-release-notes/. 10 | 11 | Once the TX is flashed, it still doesn't have everything you might want installed. You'll have to reboot it and connect a keyboard and screen to it to finalize the setup (choose login, password, etc.). 12 | To finish the process, make sure the TX2 is booted on the Ubuntu homepage and connected through USB to the desktop you use with the NVIDIA SDK manager. 13 | 14 | Open the SDK manager, and install the additional modules you want. Make sure you don't flash it again, but only install additional modules. 15 | 16 | -------------------------------------------------------------------------------- /docs/detailed_back_end.md: -------------------------------------------------------------------------------- 1 | ## Back-End 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/detailed_front_end.md: -------------------------------------------------------------------------------- 1 | # Front-End 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/detailed_setup.md: -------------------------------------------------------------------------------- 1 | # Detailed Setup 2 | 3 | 4 | 5 | # NVIDIA Jetson TX2 Setup 6 | [TX2 Basic Setup](tx2_setup.md) -------------------------------------------------------------------------------- /docs/doorslam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MISTLab/DOOR-SLAM/92fa342d62f80ee343d3db7e0b93c719f0c2054a/docs/doorslam.png -------------------------------------------------------------------------------- /docs/flash_jetpack4_2.md: -------------------------------------------------------------------------------- 1 | # Flash Jetpack 4.2 on NVIDIA Jetson TX2 2 | For this step, we use NVIDIA's SDK manager. 3 | 4 | Download the SDK manager here: https://developer.nvidia.com/embedded/jetpack. 5 | 6 | Install it, and then you can open it typing `sdkmanager` in a terminal. 7 | 8 | Follow the SDK manager instructions to flash your TX2 and make sure to install the CUDA libraries. 9 | -------------------------------------------------------------------------------- /docs/gpu_docker.md: -------------------------------------------------------------------------------- 1 | ## Prepare the TX so that the GPU is usable with Docker. 2 | First, let's make sure we don't need sudo to run Docker. 3 | Run: 4 | ``` 5 | sudo groupadd docker 6 | sudo usermod -aG docker $USER 7 | ``` 8 | Once you'll have rebooted, you should be able to run Docker without sudo. 9 | 10 | For the GPU to be used within Docker containers, we use [Tegra-Docker](https://github.com/Technica-Corporation/Tegra-Docker). 11 | 12 | On the TX, run the following: 13 | ``` 14 | git clone https://github.com/Technica-Corporation/Tegra-Docker.git 15 | chmod +x Tegra-Docker/bin/tx2-docker 16 | sudo cp Tegra-Docker/bin/tx2-docker /usr/bin 17 | rm -rf Tegra-Docker 18 | ``` 19 | 20 | Now you can use the `tx2-docker` command instead of `docker` when running a container. 21 | 22 | Doing this might overwrite some libraries installed in your images (since it replaces some directories). To fix this, you should install the required libraries locally on the TX2, and they will then be available in the shared libraries within the Docker container. 23 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # Welcome to the DOOR-SLAM documentation website! 2 | 3 | 4 | 6 | 7 | 10 | 11 | 12 | 13 | - [Simulation](simulation.md) 14 | - [Quick Setup](quick_setup.md) 15 | 16 | - [Network Setup](network.md) 17 | 18 | -------------------------------------------------------------------------------- /docs/kernel_module.md: -------------------------------------------------------------------------------- 1 | ## Rebuild the kernel to have the B.A.T.M.A.N. module, and librealsense. 2 | We have scripts in order to rebuild the kernel with the necessary modules. 3 | This will take a while to run though. 4 | ``` 5 | git clone https://github.com/bramtoula/buildLibrealsense2AndBatmanTX2.git 6 | cd buildLibrealsense2AndBatmanTX2 7 | cd buildLibrealsense2AndBatmanTX2 8 | ./buildPatchedKernel.sh 9 | sudo cp ./image/Image /boot 10 | ``` 11 | 12 | Reboot after this. 13 | 14 | Now activate the batman-adv module and install some necessary packages: 15 | ``` 16 | sudo modprobe batman-adv 17 | sudo apt-get install batctl bridge-utils 18 | ``` -------------------------------------------------------------------------------- /docs/network.md: -------------------------------------------------------------------------------- 1 | # Networking 2 | 3 | ## Set up network 4 | We use two wireless interfaces. We use wlan0 (original interface) to connect normally to a WiFi network, through a router, with a static IP address. 5 | We use ra0 (dongle) to connect to a mesh network with other TX2s. 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/quick_setup.md: -------------------------------------------------------------------------------- 1 | # Quick Setup 2 | Those instructions can be used to reproduce the same setup used in our field 3 | experiments. 4 | 5 | # Hardware Requirements 6 | - [NVIDIA Jetson TX2](https://developer.nvidia.com/embedded/jetson-tx2) 7 | - [Intel Realsense D435](https//www.intelrealsense.com/depth-camera-d435/) 8 | - [DJI Matrice 100](https://www.dji.com/ca/matrice100?gclid=CjwKCAiA8qLvBRAbEiwAE_ZzPUsslCzK26_TNCYhazw-pswp8oyLU29d8VnYrAOUlDPAR7XsSxS3gxoC0noQAvD_BwE) 9 | 10 | 11 | # Setup 12 | Follow the following instructions to setup each robot computer: 13 | [TX2 Basic Setup](tx2_setup.md). 14 | 15 | 16 | Pull the following Docker image on each robot: `lajoiepy/doorslam-realsensed435-tx2-dji` 17 | 18 | # Launch commands 19 | 20 | - First you need to setup the [aliases and high-level parameters](https://github.com/MISTLab/DOOR-SLAM/tree/master/tx2-setup/docker/aliases.txt). 21 | - MASK & OWN_IP: IP address info `192.168.MASK.OWN_IP`. 22 | - MASTER: OWN_IP of the robot with the ROS master. 23 | - LOCAL_ROBOT_ID: Robot ID (from 0 to 2) 24 | - OTHER_ROBOT_ID: Neighbor ID (Assign 1 neighbor to each robot). 25 | - The other parameters do not need to be modified. Look to the paper for more details on those parameters. 26 | 27 | 28 | - Make sure [this script](https://github.com/MISTLab/DOOR-SLAM/tree/master/tx2-setup/docker/entrypoint.sh) is at the root level to run the commands. 29 | 30 | - A typical sequence: 31 | - Robot 0: `camera`, `blabbermouth2`, `optimization`, `separators` 32 | - Robot 1: `camera`, `optimization`, `separators` 33 | - Pilot the robots around the test area. 34 | - When you are ready for the distributed pose graph optimization execute `trigger` on either Robot 0 or 1. 35 | 36 | - Reboot between each run. 37 | 38 | - Commands description: 39 | - `camera` : Launches the Docker container and the onboard camera. 40 | - `enter_bash` : Opens a bash command line in the Docker container already running. 41 | - `optimization` : Launches the optimization process. 42 | - `blabbermouth` : Launches communication hub for 3 robots. 43 | - `blabbermouth2` : Launches communication hub for 2 robots. 44 | - `trigger` : Triggers the distributed pose graph optimization process. 45 | - `separators` : Launches the inter-robot loop closures detection process. 46 | - `record` : Launches the data recording using rosbags. 47 | - `docker_bash` : Launches the Docker container and open a bash command line in it. 48 | - `bag_sep` : Launches the inter-robot loop closures detection process with a rosbag dataset (not using the camera). 49 | - `bag_sep_params` : Launches the inter-robot loop closures detection process with a rosbag dataset (not using the camera). Uses the parameters set [here](https://github.com/MISTLab/DOOR-SLAM/tree/master/tx2-setup/docker/aliases.txt) instead of the default ones. 50 | - `cleancache` : Cleans the TX2 cache. This usually has a positive effect on the computer performance. We recommend to run it often. 51 | 52 | ## Good luck and have fun! 53 | 54 | ## Building the Docker image for TX2 55 | To build the Docker image yourself to replicate our exact setup, use this 56 | [Dockerfile and instructions](https://github.com/MISTLab/DOOR-SLAM/tree/master/tx2-setup/docker) 57 | 58 | -------------------------------------------------------------------------------- /docs/realsense_setup.md: -------------------------------------------------------------------------------- 1 | # Intel Realsense Camera 2 | The only prerequisites you need are some [additional kernel modules](kernel_module.md). 3 | -------------------------------------------------------------------------------- /docs/simulation.md: -------------------------------------------------------------------------------- 1 | # ARGoS Simulation 2 | 3 | Welcome to the ARGoS multi-robot slam simulation. 4 | The goal of this simulation is to showcase our distributed implementation of the 5 | Gauss-Seidel pose graph optimization technique combined with our distributed 6 | inter-robot loop closures outliers rejection technique. 7 | 8 | Since the setup is quite complex we provide a Docker Image 9 | `lajoiepy/doorslam-argos-simulation` to easily run the simulation. Although we 10 | don't recommend it, you can look at the [Dockerfile](https://github.com/lajoiepy/robust_distributed_slam_simulation/blob/master/docker/devel/Dockerfile) for the setup 11 | instructions. 12 | 13 | The following instructions indicate how to start the simulation. 14 | ## 1. Log/result folder setup 15 | Designate a folder ( `HOST_FOLDER` ) to share files between the host machine and 16 | the Docker container. The simulation results and logs will be store in this location. 17 | 18 | 19 | Create a folder named `datasets` inside the `HOST_FOLDER`. 20 | 21 | ## 2. Launch container 22 | Run the following commands: 23 | ``` 24 | sudo x11docker --hostdisplay --hostnet --user=RETAIN -- --privileged -v HOST_FOLDER:/home/docker/robust_distributed_slam_simulation/argos_simulation/log -- lajoiepy/doorslam-argos-simulation:latest 25 | ``` 26 | 27 | ## 3. Start simulation 28 | Open a shell in the container and run the simulation 29 | ``` 30 | docker exec -it $(docker container ls -q) /bin/bash 31 | ``` 32 | 33 | ``` 34 | cd ../home/docker/robust_distributed_slam_simulation/argos_simulation/ 35 | argos3 -c robust_distributed_slam_random_walk.argos 36 | ``` 37 | 38 | Press the simulator play button. 39 | 40 | [//]: # (## Simulation Explanations 41 | Visual output 42 | The simulation presents 43 | ARGoS logs 44 | log file results) 45 | 46 | ## Bonus: If you want to edit the code and configs 47 | Start a shell in the container and run the following command that will start VSCode. 48 | ``` 49 | code --user-data-dir 50 | ``` 51 | 52 | ## Details 53 | More details on how to build the image are available [here](simulation_details.md). 54 | -------------------------------------------------------------------------------- /docs/simulation_details.md: -------------------------------------------------------------------------------- 1 | # Simulation Build Details 2 | Those instructions refer to this [Dockerfile](https://github.com/lajoiepy/robust_distributed_slam_simulation/blob/master/docker/devel/Dockerfile). 3 | 4 | ## Acces to GUI 5 | The ARGoS simulation needs access to a graphical user interface to work. Many options are available to have access to the GUI of the apps running in your docker container. I propose using https://github.com/mviereck/x11docker, but feel free to use another one. Note that I will assume the usage of x11docker in some of the following commands. 6 | 7 | ## Build the image 8 | For the first build execute: 9 | ``` 10 | docker build . --tag rdpgo --network host 11 | ``` 12 | If you modified the code from this repository and you want to use the latest version, use the following command: 13 | ``` 14 | docker build . --tag rdpgo --network host --build-arg CODE_UPDATE= 15 | ``` 16 | Be sure to change the `CODE_UPDATE` value every time to invalidate your build cache. 17 | 18 | ## ARGoS download link 19 | The ARGoS download link on this [line](https://github.com/lajoiepy/robust_distributed_slam_simulation/blob/e55d28cd00d80e20d63629a4fda3938b1965c539/docker/devel/Dockerfile#L53) 20 | might change overtime and might need to be updated. Look here for the latest link: https://www.argos-sim.info/core.php. 21 | 22 | ## To run a container 23 | Use the following command while specifying a folder on your host machine to store the log files from the simulation. 24 | ``` 25 | sudo x11docker --hostdisplay --hostnet --user=RETAIN -- --privileged -v :/home/docker/robust_distributed_slam_simulation/argos_simulation/log -- rdpgo:latest 26 | ``` 27 | 28 | ## Launching the simulation 29 | If the correct `ENTRYPOINT` is specified in the Dockerfile, the simulation should start with the previous command. \ 30 | Otherwise, you can start a bash shell into the container with the following command: 31 | ``` 32 | docker exec -w /home/docker/robust_distributed_slam_simulation/argos_simulation -it /bin/bash 33 | ``` 34 | You can check the `` using `docker ps`. 35 | 36 | Then you can start the simulation yourself by going into the folder `/home/docker/robust_distributed_slam_simulation/argos_simulation` 37 | and executing : 38 | ``` 39 | argos3 -c robust_distributed_slam.argos 40 | ``` 41 | 42 | ## To debug with Visual Studio Code 43 | Some editing and debugging tools are installed in the image for development purposes (gedit, nano, strace, valgrind, and Visual Studio Code). 44 | To debug the code from this repository: 45 | 1. Open Visual Studio Code in the folder `/home/docker/robust_distributed_slam_simulation` with the `--user-data-dir /home/docker/code/` argument. 46 | 2. Launch the simulation as explained previously. 47 | 3. Start the `(gdb) Attach` configuration in the Visual Studio Code debugging tool and select the running `argos3` process. 48 | 4. You are ready to place your breakpoints and debug! 49 | 50 | ## Questions? 51 | For further questions or comments, feel free to contact me at : `lajoie.py@gmail.com`. 52 | -------------------------------------------------------------------------------- /docs/tx2_setup.md: -------------------------------------------------------------------------------- 1 | # NVIDIA Jetson TX2 DOOR-SLAM Setup 2 | 3 | Steps in order to use TX2 GPU in Docker, B.A.T.M.A.N. routing protocol, TP-Link Archer T2UH dongle, Intel RealSense D435. 4 | The instructions assume the use of Jetpack 4.2. 5 | Note that more recent Jetpack versions should make the use of Docker easier, but we haven't tested them. 6 | We suggest to follow the steps in order, but you can skip some according to your hardware setup. 7 | 8 | ## Steps 9 | - [Flash Jetpack 4.2](flash_jetpack4_2.md) 10 | - [Connectech Elroy Carrier Board](connecttech_elroy.md) 11 | - [Docker + GPU](gpu_docker.md) 12 | - [Intel Realsense Camera](realsense_setup.md) 13 | - [Additional Packages](additional_pkgs.md) 14 | - [TP-Link Archer T2UH networking dongle](archer_dongle.md) (Optional) 15 | - [B.A.T.M.A.N. ad-hoc network routing protocol](batman_setup.md) (Optional) 16 | - [WiFi](wifi_setup.md) (Optional) -------------------------------------------------------------------------------- /docs/wifi_setup.md: -------------------------------------------------------------------------------- 1 | ### wlan0 interface on our router 2 | To connect to a network through the wifi interface, we use wpa supplicant, and set the IP to be static. In our example, we assume that the IP addresses your network gives are `192.168.12.XX`. 3 | 4 | Open the interfaces file to setup the IP to be static : 5 | `sudo nano /etc/network/interfaces` 6 | You should have the following inside, with the IP you defined for your Spiri : 7 | ``` 8 | # interfaces(5) file used by ifup(8) and ifdown(8) 9 | # Include files from /etc/network/interfaces.d: 10 | source-directory /etc/network/interfaces.d 11 | 12 | # The loopback network interface 13 | auto lo 14 | iface lo inet loopback 15 | 16 | auto wlan0 17 | iface wlan0 inet static 18 | address 192.168.12. 19 | netmask 255.255.255.0 20 | gateway 192.168.12.1 21 | wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf 22 | ``` 23 | 24 | Second, open the wpa supplicant conf file to define which networks to connect to : 25 | `sudo nano /etc/wpa_supplicant/wpa_supplicant.conf` 26 | 27 | In this file, you can set up one or more networks you want to connect to. If the network is open and has no password, you should use the configuration like the first network below. If it does require a password, use the second network below. You can add as many networks as you want, defining different priorities. If a robot sees different available networks it will connect to the one with highest priority. 28 | If you are using some kind of filtering on your router (MAC filtering for example), don't forget to allow your Spiri! 29 | ``` 30 | network={ 31 | ssid="" 32 | scan_ssid=1 33 | key_mgmt=NONE 34 | priority=6 35 | } 36 | 37 | network={ 38 | ssid="" 39 | scan_ssid=1 40 | psk="network-password" 41 | key_mgmt=WPA-PSK 42 | priority=5 43 | } 44 | ``` 45 | 46 | Once you have these files changed, reboot the drone and make sure it connects to the network. 47 | You can check your drone gets the expected IP using `ifconfig`. 48 | You can verify that it is connected to the network by trying to ping the router from the TX : 49 | `ping 192.168.12.1` 50 | If you get no response then there is an issue somewhere. 51 | The next test you should make is to try to SSH to the TX. From another computer on the same network use : 52 | `ssh nvidia@192.168.12.XX` 53 | replacing XX by the IP of your TX. If you didn’t change the password yet, it should still be `nvidia`. 54 | 55 | One helpful thing you can do is add the drone to your ssh config file to easily connect to it later. On your computer, run : 56 | `sudo nano ~/.ssh/config` 57 | And add the following at the end, replacing and by the actual name and static IP of your Spiri : 58 | ``` 59 | Host 60 | User nvidia 61 | Hostname 192.168.12. 62 | ``` 63 | 64 | Now you'll be able to run the following command on your computer to access the drone : 65 | `ssh ` 66 | 67 | It is important that this works before going forward since it will be our only way to access the TX once it is inserted in the drone. 68 | 69 | ### Setting ra0 and bat0 interfaces manually (better for debugging) 70 | 71 | #### ra0 in a mesh network for B.A.T.M.A.N 72 | 73 | First, make sure ra0 is visible when you run `iwconfig`. 74 | Then run the following commands to join (or create if you are the first to join) a mesh network: 75 | ``` 76 | sudo iw dev ra0 set type ibss 77 | sudo iw dev ra0 ibss join NVIDIA 5220 78 | ``` 79 | 80 | To check whether it has been set correctly, you can run 81 | ``` 82 | sudo iw dev ra0 info 83 | ``` -------------------------------------------------------------------------------- /tx2-setup/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM lajoiepy/realsense-tx2-px4 2 | 3 | 4 | WORKDIR /root/ 5 | 6 | ##################################################### Python catkin tools ##################################################### 7 | RUN apt-get update && apt-get install -y --no-install-recommends libopenni2-dev wget && \ 8 | sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list' && \ 9 | wget http://packages.ros.org/ros.key -O - | apt-key add - && \ 10 | apt-get remove -y wget && \ 11 | apt-get update && \ 12 | apt-get install -y --no-install-recommends python-catkin-tools && \ 13 | rm -rf /var/lib/apt/lists/* 14 | 15 | ##################################################### Tensorflow ##################################################### 16 | COPY tensorflow-1.11.0-cp27-cp27mu-linux_aarch64.whl /tmp/ 17 | 18 | RUN apt-get update && \ 19 | apt-get install -y --no-install-recommends python-dev python-pip python-h5py python-wheel && \ 20 | pip install /tmp/tensorflow-1.11.0-cp27-cp27mu-linux_aarch64.whl && \ 21 | pip install --upgrade numpy && \ 22 | apt-get install -y --no-install-recommends python-scipy && \ 23 | apt-get remove -y python-pip python-wheel && \ 24 | rm /tmp/tensorflow-1.11.0-cp27-cp27mu-linux_aarch64.whl && \ 25 | rm -rf /var/lib/apt/lists/* 26 | 27 | ##################################################### GTSAM ##################################################### 28 | RUN git clone https://bitbucket.org/gtborg/gtsam && \ 29 | cd gtsam && \ 30 | mkdir build && \ 31 | cd build && \ 32 | cmake .. && \ 33 | make -j2 && \ 34 | make install && \ 35 | cd ../.. && \ 36 | rm -rf gtsam && \ 37 | ldconfig 38 | 39 | ##################################################### RTAB-Map ROS ##################################################### 40 | RUN apt-get update && apt-get install -y \ 41 | ros-melodic-rtabmap-ros \ 42 | && apt-get remove -y \ 43 | ros-melodic-rtabmap \ 44 | && rm -rf /var/lib/apt/lists/* 45 | 46 | RUN rm /bin/sh && ln -s /bin/bash /bin/sh 47 | 48 | RUN git clone https://github.com/introlab/rtabmap.git && \ 49 | source /ros_entrypoint.sh && \ 50 | cd rtabmap/build && \ 51 | cmake .. && \ 52 | make -j4 && \ 53 | make install && \ 54 | cd ../.. && \ 55 | rm -rf rtabmap && \ 56 | ldconfig 57 | 58 | RUN source /ros_entrypoint.sh && \ 59 | mkdir -p catkin_ws/src && \ 60 | cd catkin_ws/src && \ 61 | git clone https://github.com/bramtoula/rtabmap_ros.git && \ 62 | cd .. && \ 63 | catkin_make -j2 -DCMAKE_INSTALL_PREFIX=/opt/ros/melodic install && \ 64 | cd && \ 65 | rm -rf catkin_ws 66 | 67 | ##################################################### Buzz ##################################################### 68 | RUN git clone https://github.com/MISTLab/Buzz.git /home/docker/buzz && \ 69 | cd /home/docker/buzz && \ 70 | mkdir build && \ 71 | cd build && \ 72 | cmake -DCMAKE_BUILD_TYPE=Debug ../src && \ 73 | make && \ 74 | make install && \ 75 | ldconfig && \ 76 | rm -r /home/docker/buzz 77 | 78 | ##################################################### DJI SDK ############################################################# 79 | # Install DJI_SDK 80 | RUN apt-get update && apt-get install -y ros-melodic-nmea-msgs \ 81 | && rm -rf /var/lib/apt/lists/* 82 | 83 | ARG clone_dji_sdk=unknown 84 | 85 | RUN mkdir ~/dji_ws && mkdir ~/dji_ws/src && cd ~/dji_ws/src &&\ 86 | git clone https://github.com/lajoiepy/Onboard-SDK-ROS onboard-sdk-ros &&\ 87 | cd onboard-sdk-ros &&\ 88 | git checkout m100_record 89 | 90 | RUN cd ~/dji_ws &&\ 91 | source /opt/ros/melodic/setup.bash &&\ 92 | catkin build 93 | 94 | ##################################################### Multi-robot SLAM separators package ##################################################### 95 | # --------------------------------------------------- Reset argument ------------------------------------------# 96 | ARG rebuild_multi_robot_slam_separators=0 97 | # -------------------------------------------------------------------------------------------------------------# 98 | 99 | RUN git clone https://github.com/bramtoula/multi_robot_SLAM_separators.git && \ 100 | cd multi_robot_SLAM_separators/ros_ws/src/multi_robot_separators/scripts && \ 101 | git clone https://github.com/uzh-rpg/netvlad_tf_open.git && \ 102 | cd netvlad_tf_open/checkpoints && \ 103 | apt-get update && \ 104 | apt-get install -y --no-install-recommends unzip wget && \ 105 | wget http://rpg.ifi.uzh.ch/datasets/netvlad/vd16_pitts30k_conv5_3_vlad_preL2_intra_white.zip && \ 106 | unzip vd16_pitts30k_conv5_3_vlad_preL2_intra_white.zip && \ 107 | mv vd16_pitts30k_conv5_3_vlad_preL2_intra_white/* . && \ 108 | rm -r vd16_pitts30k_conv5_3_vlad_preL2_intra_white && \ 109 | rm vd16_pitts30k_conv5_3_vlad_preL2_intra_white.zip && \ 110 | apt-get remove -y unzip wget && \ 111 | rm -rf /var/lib/apt/lists/* && \ 112 | cd ~/multi_robot_SLAM_separators/ros_ws && \ 113 | source ~/dji_ws/devel/setup.bash && \ 114 | catkin build && \ 115 | source devel/setup.bash && \ 116 | mkdir ~/multi_robot_SLAM_separators/logs && \ 117 | mkdir ~/multi_robot_SLAM_separators/bags && \ 118 | chmod +x ~/multi_robot_SLAM_separators/ros_ws/src/multi_robot_separators/scripts/find_separators.py 119 | 120 | ENV PYTHONPATH=":PYTHONPATH:/root/multi_robot_SLAM_separators/ros_ws/src/multi_robot_separators/scripts/netvlad_tf_open/python" 121 | 122 | ##################################################### Robust Distributed Mapper - RDPGO - Buzz SLAM ##################################################### 123 | # --------------------------------------------------- Reset argument ------------------------------------------# 124 | ARG rebuild_rdpgo=0 125 | # -------------------------------------------------------------------------------------------------------------# 126 | # Clone RDPGO 127 | RUN mkdir ~/rdpgo_ws && mkdir ~/rdpgo_ws/src && cd ~/rdpgo_ws/src &&\ 128 | git clone https://github.com/lajoiepy/robust_distributed_slam_module.git robust_distributed_slam_module &&\ 129 | cd robust_distributed_slam_module &&\ 130 | git checkout DOOR-SLAM-1.0 &&\ 131 | git submodule update --init --recursive 132 | 133 | # Install Robust Distributed Mapper 134 | RUN cd ~/rdpgo_ws/src/robust_distributed_slam_module/buzz_slam/robust_distributed_mapper/cpp &&\ 135 | mkdir build &&\ 136 | cd build &&\ 137 | cmake -DCMAKE_BUILD_TYPE=Debug ../ &&\ 138 | make &&\ 139 | make install 140 | 141 | # Install Buzz SLAM 142 | RUN cd ~/rdpgo_ws/ &&\ 143 | source ~/multi_robot_SLAM_separators/ros_ws/devel/setup.bash &&\ 144 | catkin build 145 | 146 | # Compile buzz script 147 | RUN cd ~/rdpgo_ws/src/robust_distributed_slam_module/scripts &&\ 148 | bzzc ros_slam.bzz 149 | 150 | ##################################################### Debugging tools ##################################################### 151 | # Install and setup some editing and debugging tools 152 | RUN apt-get update && apt-get install -y --no-install-recommends vim htop net-tools gedit nano wget strace valgrind && \ 153 | rm -rf /var/lib/apt/lists/* 154 | 155 | ##################################################### Blabbermouth ##################################################### 156 | RUN git clone https://github.com/lajoiepy/blabbermouth.git &&\ 157 | cd blabbermouth &&\ 158 | mkdir build &&\ 159 | cd build &&\ 160 | cmake ../src &&\ 161 | make 162 | 163 | ##################################################### Repull and build ##################################################### 164 | # --------------------------------------------------- Reset argument ------------------------------------------# 165 | ARG repull_and_build=0 166 | # -------------------------------------------------------------------------------------------------------------# 167 | 168 | RUN cd multi_robot_SLAM_separators/ros_ws/ && \ 169 | git pull origin master && \ 170 | source ~/dji_ws/devel/setup.bash && \ 171 | catkin build && \ 172 | cd ~/rdpgo_ws/src/robust_distributed_slam_module && \ 173 | git pull --recurse-submodules && \ 174 | cd ~/rdpgo_ws/src/robust_distributed_slam_module/buzz_slam/robust_distributed_mapper/cpp/build && \ 175 | cmake -DCMAKE_BUILD_TYPE=Debug ../ && \ 176 | make && \ 177 | make install && \ 178 | cd ~/rdpgo_ws/ &&\ 179 | source ~/multi_robot_SLAM_separators/ros_ws/devel/setup.bash &&\ 180 | catkin build && \ 181 | cd ~/rdpgo_ws/src/robust_distributed_slam_module/scripts &&\ 182 | bzzc ros_slam.bzz 183 | 184 | ##################################################### Setup Entrypoint ##################################################### 185 | ENV TZ=America/New_York 186 | 187 | COPY entrypoint.sh entrypoint.sh 188 | RUN chmod +x entrypoint.sh 189 | ENTRYPOINT ["/root/entrypoint.sh"] 190 | -------------------------------------------------------------------------------- /tx2-setup/docker/aliases.txt: -------------------------------------------------------------------------------- 1 | export MASK=12 2 | export MASTER=150 3 | export OWN_IP=151 4 | export LOCAL_ROBOT_ID=1 5 | export OTHER_ROBOT_ID=2 6 | 7 | 8 | export NETVLAD_DISTANCE=0.15 9 | export MIN_SEP_INLIERS=5 10 | export NETVLAD_MAX_MATCHES=20 11 | export NETVLAD_BATCH_SIZE=3 12 | export NETVLAD_DIMENSIONS=128 13 | export NB_KF_SKIPPED=0 14 | 15 | 16 | alias camera='dir_name="$(date +%Y-%m-%d_%H-%M-%S)" && \mkdir -p /home/nvidia/Desktop/$dir_name/datasets && \tx2-docker run -e TZ=America/New_York --net host --privileged -v /dev/bus/usb:/dev/bus/usb -v /home/nvidia/Desktop/$dir_name:/root/rdpgo_ws/src/robust_distributed_slam_module/scripts/log -it lajoiepy/doorslam-realsensed435-tx2-dji camera $MASK $MASTER $OWN_IP $LOCAL_ROBOT_ID camera' 17 | alias enter_bash='docker exec -it $(docker container ls -q) ./entrypoint.sh bash $MASK $MASTER $OWN_IP $LOCAL_ROBOT_ID' 18 | alias optimization='docker exec -it $(docker container ls -q) ./entrypoint.sh optimization $MASK $MASTER $OWN_IP $LOCAL_ROBOT_ID $OTHER_ROBOT_ID' 19 | alias blabbermouth='docker exec -it $(docker container ls -q) ./entrypoint.sh blabbermouth3 $MASK $MASTER $OWN_IP 10000 150 151 152' 20 | alias blabbermouth2='docker exec -it $(docker container ls -q) ./entrypoint.sh blabbermouth2 $MASK $MASTER $OWN_IP 10000 151 152' 21 | alias trigger='docker exec -it $(docker container ls -q) ./entrypoint.sh trigger $MASK $MASTER $OWN_IP $LOCAL_ROBOT_ID' 22 | alias separators='docker exec -it $(docker container ls -q) ./entrypoint.sh separators $MASK $MASTER $OWN_IP $LOCAL_ROBOT_ID $OTHER_ROBOT_ID' 23 | alias bag_sep='docker exec -it $(docker container ls -q) ./entrypoint.sh bag $MASK $MASTER $OWN_IP $LOCAL_ROBOT_ID $OTHER_ROBOT_ID /bag-$LOCAL_ROBOT_ID.bag 0' 24 | alias record='docker exec -it $(docker container ls -q) ./entrypoint.sh record $MASK $MASTER $OWN_IP $LOCAL_ROBOT_ID' 25 | alias docker_bash='dir_name="$(date +%Y-%m-%d_%H-%M-%S)_${NETVLAD_DISTANCE}_${MIN_SEP_INLIERS}" && \mkdir -p /home/nvidia/Desktop/$dir_name/datasets && \tx2-docker run -e TZ=America/New_York --net host --privileged -v /dev/bus/usb:/dev/bus/usb -v /home/nvidia/Desktop/$dir_name:/root/rdpgo_ws/src/robust_distributed_slam_module/scripts/log -v /home/nvidia/Desktop/bag-$LOCAL_ROBOT_ID.bag:/bag-$LOCAL_ROBOT_ID.bag -it lajoiepy/doorslam-realsensed435-tx2-dji bash $MASK $MASTER $OWN_IP $LOCAL_ROBOT_ID' 26 | alias bag_sep_params='docker exec -it $(docker container ls -q) ./entrypoint.sh bag_params $MASK $MASTER $OWN_IP $LOCAL_ROBOT_ID $OTHER_ROBOT_ID /bag-$LOCAL_ROBOT_ID.bag 0 $NETVLAD_DISTANCE $NETVLAD_DIMENSIONS $NETVLAD_BATCH_SIZE $NETVLAD_MAX_MATCHES $MIN_SEP_INLIERS $NB_KF_SKIPPED' 27 | alias cleancache='sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"' 28 | alias kitti_params='docker exec -it $(docker container ls -q) ./entrypoint.sh kitti_bag_params $MASK $MASTER $OWN_IP $LOCAL_ROBOT_ID $OTHER_ROBOT_ID /bag-$LOCAL_ROBOT_ID.bag 0 $NETVLAD_DISTANCE $NETVLAD_DIMENSIONS $NETVLAD_BATCH_SIZE $NETVLAD_MAX_MATCHES $MIN_SEP_INLIERS $NB_KF_SKIPPED' 29 | -------------------------------------------------------------------------------- /tx2-setup/docker/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export ROS_IP=192.168.$2.$4 4 | export ROS_MASTER_URI=http://192.168.$2.$3:11311 5 | 6 | source "/root/rdpgo_ws/devel/setup.bash" 7 | 8 | case "$1" in 9 | camera) 10 | roslaunch realsense2_camera multi_robot_slam_realsense_camera.launch robot_id:=$5 11 | ;; 12 | 13 | optimization) 14 | roslaunch robust_distributed_slam_module generic_robot_slam.launch local_robot_id:=$5 other_robot_id:=$6 port:=2458$5 --screen 15 | ;; 16 | 17 | blabbermouth3) 18 | cd blabbermouth/build &&\ 19 | ./blabbermouth -s $5 1:tcp:1:192.168.$2.$6:24580 2:tcp:1:192.168.$2.$7:24581 3:tcp:1:192.168.$2.$8:24582 20 | ;; 21 | 22 | blabbermouth2) 23 | cd blabbermouth/build &&\ 24 | ./blabbermouth -s $5 1:tcp:1:192.168.$2.$6:24580 2:tcp:1:192.168.$2.$7:24581 25 | ;; 26 | 27 | trigger) 28 | rosservice call /robot_0/start_optimization 29 | rosservice call /robot_1/start_optimization 30 | rosservice call /robot_2/start_optimization 31 | ;; 32 | 33 | record) 34 | if [ "$#" -eq 5 ] 35 | then 36 | roslaunch multi_robot_separators record_camera.launch local_robot_id:=$5 --screen 37 | else 38 | roslaunch multi_robot_separators record_camera.launch local_robot_id:=$5 fcu_port:=$6 baud_rate:=$7 --screen 39 | fi 40 | ;; 41 | 42 | separators) 43 | if [ "$#" -eq 6 ] 44 | then 45 | roslaunch multi_robot_separators multi_robot_slam_example.launch local_robot_id:=$5 other_robot_id:=$6 --screen 46 | else 47 | roslaunch multi_robot_separators multi_robot_slam_example.launch local_robot_id:=$5 other_robot_id:=$6 fcu_port:=$7 baud_rate:=$8 --screen 48 | fi 49 | ;; 50 | 51 | bag) 52 | roslaunch multi_robot_separators realsense_bag_example.launch local_robot_id:=$5 other_robot_id:=$6 bag:=$7 recorded_id:=$8 --screen 53 | ;; 54 | 55 | 56 | bag_params) 57 | roslaunch multi_robot_separators realsense_bag_example.launch local_robot_id:=$5 other_robot_id:=$6 bag:=$7 recorded_id:=$8 netvlad_distance:=$9 netvlad_dimensions:=${10} netvlad_batch_size:=${11} netvlad_max_matches_nb:=${12} separators_min_inliers:=${13} number_of_kf_skipped:=${14} --screen 58 | ;; 59 | 60 | kitti_bag_params) 61 | roslaunch multi_robot_separators kitti_example.launch local_robot_id:=$5 other_robot_id:=$6 bag:=$7 recorded_id:=$8 netvlad_distance:=$9 netvlad_dimensions:=${10} netvlad_batch_size:=${11} netvlad_max_matches_nb:=${12} separators_min_inliers:=${13} number_of_kf_skipped:=${14} --screen 62 | ;; 63 | 64 | bash) 65 | /bin/bash 66 | ;; 67 | *) 68 | echo $"Usage: $1 {optimization|separators|bash}" 69 | exit 1 70 | 71 | esac 72 | -------------------------------------------------------------------------------- /tx2-setup/docker/instructions.md: -------------------------------------------------------------------------------- 1 | # Build the image 2 | 3 | `docker build . --tag lajoiepy/doorslam-realsensed435-tx2-dji --network host` 4 | 5 | Then follow the [quick setup guide](../../docs/quick_setup.md) using the files in this folder. 6 | --------------------------------------------------------------------------------