You are browsing as a guest. Sign up (or log in) to start making projects!

Autonomous drone

Hardware
  • 1 Devlogs
  • 1 Total hours

A drone that runs autonomously and can use different sensors

Open comments for this post

33m 44s logged

We built a MAVLink interface class for autonomous drone control and precision landing, wrapping PyMAVLink to handle communication over hardware serial (/dev/ttyAMA0 at 921600 baud).To prevent telemetry processing from slowing down our main vision loop, we moved incoming packet handling to a dedicated background daemon thread. We requested specific telemetry streams from the flight controller (LOCAL_POSITION_NED and DISTANCE_SENSOR at 10 Hz, HEARTBEAT at 2 Hz) using MAV_CMD_SET_MESSAGE_INTERVAL. To keep multi-threaded access clean, all reads and writes to state variables like armed, current_mode, local_position, and rangefinder_alt_m are protected with a threading lock.For vehicle execution, we implemented helper methods for mode switching, arming, and autonomous takeoff. The takeoff command switches to GUIDED mode, arms the vehicle, issues MAV_CMD_NAV_TAKEOFF, and blocks until the drone reaches 95% of the target altitude by monitoring local NED Z-coordinates.For the precision landing pipeline, we integrated VisionTracker with MAVLink’s landing_target_send using MAV_FRAME_BODY_NED. The main loop continuously feeds relative visual offset angles (angle_x, angle_y) to the flight controller at ~20 Hz. Before committing to a final landing, get_position_hold_feedback calculates 2D horizontal speed using the velocity vectors (v = \sqrt{v_x^2 + v_y^2}). Once horizontal speed drops below 0.15 m/s and local altitude drops under 1.0 meter, the controller automatically commands LAND mode for touchdown, finishing with thread cleanup on exit.

0
1
103

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…