# Neural-Predictor **Repository Path**: wangshengkai111/Neural-Predictor ## Basic Information - **Project Name**: Neural-Predictor - **Description**: Neural Predictor for Flight Control with Payload - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-01-14 - **Last Updated**: 2025-03-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: 纯纯的上层算法 ## README # Neural Predictor for Flight Control with Payload This repo contains the implementation of the paper "Neural Predictor for Flight Control with Payload" by Ao Jin, Chenhao Li, Qinyi Wang, Ya Liu, Panfeng, Huang and Fan Zhang*. The ***Neural Predictor*** is a learning-based scheme to capture force/torque caused by payload and residual dynamics of tethered-UAV system. Specifically, inspired by DDKO theory, the formulation of lifted linear system (LLS) is derived and the LLS is learned from data to capture the force/torque caused by payload and residual dynamics of tethered-UAV system. The learned dynamics combined with nominal dynamics, which produces a hybrid model of tethered-UAV system. This hybrid model is incorporated into a model predictive control framework, known as ***NP-MPC***. We demonstrate that our proposed framework not only provides much better prediction of external force and torque against state-of-the-art learning-based estimator, but also improve closed-loop performance in both simulations and real-world flight significantly. ![171c09bd62e2332fdc71e256e9f7ba4a458fcfd4.png](assets/f36a3fbf42e57eca413beaf1b7a22f793384593c.png) Our paper: [Neural Predictor for Flight Control with Payload](https://arxiv.org/abs/2410.15946) ## 1. Getting Started Before running the code, install the dependency packages in a virtual python env by executing the following command: ```bash pip install requirements.txt ``` ## 2. Running the Code This repo includes the code of two parts: **Numerical Evaluation** and **Physical Experiments**. ### 2.1 Numerical Evaluation We provided pretrained models for evaluation. Run `bash scripts/evaluation.sh` to reproduce the results that presented in the paper. **In addition, the RMSE results on 13 unseen trajectories are shown in `dump/evaluation/rmse_result.csv`**, which corresponds the results of Table I in the paper. If you want to train your own LLS, please follow the instructions below. * Processing BEM data The dataset for training and testing in this work is adopted from BEM dataset. For sake of convenience, we provided BEM dataset in the `data` folder. Navigate to the `data/BEM` folder, run `python process_data.py` , then some figures and files will appear in the `data/BEM` folder * Training LLS Run `bash scripts/train.sh` and this will take a couple minutes (The training time on i9-12900H CPU was around 8 min, and training time on a RTX 3060 laptop GPU was around 5 min). After training, the trained LLS will be located in the `dump/evaluation` folder. * Evaluating Neural Predictor Run `bash scripts/evaluation.sh`. The validation results on 13 unseen trajectories will be located in `dump/evaluation/test`. In each trajectory folder, there are two figures that show the prediction results of Neural Predictor. * Plotting Navigate to the `plot` folder. The `BEM_Comparasion` subfolder corresponds the result of Fig. 2 presented in paper. The `Sample_Efficiency` subfolder corresponds the result of Fig. 3 presented in paper. ### 2.2 Physical Experiments We evaluate the Neural Predictor in the real-world experiments. The setup for real-world flight experiments is illustrated in Section VI.B of the paper.
Code: Coming soon ## 3. Citation If you find this repo useful in your research, please cite our work: ```context @misc{jin2024neuralpredictorflightcontrol, title={Neural Predictor for Flight Control with Payload}, author={Ao Jin and Chenhao Li and Qinyi Wang and Ya Liu and Panfeng Huang and Fan Zhang}, year={2024}, eprint={2410.15946}, url={https://arxiv.org/abs/2410.15946}, } ``` # 用于带载荷飞行控制的神经预测器 本仓库包含论文《Neural Predictor for Flight Control with Payload》的实现,作者为 Ao Jin、Chenhao Li、Qinyi Wang、Ya Liu、Panfeng Huang 和 Fan Zhang*。 ***神经预测器*** 是一种基于学习的方案,用于捕捉由载荷引起的力/力矩以及系留无人机系统的残余动力学。具体来说,受 DDKO 理论的启发,推导了提升线性系统(LLS)的公式,并从数据中学习 LLS 以捕捉由载荷引起的力/力矩以及系留无人机系统的残余动力学。学习到的动力学与标称动力学相结合,生成了系留无人机系统的混合模型。该混合模型被整合到模型预测控制框架中,称为 ***NP-MPC***。我们证明,所提出的框架不仅能够比最先进的基于学习的估计器更好地预测外力和力矩,而且在仿真和实际飞行中显著提高了闭环性能。 ![171c09bd62e2332fdc71e256e9f7ba4a458fcfd4.png](assets/f36a3fbf42e57eca413beaf1b7a22f793384593c.png) 我们的论文:[Neural Predictor for Flight Control with Payload](https://arxiv.org/abs/2410.15946) ## 1. 开始使用 在运行代码之前,请通过在虚拟 Python 环境中执行以下命令来安装依赖包: ```bash pip install requirements.txt ``` ## 2. 运行代码 本仓库包含两部分代码:**数值评估**和**物理实验**。 ### 2.1 数值评估 我们提供了预训练模型以供评估。运行 `bash scripts/evaluation.sh` 以复现论文中呈现的结果。**此外,13 条未见轨迹的 RMSE 结果显示在 `dump/evaluation/rmse_result.csv` 中**,对应于论文中表 I 的结果。如果您想训练自己的 LLS,请按照以下说明操作。 * 处理 BEM 数据 本工作中用于训练和测试的数据集来自 BEM 数据集。为了方便起见,我们在 `data` 文件夹中提供了 BEM 数据集。导航到 `data/BEM` 文件夹,运行 `python process_data.py`,然后 `data/BEM` 文件夹中会出现一些图表和文件。 * 训练 LLS 运行 `bash scripts/train.sh`,这将花费几分钟(在 i9-12900H CPU 上的训练时间约为 8 分钟,在 RTX 3060 笔记本 GPU 上的训练时间约为 5 分钟)。训练完成后,训练好的 LLS 将位于 `dump/evaluation` 文件夹中。 * 评估神经预测器 运行 `bash scripts/evaluation.sh`。在 13 条未见轨迹上的验证结果将位于 `dump/evaluation/test` 中。在每个轨迹文件夹中,有两张图表显示了神经预测器的预测结果。 * 绘图 导航到 `plot` 文件夹。`BEM_Comparasion` 子文件夹对应于论文中图 2 的结果。`Sample_Efficiency` 子文件夹对应于论文中图 3 的结果。 ### 2.2 物理实验 我们在实际实验中评估了神经预测器。实际飞行实验的设置详见论文第 VI.B 节。
代码:即将发布 ## 3. 引用 如果您在研究中发现本仓库有用,请引用我们的工作: ```context @misc{jin2024neuralpredictorflightcontrol, title={Neural Predictor for Flight Control with Payload}, author={Ao Jin and Chenhao Li and Qinyi Wang and Ya Liu and Panfeng Huang and Fan Zhang}, year={2024}, eprint={2410.15946}, url={https://arxiv.org/abs/2410.15946}, } ```