# UnityDrone **Repository Path**: ysofar/unity-drone ## Basic Information - **Project Name**: UnityDrone - **Description**: 记录了在 Unity 中构建一个高拟真 FPV 穿越机(Drone)物理模拟系统的过程。从基础的 PID 控制到引入空气动力学阻力、地面效应和电机惯性,一步步逼近真实的飞行手感。 - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2026-05-30 - **Last Updated**: 2026-05-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README This project is a drone simulation system developed using the Unity engine. It includes core components for controlling drone flight, such as the flight controller, motor engine, and PID controller. Below is the project structure and usage guide: ![alt text](Image/image.png) ![alt text](Image/image-1.png) ![alt text](Image/image-3.png) ![alt text](Image/操作示意图.jpg) --- ### Project Structure - **Assets/SimDrone/Scripts** - `DroneInput.cs`: Handles drone input controls, including throttle, yaw, pitch, and roll. - `FlightController.cs`: Main flight control logic that relies on `MotorEngine` and `PID` controllers to achieve attitude control. - `MotorEngine.cs`: Simulates the physical behavior of drone motors, including thrust and torque control. - `PID.cs`: Provides PID controller functionality for stable attitude control. - **Assets/SimDrone/Models** - Contains 3D model files for the drone (e.g., `Drone 2.fbx`). - **Assets/SimDrone/Materials** - Contains material files for the drone and ground used for rendering. - **Assets/SimDrone/Textures** - Contains texture map files for the drone. - **Assets/Scenes** - Contains Unity scene files (e.g., `SampleScene.unity`) used to build the simulation environment. --- ### Core Features - **Input Control** - Supports controlling drone movement via gamepad or keyboard. - **Flight Control** - Implements stable flight using PID algorithms, supporting multiple flight modes (e.g., angle mode). - **Physics Simulation** - Simulates motor thrust, torque, and aerodynamic effects. --- ### Usage Instructions 1. **Launch the Unity Project** - Open the project using the Unity Editor. 2. **Load the Scene** - Open `Assets/Scenes/SampleScene.unity` to begin the simulation. 3. **Control the Drone** - Use the keyboard or gamepad to control the drone’s flight. 4. **Adjust Parameters** - Modify PID parameters and flight modes within the `FlightController` component. --- ### Developer Guide - **Extending Functionality** - Optimize flight algorithms by modifying the `FlightController` and `PID` classes. - Add new sensors or physical effects to enhance simulation realism. - **Contributing Code** - If you are interested in contributing code to this project, please submit a Pull Request. --- ### License This project is licensed under the MIT Open Source License. For details, refer to the `LICENSE` file. --- For further information, please consult the project documentation or contact the developers. Feedback and suggestions are welcome!