Balduin 933d2d263d ControlAllocator: new unified battery scaling
Works by scaling the _mix matrix in the pinv conntrol allocator. This is
architecturally a bit ugly, but I think is a reasonable solution
considering the alternatives and their drawbacks:

Current version (in rate control modules):
 + simple
 - Relies on FW/VTOL proxy to determine which directions of
   thrust/torque need battery scaling
 - introduce battery scaled thrust / torque commands that are not
   physical thrust and torque but

Also modifying the torque / thrust setpoint like currently but inside of
the allocator (this one could actually reasonably work as well,
consider)
 + minimal functional change w.r.t. before, addresses the issue of
   confusing scaled and unscaled torque/thrust setpoints
 - FW/VTOL distinction gets hairier.
     - Currently we have separate scaling implementations for MC (->
       scale all thrust and torque commands, reasonably assuming that
       all rotors are driven by the same battery) and FW (-> scale only
       forward thrust). If we move it into the allocator,
     - In the allocator we get either one torque sp (MC or FW, from the
       rate controllers) or two (VTOL, from VTOL attitude controller).
       In the VTOL case, we have 0 = MC and 1 = FW. To replicate the
       previous logic, we have to separate these setpoints again into
       clear MC and FW components.

Instead modifying the effectiveness matrix through
ActuatorEffectivenessRotors
 + VERY clean and physically consistent, the scale enters by modifying
   the thrust coefficient, 1:1 modelling the decreased effectiveness of
   the rotor in both thrust and torque, in one single place
 - Does not work because the normalizeControlAllocationMatrix reverts
   the scaling effect that entered through the effectivenss matrix.
   Getting it to work would require reworking this scaling from the
   ground up or removing it entirely

Modifying only the motor outputs after the allocator
 + again very simple, does not care about FW/VTOL, we just do it for all
   the rotors
 - Introduces wrong actuator limits: Allocator assumes that rotors
   saturate based on a model unaware of battery scale, but because after
   the allocator we scale (increase) the commands, the actual saturation
   happens earlier.
2026-01-15 17:34:17 +01:00
2025-12-24 14:57:46 +11:00
2022-07-20 01:14:04 -04:00
2017-07-30 19:18:49 +02:00
2017-01-02 10:14:41 +01:00
2025-08-21 16:46:06 +02:00
2025-02-25 21:16:54 -05:00
2023-11-06 09:32:16 +01:00

PX4 Drone Autopilot

Releases DOI

Build Targets SITL Tests

Discord Shield

This repository holds the PX4 flight control solution for drones, with the main applications located in the src/modules directory. It also contains the PX4 Drone Middleware Platform, which provides drivers and middleware to run drones.

PX4 is highly portable, OS-independent and supports Linux, NuttX and MacOS out of the box.

Releases

Release notes and supporting information for PX4 releases can be found on the Developer Guide.

Building a PX4 based drone, rover, boat or robot

The PX4 User Guide explains how to assemble supported vehicles and fly drones with PX4. See the forum and chat if you need help!

Changing Code and Contributing

This Developer Guide is for software developers who want to modify the flight stack and middleware (e.g. to add new flight modes), hardware integrators who want to support new flight controller boards and peripherals, and anyone who wants to get PX4 working on a new (unsupported) airframe/vehicle.

Developers should read the Guide for Contributions. See the forum and chat if you need help!

Weekly Dev Call

The PX4 Dev Team syncs up on a weekly dev call.

Note

The dev call is open to all interested developers (not just the core dev team). This is a great opportunity to meet the team and contribute to the ongoing development of the platform. It includes a QA session for newcomers. All regular calls are listed in the Dronecode calendar.

Maintenance Team

See the latest list of maintainers on MAINTAINERS file at the root of the project.

For the latest stats on contributors please see the latest stats for the Dronecode ecosystem in our project dashboard under LFX Insights. For information on how to update your profile and affiliations please see the following support link on how to Complete Your LFX Profile. Dronecode publishes a yearly snapshot of contributions and achievements on its website under the Reports section.

Supported Hardware

For the most up to date information, please visit PX4 User Guide > Autopilot Hardware.

Project Governance

The PX4 Autopilot project including all of its trademarks is hosted under Dronecode, part of the Linux Foundation.

Dronecode Logo

 
S
Description
a mirror of official PX4-Autopilot
Readme BSD-3-Clause
587 MiB
Languages
C++ 51.2%
C 38.5%
CMake 4.7%
Python 3.9%
Shell 1.3%
Other 0.1%