← Drones with Go

GO DRONE PROGRAMMING · FLIGHT SIMULATOR · 6 LESSONS

Drone software: architecture, MAVLink and telemetry

Flight controller, companion computer and ground station, MAVLink v2 frames and checksums, telemetry rates and stale data, WGS84, ENU and NED, a Go ground station and sensor noise.

  1. Drone software architecture: flight controller, companion computer, ground station and fleet backend

    Place each piece of drone software on the right computer, explain why the inner control loops stay in real-time firmware, and fly a first simulated take-off, hold and landing from Go.

    6 min · Worked lesson

  2. MAVLink v2 frames: header, truncated payload, CRC_EXTRA and signing

    Encode and decode a MAVLink v2 HEARTBEAT in pure Go with encoding/binary, compute the CRC-16/MCRF4XX checksum seeded with CRC_EXTRA, and watch corruption and mismatched definitions get rejected.

    5 min · Worked lesson

  3. Telemetry streams: message rates, GLOBAL_POSITION_INT and stale-data detection

    Decode a recorded MAVLink stream, measure per-message rates and gaps on the ground station's clock, interpret GLOBAL_POSITION_INT's scaled integers, and flag stale streams and a lost link.

    5 min · Worked lesson

  4. Coordinates for drones: WGS84, ENU and NED, haversine and local tangent planes

    Convert mission waypoints between WGS84 latitude and longitude and local metres, compute great-circle distance and bearing, and know where the flat-plane approximation and spherical formulas stop being good enough.

    5 min · Worked lesson

  5. A ground station in Go: reader goroutine, heartbeat, context and link-loss timeouts

    Structure a MAVLink ground station with a reader goroutine, a periodic heartbeat, a channel of decoded frames, a select loop with a resettable link-loss timer and a context that shuts everything down cleanly.

    6 min · Worked lesson

  6. Sensors and noise: GPS, barometer and IMU, truth against measurement, RMSE and bias

    Compare simulated telemetry with the true state over a flight, compute bias and RMSE per sensor, and explain why smoothing one sensor fails and sensor fusion is needed.

    6 min · Worked lesson