This Python script controls a Crazyflie quadrotor in Webots simulator, generating a trajectory using the A* path planning algorithm and following it using PID control. Additionally, the script utilizes YOLO for real-time person recognition, causing the quadrotor to stop upon detection.
- @josemaese
- @santiagomoreno0123
- Miguel Ballesteros Delgado
- @javgilavi
controller
,Keyboard
, andSupervisor
modules from Webots.- PID controllers (
pid_velocity_fixed_height_controller
andQuadrotorController
) for stability and navigation. - Computer Vision functionalities with OpenCV (
cv2
) for person recognition using YOLO. - Other libraries include
numpy
,math
,threading
,csv
,PIL
,matplotlib
, and custom modules likeruta_predefinida
,evita_obstaculos
,astar3D
, etc.
- Install Webots.
- Place the script in the Webots project directory.
- Run the Webots simulator with the specified Crazyflie model.
- UP, DOWN, RIGHT, LEFT: Move in the horizontal plane.
- Q, E: Rotate around yaw.
- W, S: Go up and down.
- A: Enable autonomous mode.
- D: Disable autonomous mode.
- 1, 2, 3: Set predefined targets.
- I: Export data to CSV and generate graphs.
- The script generates a trajectory using the A* path planning algorithm and follows it autonomously.
- YOLO-based person recognition triggers a stop action.
- YOLO (You Only Look Once) is used for real-time person detection.
- Camera feed is processed to recognize and react to the presence of people.
- Data logging: The script logs positional data and target information into CSV files for further analysis.