-
Notifications
You must be signed in to change notification settings - Fork 2
Quick Start Guide
JOCIIIII edited this page Dec 31, 2024
·
17 revisions
This quick start guide is written for Ubuntu 22.04 LTS. Certain commands may vary if you use ohter Linux distributions.
- Clone this repository, kestr31/PX4-SITL-RUNNER to your computer.
- If you don't have git installed, please install it in advance.
cd ~/
sudo apt update && sudo apt install -y git
git clone https://github.com/kestr31/PX4-SITL-Runner.git
- Move to the cloned repository.
- Then, use following command to clone and build PX4-Autopilot.
- By default,
v1.14.3
of the PX4-Autopilot will be cloned.
cd ~/PX4-SITL-Runner
./scripts/run.sh px4 clone
./scripts/run.sh px4 build
./scripts/run.sh px4 stop
The PX4-Autopilot will be cloned and built on
~/Documents/A4VAI-SITL/PX4-Autopilot
by default.
- Create the ROS2 Workspace at ROS2 container workspace.
- Then, clone ROS2 packages that have A4VAI algorithms implemented inside.
mkdir -p ~/Documents/A4VAI-SITL/ROS2/ros2_ws/src
git clone https://github.com/JOCIIIII/A4VAI-Algorithms-ROS2.git ~/Documents/A4VAI-SITL/ROS2/ros2_ws/src
git -C ~/Documents/A4VAI-SITL/ROS2/ros2_ws/src submodule update --init --recursive
mkdir -p ~/Documents/A4VAI-SITL/ROS2/ros2_ws/src/pathplanning/pathplanning/model
wget https://github.com/Brightestsama/A4VAI-PathPlanning/releases/download/sac-v2.0.0/weight.onnx \
-O ~/Documents/A4VAI-SITL/ROS2/ros2_ws/src/pathplanning/pathplanning/model/weight.onnx
The ROS2 container workspace is set as ``~/Documents/A4VAI-SITL/ROS2` by default.
- Then build ROS2 packages and messages as following:
cd ~/PX4-SITL-Runner
./scripts/run.sh ros2 build ros2_ws
./scripts/run.sh ros2 stop
Warning
You must not use ./scripts/run.sh ros2 build
for this step. Since this break other prebuilt packages such as airsim
, please retry this Quick Start Guide from the beginning.
- Download necessary ROS2 Packages to retreive/send msgs to PX4-Autopilot(uXRCE-DDS Agent) and AirSim(AirSim ROS2 Bridge).
- These are prebuilt packages. Therefore, you do not need to build it again.
wget https://github.com/kestr31/PX4-SITL-Runner/releases/download/Resources/airsim.tar.gz -O ~/Documents/A4VAI-SITL/ROS2/airsim.tar.gz
wget https://github.com/kestr31/PX4-SITL-Runner/releases/download/Resources/px4_ros.tar.gz -O ~/Documents/A4VAI-SITL/ROS2/px4_ros.tar.gz
tar -zxvf ~/Documents/A4VAI-SITL/ROS2/airsim.tar.gz -C ~/Documents/A4VAI-SITL/ROS2
tar -zxvf ~/Documents/A4VAI-SITL/ROS2/px4_ros.tar.gz -C ~/Documents/A4VAI-SITL/ROS2
git clone https://github.com/dheera/rosboard.git -b v1.3.1 ~/Documents/A4VAI-SITL/ROS2/rosboard
- Gazebo Classic - AirSim SITL simultion required a bridge to update states calculated on the Gazebo Classic.
- The bridge is provided as a prebuilt binary
GazeboDrone
on this repository. - Place the binary at the Gazebo Classic container workspace. Then, make is executable.
wget https://github.com/kestr31/PX4-SITL-Runner/releases/download/Resources/GazeboDrone -O ~/Documents/A4VAI-SITL/Gazebo-Classic/GazeboDrone
chmod +x ~/Documents/A4VAI-SITL/Gazebo-Classic/GazeboDrone
- Unlike Gazebo-Classic, you have to place World definition("Unreal Binary") and Simulation Definition("Settings") manually.
- Example Unreal Binaries can be found on microsoft/AirSim release v1.8.1 - Linux
- First, download an Unreal Binary required for the simulation. Then place it as
binary
directory at the AirSim continaer workspace.
# IN CASE OF YOUR COMPUTER NOT HAVING wget AND unzip, TRY INSTALLING IT FIRST.
sudo apt update && sudo apt install wget unzip
# DOWNLOAD AIRSIM BINARY USING WGET. YOU CAN USE ANY METHOD TO DOWNLOAD IT.
wget https://github.com/microsoft/AirSim/releases/download/v1.8.1/AirSimNH.zip -P ~/Documents/A4VAI-SITL/AirSim
# UNZIP AND PLACE IT AS DESIRED.
unzip ~/Documents/A4VAI-SITL/AirSim/AirSimNH.zip -d ~/Documents/A4VAI-SITL/AirSim
mv ~/Documents/A4VAI-SITL/AirSim/AirSimNH/LinuxNoEditor/* ~/Documents/A4VAI-SITL/AirSim/AirSimNH
rm -rf ~/Documents/A4VAI-SITL/AirSim/AirSimNH/LinuxNoEditor
mv ~/Documents/A4VAI-SITL/AirSim/AirSimNH ~/Documents/A4VAI-SITL/AirSim/binary
- Then, download and place the sample
settings.json
file.
wget https://github.com/kestr31/PX4-SITL-Runner/releases/download/Resources/settings.json -O ~/Documents/A4VAI-SITL/AirSim/settings.json
- You are ready to go. Allow container to attach to your display.
- Then, run the simulation using the script. The script will automatically download required docker images.
# YOU ONLY NEED TO RUN xhost + ONCE EVERY TIME ON YOU REBOOT YOUR COMPUTER
xhost +
cd ~/PX4-SITL-Runner
./scripts/run.sh gazebo-classic-airsim-sitl run
- You can close the simulation by following command
cd ~/PX4-SITL-Runner
./scripts/run.sh gazebo-classic-airsim-sitl stop