* fix(navigator): remove generic reset of navigator triplets on mode change
- make each navigation mode decide if it needs the reset and what data it
wants to capture before the reset
- fix RTL climbing so that it remains on an established loiter when RTL
is being activated -> avoids weird trajectories and potential geofence breaches
Signed-off-by: RomanBapst <bapstroman@gmail.com>
* feat(mavsdk_tests): added various integration tests for loitering behavior:
- make sure RTL climb remains on established loiter
- make sure new loiter at current location is set when HOLD is engaged while
vehicle is transiting to another loiter
- make sure altitude is locked to current altitude when vehicle is currently
flying an established loiter but is transiting to a higher altitude
- make sure vehicle resets from figure of 8 to a loiter when HOLD is engaged
while vehicle is established on a figure of 8
Signed-off-by: RomanBapst <bapstroman@gmail.com>
* navigator: improve wording
Signed-off-by: RomanBapst <bapstroman@gmail.com>
* rtl_mission_direct_land: avoid loitering on a previously set figure of 8
Signed-off-by: RomanBapst <bapstroman@gmail.com>
* fix(navigator): harden geofence position checks and preserve loiter on breach
The GF_SOURCE_GPS path previously gated the breach check on the global
position timestamp even though it evaluated the fence against raw GPS
coordinates. Validate each source against the data it actually uses:
the fused global position on freshness (<1s), and raw GPS on freshness
(<2s) plus a valid fix.
For the LOITER breach action, only issue the reposition when the fused
global position is valid, since the setpoint is flown on that estimate,
and source all reposition coordinates from it. When the vehicle is
already established on a circular (orbit) loiter, keep that loiter's
center instead of re-centering on the current position to avoid a jump.
Signed-off-by: RomanBapst <bapstroman@gmail.com>
* fixup
Signed-off-by: RomanBapst <bapstroman@gmail.com>
* make methods const
Signed-off-by: RomanBapst <bapstroman@gmail.com>
---------
Signed-off-by: RomanBapst <bapstroman@gmail.com>
* fix(zenoh): generate the topic catalog into the build tree
Kconfig.topics is fully generated from the uORB message set, but the build
regenerated it into the source tree at configure time. Building any Zenoh
board therefore left the working tree dirty whenever the message set had
changed since the file was last committed (the catalog is board-config
dependent, so it drifts easily).
Generate the catalog into the build directory in cmake/kconfig.cmake, before
Kconfig is parsed, and source it from there via ZENOH_KCONFIG_TOPICS. It is
generated board-independently from every message so it no longer depends on
the msg-gating Kconfig symbols it is sourced alongside; the per-board factory
still gates which topics are actually compiled. Drop the committed catalog.
* chore(zenoh): bump zenoh-pico to the build-tree header fix
Moves zenoh-pico's generated config.h/zenoh-pico.h/library.json out of its
own source tree and into the build tree, so building no longer dirties the
submodule.
Gated on PX4/zenoh-pico#2: the pointer currently references the fix branch on
a fork and must be moved to the merged commit before this is ready.
* bump zenoh-pico
* feat(failure_injection): integrate failure injection support across sensor drivers
* feat(failure_injection): enhance failure injection with RC switch support and instance bitmasking
feat(failure_injection): add disabled failure injection manager and system command support for v5x and v6x boards
* feat(failure_injection): add battery failure injection
Add a value-mutating apply-site for FAILURE_UNIT_SYSTEM_BATTERY. On an
injected OFF the outgoing battery_status is reported as a depleted pack
(zero remaining, emergency warning) so the low-battery failsafe triggers.
The apply-site lives in the shared Battery library, covering the analog
ADC, INA power monitors, ESC battery and SITL in one place, plus the
UAVCAN battery driver which publishes battery_status directly. The
previous SITL-only hack in BatterySimulator is removed in favour of this
shared path so simulation and hardware behave identically.
* fix(failure_injection): change parameter types from int32 to enum
* refactor(failure_injection): disable failure injection manager and system commands across multiple boards
* feat(failure_injection): enhance failure injection with timestamp handling and message-less support
* refactor(failure_injection): simplify has_timestamp_sample implementation and remove unused includes
* refactor(failure_injection):move conditional compilation into helper libary
* refactor(failure_injection): update CMakeLists to include failure_injection dependency across multiple drivers
---------
Co-authored-by: Claudio Chies <chiesc@chies.com>
The cdrstream uORB->IDL->CDR codegen floods the build log with noise:
- CycloneDDS idlc warns once per carried-over .msg comment that the
@verbatim annotation is unsupported (VehicleCommand alone emits 153).
Pass -Wno-unsupported-annotations via the idlc_generate WARNINGS list.
- rosidl_adapter prints a Reading/Writing line per message to stdout.
Filter those in msg2idl.py via builtins.print rather than redirecting
stdout, which the empy template engine breaks on. Errors still go to
stderr.
* fix(boards/ark/fpv): split FW/VTOL into separate builds for flash
Default ark_fpv is multicopter-only so listener and sd_bench fit in
flash. Fixed-wing and VTOL stacks move to ark_fpv_fw and ark_fpv_vtol,
which disable those two system commands to stay under the limit.
Signed-off-by: alexklimaj <alex@arkelectron.com>
* fix(boards/ark/fpv): trim optional modules from vtol build
Drop gimbal, gyro_fft, autotune, camera, payload, and debug systemcmds
from ark_fpv_vtol so the full VTOL stack fits with more flash margin.
Signed-off-by: alexklimaj <alex@arkelectron.com>
* fix(boards/ark/fpv): keep more modules on vtol; trim only debug extras
Restore autotune, gimbal, gyro_fft, mag bias, payload, camera, esc
battery, and actuator_test on ark_fpv_vtol. Keep flash margin by
leaving sd_bench, listener, bsondump, i2cdetect, and pca9685 off.
Signed-off-by: alexklimaj <alex@arkelectron.com>
---------
Signed-off-by: alexklimaj <alex@arkelectron.com>
* chore(claude): overhaul review-pr skill to focus on substance
The skill spent most of its 207 lines on process: merge-strategy
recommendations, commit-message auditing, formatting checks, and an
interactive posting menu. That feedback is nit-picky noise for a PR
author, and CI already enforces formatting.
Rewrite it (49 lines) around reviewing substance: merit and need (root
cause vs papering over), first-principles analysis for physics/math
changes, architecture consistency with the surrounding code, and an
alternatives assessment. Output is a debrief for the operator plus a
terse, actionable draft comment explicitly attributed as a Claude
review.
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
* chore(claude): generalize numeric-robustness check beyond float32
The physics/math check hardcoded float32; not all flight-critical math
uses it. Phrase the robustness check in terms of the given
representation, keeping float32 precision as a concrete example.
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
* chore(claude): fold maintainability into the architecture check
Rename the check to Architecture and maintainability and direct it at
hidden cross-module coupling — a change that silently breaks an
assumption in another module — asking for a contract-codifying unit
test when such coupling is unavoidable.
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
* chore(claude): add reliability to the correctness check
Reliability was not called out anywhere. Rename to Correctness and
reliability and add resource exhaustion and failure-path handling to
the list of defects to look for.
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
* chore(claude): make the debrief lead with findings
A per-file restatement of a well-described PR wastes tokens and time.
Have the debrief lead with actionable findings and only explain what
the change does when the PR description is missing, ambiguous, or
misleading.
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
* chore(claude): require provable, objectively-framed findings
Direct the draft comment to frame findings as engineering tradeoffs
rather than judgments, and to stay silent on any flaw it cannot
demonstrate via a concrete code path or first-principles derivation.
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
---------
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Strict command-parameter validation added in #27541 rejects
MAV_CMD_NAV_TAKEOFF when an unsupported param is set. QGroundControl
sends param1 (minimum pitch) = -1 on multicopter takeoff, which is
non-zero/non-NaN, so commands were silently denied (MAV_RESULT_DENIED
with no log) on MC airframes and QGC guided takeoff stopped working.
Extend the NAV_TAKEOFF override to include VEHICLE_MC so param1 is
accepted and ignored on multicopters, matching FW/VTOL handling.
Homebrew 6.0+ refuses to load formulae from untrusted third-party taps. This adds a trusted block for OSRF taps.
Signed-off-by: Cade Andersen <cadecandersen@gmail.com>
In AUX output mode, the gimbal module unconditionally acted as a
virtual gimbal device and therefore advertised a gimbal manager, even
if no output channel was assigned a gimbal output function, i.e. no
gimbal could possibly be connected. This conflicts with setups where a
gimbal manager external to PX4 is used.
Only act as a gimbal device (and hence advertise a gimbal manager) if
at least one output function param is set to gimbal roll/pitch/yaw,
mirroring the MAVLink v2 output mode which only advertises once a
gimbal device is discovered. The check is done once at module startup
to avoid scanning all params on every parameter update, so assigning
a gimbal output function requires a reboot to take effect.
Signed-off-by: Julian Oes <julian@oes.ch>
* feat(navigator): extend detect and avoid module to follow regulatory standards such as ASTM F3442
* docs(docs): minor subedit
* refactor(navigator): reduce flash by grouping notif into same events
* docs(daa): Improve docs readability with ::: details blocks
* fix(navigator): single event when on ground with conflict
* refactor(boards): increase flash length from 4M - 128k to 5M - 128k
* rework(general): define DAA standard at build with new CONFIG_NAVIGATOR_ADSB_F3442
* clean(navigator): minor changes to clean the PR
* feat(boards): add CONFIG_NAVIGATOR_ADSB_FAKE_TRAFFIC in visionTargetEstStatic.px4board
* rework(daa): reduce amount of abstractions and minor cleaning
* refactor(boards): allyes revert flash length to 4M-128K
* refactor(boards): allyes increase flash length to 5M-128K
* rework(daa): rework event notifications to improve clarity
* docs(docs): move details inside of ::: details block
* docs(docs): run npx prettier
* refactor(daa): avoid void mutator functions
* docs(docs): Improve Python helper to decode daa unique id
* rework(daa): move encoded id handling to the adsb lib and refactor on_active
* refactor(daa): naming and zero init
* fix(daa): move dataman dep from daa level to unit test level
* refactor(daa): define common daa_input and rework process_transponder_report
* fix(daa): remove stale todo
* refactor(daa): rename crosstrack_based_daa to crosstrack_standard
* refactor(daa): rename F34_ params to DAA_
* docs(docs): revert changes to autogenerated docs
* docs(docs): Add Detect And Avoid in index.md
* refactor(daa): update message on init failed
* refactor(daa): only publish most_urgent conflict once in on_active()
* refactor(daa): move conflict buffer handling in the adsb lib
* refactor(daa): move notifications into new class ConflictNotifier and only notify once per cycle
* refactor(daa): uninit _cycle_changes to store into .bss (and save flash)
* docs(docs): remove unused image link
* refactor(daa): move automated action policy to the adsb lib
* refactor(daa): move self detection into adsb lib as DaaTrafficFilter
* refactor(daa): minor changes in unit tests
* refactor(daa): merge DaaTrafficFilter and DaaEncoding
* fix(daa): fix CI by removing navigator from the DAA deps
* refactor(daa): reduce stack size
* fix(daa): advertise _fake_traffic_pub in constructor
* refactor(daa): Comments only, simplify and reduce comments
* fix(daa): brief comment missing end star
* Disable CONFIG_NAVIGATOR_ADSB in ark_fpv_default board
* docs(docs): General clarifications and remove the 1.18 badge
* refactor(daa): cleaning
* refactor(daa): minor cleaning
* refactor(adsb): simplify conflict tracker assuming push_back cannot fail
* build(cmake): cleaner fix to protect regex alternations
* refactor(daa): Crosstrack, remove unit test requiring finite yaw (yaw not used by standard)
* refactor(daa): minor cleaning and fix callsign to uint64
---------
Co-authored-by: jonas <jonas.perolini@rigi.tech>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
* docs(mc_pos_control): fix MPC_ACC_HOR_MAX description for MPC_POS_MODE
MPC_POS_MODE only exposes Direct velocity (0) and Acceleration based (4).
Replace the stale "mode 1" wording so parameter metadata matches the live enum.
* docs(mc_pos_control): shorten MPC_ACC_HOR_MAX long description
Keep it short per review (@dakejahl), in the spirit of #27758.
Update the mavlink receiving example to match the current behavior from
"b52464059e fix(mavlink): preserve invalid battery values on receive"
patch.
Signed-off-by: Onur Özkan <work@onurozkan.dev>
* feat(driver/heater): Add threshold to prevent the heater from always heating.
It only starts heating if the temperature drops below the specified threshold,
and continues until reset.
Battery::updateDt() clamps _dt to a maximum of 2 seconds:
_dt = math::min((timestamp - _last_timestamp) / 1e6f, 2.f);
This same _dt is then used for two different purposes:
1. Battery::sumDischarged(), the coulomb count that accumulates
discharged_mah: discharged_mah_loop = current_a * dt.
2. The current average low-pass filter update
(_current_average_filter_a.update(current_a, _dt)).
The 2-second clamp makes sense for (2): a low-pass filter update
generally assumes a roughly steady sample interval and shouldn't see a
single very large dt distort its state. It does not make sense for
(1): the coulomb count is a plain physical integral (charge = current
x time), and clamping dt there just means an update that arrives less
often than every 2 seconds (e.g. some DroneCAN/UAVCAN battery devices,
as reported in #27797) has its actual elapsed time silently truncated
to 2 seconds, systematically underestimating discharged_mah for that
update - the error accumulates over the life of the battery.
Fix: track a second, unclamped dt (_dt_discharge) alongside the
existing clamped one, and use it specifically for the coulomb count in
sumDischarged(). The filter update keeps using the existing clamped
_dt unchanged.
Fixes#27797
Test plan:
- I don't have hardware with a >2-second-interval battery update
source to reproduce this end-to-end, so I verified the corrected
arithmetic with a standalone C reproduction of updateDt()/
sumDischarged(): a 5-second update interval at a constant 10A
before the fix accumulates 5.56 mAh (current x 2s, clamped) instead
of the physically correct 13.89 mAh (current x 5s); after the fix it
correctly accumulates 13.89 mAh.
- Verified a normal high-frequency update pattern (10 x 100ms updates
at 5A) is unaffected: both before and after the fix accumulate the
same, correct 1.39 mAh for that 1-second span.
Signed-off-by: yi chen <94xhn1@gmail.com>
Co-authored-by: yi chen <94xhn1@gmail.com>
In navigator_main we use needsStraightLineFallback do determine whether
or not to show the error "RTL: no geofence avoidance path; flying directly".
Without any geofences that is not an error but expected behaviour.
Fix: When there are no geofences, do not declare
needsStraightLineFallback. Behaviour is otherwise the same - the geofence
avoidance path is empty, hasMore() always false, and we return directly.