跳到内容

语言

Currency

Reproducing Vision-Based End-to-End Autonomous Flight on UAVs: Ubuntu Tutorial

by AMOVLAB 02 Sep 2025 0 条评论

Read the previous article about Tianjin University Interpretation of YOPO papers Already? YOPO reduces latency to milliseconds through end-to-end trajectory planning, driving UAVs to fly quickly and stably autonomously.

We have implemented the reproduction of the YOPO algorithm on SU17, and now we will share the reproduction tutorials with you. We will serialize three reproduction tutorials including:Ubuntu training/simulation, ProSim training/simulation, real machine reproduction, please continue to pay attention!

This article mainly introduces the training and simulation reproduction tutorial based on the Ubuntu platform. By following the tutorial, you can run smoothly and easily realize visual end-to-end flight on your own UAV.

01 Environment deployment

Install Conda, ROS, CUDA, system library dependencies

Conda download link:

https://www.anaconda.com/download/success

ROS quick installation link:

wget http://fishros.com/install -O fishros && . fishros

CUDA link:

https://developer.nvidia.com/cuda-toolkit-archive

System library dependencies:


sudo apt-get update && sudo apt-get install -y --no-install-recommends \
   build-essential \
   cmake \
   libzmqpp-dev \
   libopencv-dev \
   libpcl-dev

02 environment variables

Add the source of catkin workspace as FLIGHTMARE_PATH environment variable


echo "export FLIGHTMARE_PATH=~/YOPO" >> ~/.bashrc
source ~/.bashrc

03 Path modification

Place the YOPO compressed package in the user directory and extract it:

Place the RPG_Flightmare folder in the flightrender directory. The structure is as shown below:

04 Create a Python environment

Use conda to create a python environment (since YOPO already exists, use yopo_test to demonstrate)

conda create --name yopo python=3.8

After downloading, as shown in the figure below, and use conda activate yopo activation:

After activation, it will look like the picture below:

05 Configure Python environment


conda install pytorch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1  
pytorch-cuda=11.8 -c pytorch -c nvidia

The normal situation is as shown below:

Install opencv-python

pip install opencv-python

Install gym and stable-baseline3

pip install gym stable-baselines3

Install other tools


pip install scipy==1.10.1 scikit-build==0.18.1 ruamel-yaml==0.17.21 numpy==1.22.3 
tensorboard==2.8.0 empy catkin_pkg

06 Build flightlib


conda activate yopo
cd YOPO/flightlib/build
cmake ..

07 Compile flightlib

make -j4

Things to note

You need to modify arch and code to parameters suitable for your computer graphics card and CUDA version.

After compilation, the following figure appears:

08 Install flightgym


cd YOPO/flightlib/build
pip install -e .
Pip install .

09 Configure flightpolicy module


echo "export PYTHONPATH=$PYTHONPATH:~/YOPO" >> ~/.bashrc
source ~/.bashrc

10 Data Collection Module


cd ~/YOPO/run
conda activate yopo
python data_collection_simulation.py

Install tqdm:

pip install tqdm

problem solving

After installation, the error is reported again as follows:

Indicates that the protobuf version is incompatible

Solution:

pip install protobuf==3.20.3

The data collection process is as follows:

The collection is completed as follows:

11 Model training


cd ~/YOPO/run
conda activate yopo
python run_yopo.py --train=1

After training is completed, the model is saved as follows:

12 test 1

Test without dynamics model and controller


cd ~/YOPO/run
conda activate yopo
python run_yopo.py --train=0 --render=1 --trial=1 --epoch=0 --iter=0 --supervised=0

compile controller

The error is reported as follows:

Reason: empy is not compatible

Solution:

pip install empy==3.3.4

After installation, recompile

13 test 2

Testing using dynamics models and controllers

Each underscore is executed in a terminal, multiple terminals are required.


Start the simulation environment with the Unity and ROS interfaces:
cd ~/YOPO/flightrender/RPG_Flightmare./flightmare.x86_64
------------------------------
cd ~/YOPO/flightlib/build
./flightros_node
------------------------------------------------------
Start the controllercd ~/YOPO source devel/setup.bashroslaunch so3_quadrotor_simulator simulator.launch
-----------------------------------------------------------------------------
Load the model and start planning:
cd ~/YOPO/runconda activate yopo
python test_yopo_ros_new.py
---------------------------------------------------
Start RViz visualization
cd ~/YOPO/
rviz -d yopo.rviz
-------------------------------------------------------
Start map visualization
cd ~/YOPO/flightlib/build
./map_visual_node

problem solving

The error is reported as follows:

Solution:

pip install rospkg

Once completed, end-to-end path planning testing can begin.

End-to-end path planning testing

Video placeholder: The original Chinese article includes a video here. AMOVLAB will manually connect the corresponding YouTube video.

After starting YOPO in the rviz environment, clicking the target point with the mouse can trigger a complete closed loop: the target coordinates are sent to the YOPO inference module, the corresponding trajectory is generated and solved into control instructions and sent to the UAV; in the actual measurement, the UAV can complete autonomous obstacle avoidance and movement according to the planned path.

When entering the set threshold range of the target point, the terminal outputs "arrive", then stops issuing control instructions, and the UAV hovers at the current location; if you need to go to a new location, just continue to click on the target in rviz. The process is stable and reusable.

Resource Express

Paper analysis:

Tianjin University end-to-end planning algorithm open-source! Autonomous flight no longer lags/recurrence video attached

Paper link:

https://ieeexplore.ieee.org/document/10528860

open-source code:

https://github.com/TJU-Aerial-Robotics/YOPO

发表评论

All blog comments are checked prior to publishing

感谢您订阅

This email has been registered!

Shop the look

Choose Options

Recently Viewed

Edit Option
Back In Stock Notification
Terms & Conditions
What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
this is just a warning
登录
Shopping Cart
0 items