Skip to content

fix(commander): gate heading innovation check on global origin#27420

Open
onelittlechildawa wants to merge 1 commit into
PX4:mainfrom
onelittlechildawa:fix/heading-innov-global-origin
Open

fix(commander): gate heading innovation check on global origin#27420
onelittlechildawa wants to merge 1 commit into
PX4:mainfrom
onelittlechildawa:fix/heading-innov-global-origin

Conversation

@onelittlechildawa
Copy link
Copy Markdown
Contributor

Summary

Follow-up to #27371.

Keep heading innovation preflight failures consistent with the global-origin gating added for heading-reference checks.

Problem

#27371 relaxed heading-reference enforcement for local-only operation, but one heading preflight failure path still did not account for whether a global origin exists.

This could still deny arming for local-only setups with a heading-related preflight error.

Solution

Apply the same global-origin requirement to the heading innovation preflight failure path.

Globally referenced operation keeps the stricter heading validation, while local-only operation remains allowed.

Copilot AI review requested due to automatic review settings May 21, 2026 02:27
@github-actions github-actions Bot added kind:bug Something is broken or behaving incorrectly. risk:safety-critical May affect arming, failsafe, control, navigation, or flight safety. scope:commander Arming, modes, failsafe, health checks, or vehicle state. labels May 21, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates estimator arming checks to pass local position context into checkEstimatorStatus() and conditionally enforce heading requirements based on whether a global reference is set.

Changes:

  • Extend checkEstimatorStatus() to accept vehicle_local_position_s (lpos) for richer decision-making.
  • Gate the preflight heading innovation failure check on lpos.xy_global.
  • Update the call site to pass lpos into the estimator status check.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/modules/commander/HealthAndArmingChecks/checks/estimatorCheck.hpp Adds lpos parameter to checkEstimatorStatus() declaration.
src/modules/commander/HealthAndArmingChecks/checks/estimatorCheck.cpp Passes lpos into checkEstimatorStatus() and uses lpos.xy_global to gate heading preflight failure.

const estimator_status_s &estimator_status, const vehicle_local_position_s &lpos,
NavModes required_groups)
{
// Heading is required to arm for all modes that need any form of local position, plus FW AUTO_TAKEOFF
Comment on lines +148 to +149
// Only require a heading reference when a global origin is set (i.e. global ops are intended)
if (!context.isArmed() && estimator_status.pre_flt_fail_innov_heading && lpos.xy_global) {
const estimator_status_s &estimator_status, const vehicle_local_position_s &lpos,
NavModes required_groups)
{
// Heading is required to arm for all modes that need any form of local position, plus FW AUTO_TAKEOFF
@dakejahl dakejahl requested review from bresch and haumarco May 21, 2026 02:37
Signed-off-by: onelittlechildawa <onelittlechild@outlook.com>
@onelittlechildawa onelittlechildawa force-pushed the fix/heading-innov-global-origin branch from 2d0517a to 442bae7 Compare May 21, 2026 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:bug Something is broken or behaving incorrectly. risk:safety-critical May affect arming, failsafe, control, navigation, or flight safety. scope:commander Arming, modes, failsafe, health checks, or vehicle state.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants