Skip to content

BaranDev/443-project-quadcopter

Repository files navigation

CMSE443 Quadcopter Motion Control - Real-Time System

Term Project - Group 30

Team Members

  • Kaan Kababulut (22331319)
  • Cevdet Baran Oral (23002740)
  • Taniya Dibaee (22703481)

System Requirements

  • Operating System: Windows 10/11 (64-bit)
  • Python: 3.8 or higher
  • Cosys-AirSim Simulator: Download from official releases (see below)
  • Xbox Controller: Optional (keyboard fallback available)

Installation Instructions

Step 1: Download Cosys-AirSim Simulator

Download the Blocks environment from the official Cosys-AirSim releases:

Windows: https://github.com/Cosys-Lab/Cosys-AirSim/releases

Extract the downloaded archive and place the Windows folder containing Blocks.exe in the project root directory.

Note: Due to time constraints, a custom level design was not implemented. The standard Blocks environment is used for demonstration. A custom level can be provided as a revision if requested.

Step 2: Install Python Dependencies

Option A: Automatic Setup (Recommended)

Simply double-click start_simulator.bat. This script will:

  1. Check Python installation
  2. Create a virtual environment
  3. Install all required dependencies
  4. Launch the AirSim simulator
  5. Start the controller application

Option B: Manual Setup

# Create virtual environment
python -m venv venv

# Activate virtual environment
venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run the controller
python main.py

Running the Simulator

  1. Ensure Cosys-AirSim Blocks.exe is in the Windows/ folder
  2. Run start_simulator.bat OR:
    • Start Windows/Blocks.exe manually
    • Wait for it to load
    • Run python main.py

Controls

Xbox Controller (Recommended)

Control Action
Left Stick Yaw / Throttle
Right Stick Roll / Pitch
Right Trigger Ascend
Left Trigger Descend
A Button Arm / Disarm
B Button Emergency Stop
Start Takeoff
Back Land

Keyboard Fallback

Key Action
W / S Pitch Forward / Backward
A / D Yaw Left / Right
Q / E Roll Left / Right
Space Ascend
Left Shift Descend
Enter Arm / Disarm
Escape Emergency Stop
R Reset Simulation

Project Structure

├── main.py                 # Main controller application
├── quadcopter_model.py     # Mathematical model (Newton-Euler)
├── pid_controller.py       # Cascaded PID controllers
├── input_handler.py        # Xbox/Keyboard input handling
├── visualization.py        # Tkinter GUI and telemetry
├── test_suite.py           # Unit and integration tests
├── requirements.txt        # Python dependencies
├── start_simulator.bat     # Automatic setup script
├── settings.json           # AirSim configuration
└── RTS-TermProject-Report-Group30.docx  # Project report

Dependency Notes

The project requires tornado==4.5.3 for compatibility with msgpack-rpc-python (used by cosysairsim). The batch file handles this automatically.

Required Packages:

  • numpy
  • cosysairsim
  • msgpack-rpc-python
  • tornado==4.5.3
  • XInput-Python
  • keyboard
  • nest_asyncio

Running Tests

pytest test_suite.py -v

Troubleshooting

"Cannot connect to AirSim"

  • Ensure Blocks.exe is running before starting main.py
  • Check that port 41451 is not blocked by firewall

"Tornado version conflict"

  • Run pip uninstall rpc-msgpack if you see this error
  • Then reinstall with pip install tornado==4.5.3

Controller not detected

  • Ensure Xbox controller is connected before starting
  • Keyboard fallback is always available

Contact

For questions about this project, contact the team leader: Cevdet Baran Oral - cevdetbaranoral@gmail.com


Repository

https://github.com/BaranDev/443-project-quadcopter

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published