Implements a comprehensive system for drone control, pose estimation, and system identification using the Tello drone
The project is organized into several main components:
camera_calibration.py
: Handles camera calibration using a chessboard pattern- Features:
- Automatic chessboard detection
- Intrinsic and extrinsic parameter estimation
- Calibration data storage and loading
drone_controller.py
: Main controller for the Tello drone- Features:
- Drone initialization and connection
- Real-time control using keyboard inputs
- Multi-threaded operation for control and pose estimation
- Integration with pose estimation and camera calibration
pose_estimator.py
: Handles ArUco marker detection and pose estimation- Features:
- ArUco marker detection and tracking
- 6-DOF pose estimation
- Real-time visualization of pose
- Data logging for system identification
sindy_pipeline.py
: Implements Sparse Identification of Nonlinear Dynamics (SINDy)- Features:
- Data preprocessing and filtering
- State and control input extraction
- SINDy model fitting
- Model visualization and evaluation
- Model saving and loading
keyboard_handler.py
: Manages keyboard input for drone control- Features:
- Customizable control mapping
- Real-time input handling
- Takeoff and landing commands
.
├── src/
│ ├── calibration/
│ ├── control/
│ ├── pose_estimation/
│ ├── system_identification/
│ └── utils/
├── sample_data/
│ ├── sample_input.csv
│ ├── sample_output.csv
│ └── sample_calibration.npz
├── calibration_data/
├── input_data/
└── output_data/
The repository includes sample data in the sample_data/
directory:
sample_input.csv
: Sample control input data for the dronesample_output.csv
: Sample pose estimation datasample_calibration.npz
: Sample camera calibration data for the Tello drone
These files can be used to test the system identification pipeline without requiring a physical drone.
-
Clone the repository:
git clone https://github.com/Norbera0/Drone-ArUco-marker-pose-estimation-.git cd Drone-ArUco-marker-pose-estimation-
-
Create and activate a virtual environment:
# On Windows python -m venv venv .\venv\Scripts\activate # On macOS/Linux python3 -m venv venv source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
- Tello drone
- Computer with WiFi capability
- Chessboard pattern for calibration (9x6 grid recommended)
- ArUco markers for pose estimation
-
Camera Calibration:
from src.calibration.camera_calibration import CameraCalibrator calibrator = CameraCalibrator() calibrator.calibrate_camera("tello")
-
Drone Control:
from src.control.drone_controller import DroneController controller = DroneController() controller.run()
-
System Identification:
from src.system_identification.sindy_pipeline import SINDyPipeline pipeline = SINDyPipeline() pipeline.run_pipeline("sample_data/sample_output.csv")
e
: Takeoffq
: Land- Arrow Keys: Control yaw and altitude
w/s
: Forward/backwarda/d
: Left/right
The system automatically collects and stores:
- Camera calibration data
- Pose estimation data
- Control inputs
- System identification results
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.