Quick Start Guide - JOCIIIII/PX4-PILS-Runner GitHub Wiki

This quick start guide is written for Ubuntu 22.04 LTS environment. Some commands such as package installation may differ on other Linux distributions like Fedora.

Warning

PC and Jetson configurations are separated.

1. PC Configuration

1.1. Install Docker and Docker Compose

1.2. Install Required Packages

sudo apt update && sudo apt install -y git wget unzip

1.3. Clone the Repository

cd ~/
git clone https://github.com/jociiiii/PX4-PILS-Runner.git

1.4.Download SITL ROS2 Docker Image

  • Download the ROS2 container image from GitLab.

  • If you have already downloaded it through SITL-runner, you can skip the image download process.

  • You need to login to GitLab first to download.

  • Login to Docker GitLab and download the image using the provided GitLab login documentation.

docker login reg.iacsl.org

docker pull reg.iacsl.org/a4-vai/sils-container:humble-cuda12.6-tensorrt10.7-cudnn9.7

1.5. Run Setup Script

cd ~/PX4-PILS-Runner
./scripts/setup.sim.sh

1.6. Place AirSim Binary

  • Download the Unreal Engine binary and place it as a folder named binary within the AirSim container workspace.
  • The Unreal Engine binaries are for path planning and path following tests, and path planning, path following, and collision avoidance tests.
  • The default binary is for path planning and path following tests.
  • To run path following and collision avoidance tests, you need to rename the corresponding binary file folder to binary.
wget -P ~/Documents/A4VAI-PILS/AirSim \
--header="PRIVATE-TOKEN: <token>" https://git.iacsl.org/api/v4/projects/302/packages/generic/demo/1.0.0/demo_pf-ca.tar.gz       

wget -P ~/Documents/A4VAI-PILS/AirSim \
--header="PRIVATE-TOKEN: <token>" https://git.iacsl.org/api/v4/projects/302/packages/generic/demo/1.0.0/demo_pp-pf.tar.gz

tar -xvzf ~/Documents/A4VAI-PILS/AirSim/demo_pf-ca.tar.gz -C ~/Documents/A4VAI-PILS/AirSim
tar -xvzf ~/Documents/A4VAI-PILS/AirSim/demo_pp-pf.tar.gz -C ~/Documents/A4VAI-PILS/AirSim

mv ~/Documents/A4VAI-PILS/AirSim/demo_world ~/Documents/A4VAI-PILS/AirSim/binary

2. Jetson Configuration

2.1. Requirements

2.1.1. Hardware Configuration

  • Jetson Orin Nano 8GB or higher
  • Jetpack 6.2

2.2. Install Required Packages

sudo apt update && sudo apt install -y git wget netplan.io 

2.3. Download PILS ROS2 Docker Image

docker login reg.iacsl.org

docker pull reg.iacsl.org/a4-vai/pils-container:humble-cuda12.6-tensorrt10.7-cudnn9.7

2.4. Clone the Repository

cd ~/
git clone https://github.com/jociiiii/PX4-PILS-Runner.git

2.5. Run Setup Script

cd ~/PX4-PILS-Runner
./scripts/setup.onboard.sh

The default path for the ROS2 container workspace is ~/Documents/A4VAI-PILS/ROS2

3. PC - Jetson Communication Setup

3.1. Overview

-Hardware Diagram

A4VAI-PILS-Diagram

3.2. Requirements

  • Simulator PC x1
  • Jetson Orin Nano 8GB x1
  • USB to Ethernet Adapter (Min 100MB/s) x1
  • Ethernet Cable x1

3.3. Procedure

3.3.1. PC

3.3.1.1. Check USB to Ethernet Adapter Interface Name

  • Check the USB to Ethernet Adapter interface name on PC using ip a command:
    • Interface name : enx-----
    • Example : enxc84d44261181

3.3.1.1. Assign Static IP to USB to Ethernet Adapter

  • Run the following command in terminal
sudo nano /etc/netplan/01-usb-ethernet.yaml
  • Add the following content in nano editor, modify the interface name as needed, save with Ctrl+x, y, enter:
network:
  version: 2
  ethernets:
    enxc84d44261181:
      dhcp4: no
      addresses:
        - 192.168.50.1/24
  • Apply changes with the following command
sudo netplan apply

3.3.2. Jetson

3.3.2.1. Check USB to Ethernet Adapter Interface Name

  • Check the USB to Ethernet Adapter interface name on Jetson using ip a command:
    • Interface name : en---
    • Example : enP8p1s0

3.3.2.2. Assign Static IP to USB to Ethernet Adapter

  • Run the following command in termina
sudo nano /etc/netplan/01-usb-ethernet.yaml
  • Add the following content in nano editor, modify the interface name as needed, save with Ctrl+x, y, enter
network:
  version: 2
  ethernets:
    enP8p1s0:
      dhcp4: no
      addresses:
        - 192.168.50.2/24
  • Apply changes with the following command
sudo netplan apply

3.3.3. Check Communication with Ping

ping 192.168.50.2 on PC ping 192.168.50.1 on Jetson

4. PC - Jetson Public Key Setup

4.1.Procedure

  • Run the following commands in PC terminal
ssh-keygen -t rsa -b 4096
ssh-copy-id <jetson username>@192.168.50.2
#ex  ssh-copy-id [email protected]

5. Running the Simulation

  • All preparations are complete. Finally, allow containers to display GUI programs.

  • Then, start the simulation using the commands below. Required docker images will be automatically downloaded.

  • By default, run the simulation from the simulator computer.

  • PILS remotely controls the target board from the simulator computer.

# You only need to run xhost + once per reboot.
xhost +
cd ~/PX4-PILS-Runner
# path following unit test
./scripts/run.sh sim gazebo-classic-airsim-pils test unit-test path-following

# path planning unit test
./scripts/run.sh sim gazebo-classic-airsim-pils test unit-test path-planning

# collision avoidance unit test
./scripts/run.sh sim gazebo-classic-airsim-pils test unit-test collision-avoidance


# path planning, path following integration test
./scripts/run.sh sim gazebo-classic-airsim-pils test integration-test pp-pf-integration

# path following collision avoidance integration test
./scripts/run.sh sim gazebo-classic-airsim-pils test integration-test pf-ca-integration
  • You can stop the simulation with the following command
cd ~/PX4-PILS-Runner
./scripts/run.sh sim gazebo-classic-airsim-pils stop

Note

All topics used in the simulation are logged as rosbag format in the ~/Documents/A4VAI-PILS/ROS2/logs/rosbag path. Using MATLAB's ROS Toolbox, you can play back rosbag files in the MATLAB environment to load topics.

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