185 Commits

Author SHA1 Message Date
Balduin
029edb50b3 refactor(control_allocation): Clarify and enforce that motors are in matrix 0 2026-03-09 17:10:32 +01:00
Balduin
b6164107d1 refactor(control_allocation): Make type alias for actuator bitmask 2026-03-09 17:10:32 +01:00
Balduin
af3cfaea25 fix(control_allocator): Apply stopped motors before slew
So transitions between stopped/not stopped respect the slew rate.

 - Remove previous stopped motor handling in publish_actuator_controls
 - Replace with handle_stopped_motors, called in Run() before slew
 - Introduce ApplyNanToActuators in ControlAllocation to stop
 - Refactor ice shedding slightly to fit new structure
2026-03-09 17:10:32 +01:00
Balduin
ee636a0e3d refactor(control_allocator): Remove slew rate from ice shedding
Will be unified with main output slew rate in commit just after
2026-03-09 17:10:32 +01:00
Balduin
16d938cda9
Ice shedding: fix docs rendering (#26616)
In the CA_ICE_PERIOD param description, a '>' was at the start of a
line. This is interpredeted by markdown as a quotation type indented
block which applies not only to that line, but to all following ones.
Changing the line breaks to only occur after full stops fixes it.
2026-03-05 20:25:40 +11:00
Jacob Dahl
ce3e62841f
module_base: remove CRTP template pattern to reduce flash bloat (#26476)
* module_base: claude rewrite to remove CRTP bloat

* module_base: apply to all drivers/modules

* format

* fix build errors

* fix missing syntax

* remove reference to module.h in files that need module_base.h

* remove old ModuleBase<T>

* add module_base.cpp to px4_protected_layers.cmake

* fix IridiumSBD can_stop()

* fix IridiumSBD.cpp

* clang-tidy: downcast static cast

* get_instance() template accessor, revert clang-tidy global

* rename module_base.h to module.h

* revert changes in zenoh/Kconfig.topics
2026-02-19 15:17:17 +13:00
Silvan Fuhrer
06d6c31614
Allocation: fix flaperons and spoilerons (symmetric ailerons up/down) (#26514)
Signed-off-by: Silvan <silvan@auterion.com>
2026-02-18 10:49:26 -08:00
Silvan Fuhrer
11007dc893
FW auto launch: Add option to lock selected surfaces before/during launch (#25799)
* FWModeManager: add option to set flag for disabling actuators during launch

Signed-off-by: Silvan <silvan@auterion.com>

* Allocation: add option to each control surface to be locked for launch

Signed-off-by: Silvan <silvan@auterion.com>

* FW rate control: reset integral while control surfaces are locked

Signed-off-by: Silvan <silvan@auterion.com>

---------

Signed-off-by: Silvan <silvan@auterion.com>
Co-authored-by: mahima-yoga <mahima@auterion.com>
2026-02-17 09:26:38 +01:00
Claudio Chies
e52ce5c43b
UAVCAN: Configurable LED Light Control with Flexible Addressing (#26253)
* feat: implement UAVCAN LED control for individual light control and assignment

* uavcan led: nit-picks from review

* uavcan led: reduce maximum number of lights

to avoid unused parameters

* uavcan led: simplify anticolision on check

* uavcan led: correctly map 8-bit RGB to rgb565

* Trim param name character arrays to 17

16 characters + \0 termination

* uavcan led: final nit-picks

---------

Co-authored-by: Matthias Grob <maetugr@gmail.com>
2026-02-16 18:39:48 +01:00
Balduin
0676647d8a
ControlAllocator: Periodically spin MC motors to shed ice (#26322)
This feature periodically spins the unused motors on VTOL airframes, to
break off ice that has built up in the motor while it is still feasible
to do so. Each ice shedding event sends a motor ouput of 0.01 to the
unused motors for 2 seconds.

Configured by `CA_ICE_PERIOD`, the duration of the entire cycle. Set to
0 to disable.
2026-01-27 11:15:24 +01:00
David Meng
11f4d5c4e7
control_allocator: improve status output formatting (#26277) 2026-01-22 14:09:56 -09:00
Jaeyoung Lim
9fe69d4f33
Make flap slew rate configurable (#26240)
* Make flap slew rate configurable

* Dynamically update params
2026-01-09 06:37:34 -08:00
Nick
575fa0850b
PWM: Add servo center setting & asymetric deflection (#25897)
Add PWM_*_CENTERx for each servo.
Use a bilinear transform to map actuator_servos to PWM signals.

This solution only works for PWM based servos. Other types of servos are not affected.

* PWM: Add servo trim option

* PWM: Improve documentation of PWM trim feature

* PWM: cleaner clamping and docs typo

* update documentation & safety

* add migration formula

* rename param from trim to center

* docs with center instead of trim

* move clamping and reorder values

* improve documentation

* adress failing range check

* improve documentation

* CA: add event for setting CENTER with TRIM

Signed-off-by: Silvan <silvan@auterion.com>

---------

Signed-off-by: Silvan <silvan@auterion.com>
Co-authored-by: Silvan <silvan@auterion.com>
2025-11-26 18:12:25 +01:00
Matthias Grob
e59afce5db Enable directly injecting motor failures using e.g. failure motor off -i 1
Only if SYS_FAILURE_EN is enabled and CA_FAILURE_MODE is > 0.
2025-09-30 11:23:09 +02:00
Matthias Grob
53efcbd2c2 control_allocation: Consistently replace with ActuatorVector alias for readability 2025-07-28 14:10:50 +02:00
Matthias Grob
37899269a8 control_allocator: fix PID dependency definition 2025-07-28 14:10:50 +02:00
Matthias Grob
930c0451b5 ActuatorEffectivenessRotorsTest: add Hexarotor X 2025-07-28 14:10:50 +02:00
Pedro Roque
be2e0b8990
feat: airframe config for spacecraft (#25287) 2025-07-24 12:07:56 -08:00
Pedro Roque
2f55dff8b9
feat: spacecraft support (#24734)
* rft: initial merging of controllers for spacecraft vehicles

* feat: rate controller nominal

* feat: spacecraft tooling for commander and VehicleStatus

* feat: spacecraft tooling for commander and VehicleStatus

* fix: format

* fix: format

* fix: remove iostream

* fix: remove iostream

* feat: spacecraft attitude control and minor refactoring of params

* feat: add position controller

* fix: format

* fix: moved trajectories to new message, removed derivative filters

* fix: format

* fix: removed extra newline

* fix: spacecraft allocation builds

* feat: add thrusters to effectivenes, add spacecraft build to cmake, clean comments

* feat: required changes for allocation

* feat: thruster simulation interface

* fix: update maximum and minimums

* fix: format

* fix: added newline at the end of spacecraft actuator effectiveness

* feat: configurable board pwm freq from Kconfig

* feat: mavlink compliant spacecraft definition

* feat: add orbiter to define

* boards: Increase TELEM2 rx buffer size for DDS over serial use-case (ARK Jetson)

feat: spacecraft tooling for commander and VehicleStatus

fix: format

fix: remove iostream

feat: mavlink compliant spacecraft definition

* feat: add orbiter to define

* feat: add orbiter to define

* fix: change mav_type to new spacecraft orbiter enum value

* fix: build issue

* feat: update mavlink

* feat: update mavlink to latest master with spacecraft

* feat: update mavlink

* feat: update mavlink to latest

* feat: cleanup and synchronization with new mavlink vehicle definition

* fix: get away without specifying spacecraft vehicle

* fix: removed unnecessary definition

* fix: format

* feat: cmake variant for spacecraft

* feat: proper mav_type and rc init

* fix: removed dart from build system

* add: thrusters to actuator type

* rft: reordering actuator type

* rft: initial merging of controllers for spacecraft vehicles

* feat: rate controller nominal

* fix: format

* feat: spacecraft attitude control and minor refactoring of params

* feat: add position controller

* fix: format

* fix: moved trajectories to new message, removed derivative filters

* fix: format

* fix: removed extra newline

* fix: spacecraft allocation builds

* feat: add thrusters to effectivenes, add spacecraft build to cmake, clean comments

* feat: required changes for allocation

* feat: thruster simulation interface

* fix: update maximum and minimums

* fix: format

* fix: added newline at the end of spacecraft actuator effectiveness

* feat: configurable board pwm freq from Kconfig

* feat: add orbiter to define

* feat: cleanup and synchronization with new mavlink vehicle definition

* fix: get away without specifying spacecraft vehicle

* fix: conflicts

* fix: format

* fix: remove duplicate entry

* rft: remove Kconfig changes

* rft: revert main Kconfig

* rft: revert main kcoonfig on platforms

* rft: remove changes to board PWm (go on another PR)

* rft: revert changes to commander (main is correct)

* fix: extra char on commander_helper

* rft: removed extra spaces

* rft: moved effectiveness to spacecraft

* fix: spacecraft effectiveness

* fix: extra space

* feat: preliminary version, still using thrusters

* rft: initial pipeline on PX4 side with rotors instead of thrusters

* feat: add atmos model

* feat: spacecraft with rotor pipeline tested, working

* feat: update gz

* rft: removed thruster interfaces

* fix: format

* fix: remove control allocation

* fix: thruster normalization

* fix: format

* fix: nuttx version

* fix: clang tidy error

* feat: updated gz to add atmos model

* fix: update gz

* fix: update mavlink

* fix: remove friend class from allocation lib

* fix: remove actuator_outputs/motors

---------

Co-authored-by: Alexander Lerach <alexander@auterion.com>
2025-07-23 08:26:27 -07:00
Silvan
66fe3aa2b3 ControlAllocator: only run allocator on torque updates, not thrust
Signed-off-by: Silvan <silvan@auterion.com>
2025-06-02 09:26:13 -07:00
Silvan
f0b05ea7cf ControlAllocator: only use torque, not thrust sp as callback item
Signed-off-by: Silvan <silvan@auterion.com>
2025-06-02 09:26:13 -07:00
Daan Smienk
3870992bac
Fix spelling mistake (#24623) 2025-03-27 09:46:02 -06:00
Ted
35d96d57f9
control_allocator: Added linearization feature for 4 servo swash plates to prevent binding (#23961)
* control_allocator: Added linearization feature for heli swashplates to help prevent servo binding

* Apply suggestions from code review

Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>

* update description of CA_LIN_SERVO parameter

* update variable name

* add missing semi-colon

* fix variable referenced before assignment

* add missing indentation

Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>

* removed param unnecessary param

* removed whitespace

* remove CA_LIN_SERVO and enable feature if CA_MAX_SERVO_THROW > 0 plus Update param description.

* remove CA_MAX_SVO_THROW from actuators tab to avoid confusion during standard swashplate setup.

* added comment and fixed spelling mistake

* fix spelling mistake

* fix formatting

* reduce CA_MAX_SVO_THROW short description length to stop test failure

* ActuatorEffectivenessHelicopter: clarfification suggestions for servo linearization feature

* remove NAN check.

---------

Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>
Co-authored-by: Matthias Grob <maetugr@gmail.com>
2025-02-24 12:17:11 +00:00
Daniel Agar
e12c3c00a4
control_allocator: param update avoid temporary
- this is a harmless workaround for a GCC warning (-Wdangling-pointer) false positive
2025-02-17 14:35:15 -05:00
Pedro Roque
e7e76e2e21
Spacecraft build and bare control allocator (#24221) 2025-02-06 23:54:24 -05:00
Matthias Grob
165f644580 control_allocator: fix typo and use [0,1] instead of [0%, 100%] in slew rate description
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2025-01-27 08:43:11 +01:00
Matthias Grob
c1cab2d4e0 control_allocator: add unit for slew rate and reword description 2025-01-27 08:43:11 +01:00
Matthias Grob
e01fef755a Control allocation: make heli rpm control an optional build flag disabled by default
to save flash.
The rpm capture dirver is also disabled on default releases
2025-01-15 14:35:35 +01:00
Jaeyoung Lim
974446c0e8
Make control allocation and actuator effectiveness a non-module-specific library (#24196)
* Remove more circular dependencies with ActuatorEffectiveness

* Separate vehicle specific actuator effectiveness

Keep actuator effectivenss in control allocator

* Remove test dependency for now

* Group library directories
Fix

* Change directory names

* Rebase fix
2025-01-15 10:12:29 +01:00
Matthias Grob
bc92008885 RpmControl: Better consider the case where there's no rpm measurement (anymore) 2025-01-14 14:55:34 +01:00
Matthias Grob
2506bd3b5d RpmControl: simplify the entire control logic 2025-01-14 14:55:34 +01:00
Matthias Grob
1c4325db6d RpmControl: split into cpp source file fixing includes 2025-01-14 14:55:34 +01:00
Matthias Grob
2772ae7e0e RpmControl: maximum rpm outliers are now caught by RpmCapture 2025-01-14 14:55:34 +01:00
Matthias Grob
ddd410e9d8 RpmControl: remove status message because it by now only contains redundant information 2025-01-14 14:55:34 +01:00
Matthias Grob
4050cedfaf RpmControl: call local message instance after message name following the convention 2025-01-14 14:55:34 +01:00
Matthias Grob
cd0e04f8b0 RpmControl: name current timestamp now following the convention 2025-01-14 14:55:34 +01:00
oravla5
ee67e4bb28 RpmControl: class clean up 2025-01-14 14:55:34 +01:00
Matthias Grob
940fe45ba7 ControlAllocator: introduce helicopter rotor rpm controller 2025-01-14 14:55:34 +01:00
Jaeyoung-Lim
f5c05f6d01 Take 2: Cleanup circular dependencies ActuatorEffectiveness 2025-01-13 09:29:42 +01:00
Jaeyoung Lim
208d37e703
Remove circular dependency if control allocation (#24195)
... and actuator effectiveness
2025-01-10 16:58:15 +01:00
somebody-once-told-me
3943025f32
Centralize yaw margin (#23982) 2024-11-20 09:52:36 +01:00
chfriedrich98
0e65679c9e
Mecanum rover: add dedicated module for mecanum rovers (#23708) 2024-09-25 09:35:41 +02:00
BazookaJoe1900
4d83badba1
fix files tags on the header comments (#23564) 2024-09-19 09:25:18 +03:00
chfriedrich98
33d99a13e8
differential: restructure and update module (#23430)
* differential: rename module

* differential: restructure and update module
2024-08-07 09:53:37 +02:00
Matthias Grob
f2bca92221 Fix duplicate newlines at the end of files 2024-07-19 14:33:36 +02:00
Matteo Del Seppia
a8617cf681
Fix float and uint64_t comparison (#23199)
fix: ControlAllocator float and int comparison bug

There was an incorrect comparison between a float variable `dt` and a `uint64_t` value representing 5 milliseconds (`5_ms`). As a result, `do_update` could never become true even if the last torque setpoint was received more than 5 milliseconds before.

To solve this, the `5_ms` value has been converted to seconds (0.005f) for the comparison with `dt`.
2024-06-03 17:48:38 -08:00
somebody-once-told-me
f40ede6087
Control Allocation Sequential Desaturation unit tests (#22612)
* [control_allocation] add unit tests for ControlAllocationSequentialDesaturation

* complete first 2 unit tests

* add yaw test

* add more unit tests

* improve comments

* format

* address review comments

* submodule update

* Update src/modules/control_allocator/ControlAllocation/ControlAllocationSequentialDesaturationTest.cpp

Co-authored-by: Silvan Fuhrer <silvan@auterion.com>

* Update src/modules/control_allocator/ControlAllocation/ControlAllocationSequentialDesaturationTest.cpp

Co-authored-by: Silvan Fuhrer <silvan@auterion.com>

* Update src/modules/control_allocator/ControlAllocation/ControlAllocationSequentialDesaturationTest.cpp

Co-authored-by: Silvan Fuhrer <silvan@auterion.com>

* remove float suffix for logical integers, add missing float suffixes for logical float zeros, and make YAW_MOTORS an int

---------

Co-authored-by: Master Chief <master-chief@the-void.com>
Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
2024-01-26 15:17:54 +01:00
somebody-once-told-me
3d5c2ef6c4
[control_allocation] small function comment typo fix (#22607)
Co-authored-by: Master Chief <master-chief@the-void.com>
2024-01-08 11:12:06 +01:00
Matthias Grob
3de5c609a4 Differential Rover: PR fixes 2023-12-21 16:27:53 +01:00
PerFrivik
3df71d1837 Differential Rover: Differential drive module & library 2023-12-21 16:27:53 +01:00