px4 flight controller software

UAV tools

Ground control software

  • Mission Planner
  • QGroundControl
  • APM Planner 2
  • Mobile apps

FC Firmware

  • Ardupilot
  • PX4-Autopilot

PX4-Autopilot

Getting started resources

  1. All the confusing names in ‘Pixhawk’ explained (Mission Planner, PX4, Ardupilot Pixhawk etc.)
  2. Ubuntu Development Environment
  3. Building PX4 Software

make px4_sitl jmavsim

./QGroundControl.AppImage

Websites

Visual Studio Code IDE (VSCode)

Standard Configuration of flight controller

Installing firmware

Videos

PX4 Fundamentals Workshop

Integrating I2C/SPI C++ Sensor Driver for PX4

Getting started as a contributor on PX4

Architecture

PX4 state estimation update

PX4 Flight Task Architecture Overview

PX4 Architectural Overview

EKF

Parameters

Tools

Flight Log Analysis

PlotJuggler

PX4 Logs

Real-time log replay

Python based parser

Integration

Interface Bosch AI Sensor BME688 on PX4

Notes

EKF resets

Location : lockLocalPositionEstimator::gpsInit()

Tyically depends on nSat, eph, epv and fix_type and it’s configurable with EKF2_GPS_CHECK

GPS blending

gps_blending

Replay

ekf2-replay :

  • Set environmental variables in terminal
  • Configure EKF2 for running single EKF2 instance otherwise system replay is needed

Before waiting for a heartbeat message, it’s essential to send a heartbeat message. This “initializes” the mavlink communication system.

Sending heartbeat message

from pymavlink import mavutil
import time

# Create a connection to the MAVLink device
# For USB, use '/dev/ttyUSB0' (Linux) or 'comX' (Windows).
connection = mavutil.mavlink_connection('/dev/ttyUSB0', baud=115200)

# Function to send a heartbeat
def send_heartbeat():
    # Create the heartbeat message
    connection.mav.heartbeat_send(
        type=mavutil.mavlink.MAV_TYPE_GCS,         # MAV_TYPE_GCS for Ground Control Station
        autopilot=mavutil.mavlink.MAV_AUTOPILOT_INVALID,
        base_mode=0,
        custom_mode=0,
        system_status=mavutil.mavlink.MAV_STATE_STANDBY
    )

# Send a heartbeat every second
while True:
    send_heartbeat()
    print("Heartbeat sent")
    time.sleep(1)

Receiving a Heartbeat

from pymavlink import mavutil

# Create a connection to the MAVLink device
connection = mavutil.mavlink_connection('/dev/ttyUSB0', baud=115200)

# Wait for a heartbeat from the MAVLink device
print("Waiting for heartbeat...")
heartbeat = connection.wait_heartbeat(timeout=5)

if heartbeat:
    print(f"Heartbeat received from system {heartbeat.get_srcSystem()}, component {heartbeat.get_srcComponent()}")
else:
    print("No heartbeat received within the timeout period.")

Misc

PX4 UBX configurations

uORB Publication/Subscription Graph

Previous
Next