Skip to content

fix(sih): fix velocity in body direction#27390

Open
sfuhrer wants to merge 1 commit into
mainfrom
fix/sih-fw-airspeed-calc-mian
Open

fix(sih): fix velocity in body direction#27390
sfuhrer wants to merge 1 commit into
mainfrom
fix/sih-fw-airspeed-calc-mian

Conversation

@sfuhrer
Copy link
Copy Markdown
Contributor

@sfuhrer sfuhrer commented May 19, 2026

Solved Problem

See https://github.com/PX4/PX4-Autopilot/pull/27376/changes#r3264262813

Solution

Use the correct ground speed rotated to body frame.

Signed-off-by: Silvan <silvan@auterion.com>
@sfuhrer sfuhrer requested a review from mbjd May 19, 2026 07:03
@github-actions github-actions Bot added kind:bug Something is broken or behaving incorrectly. scope:simulation SITL, Gazebo, jmavsim, lockstep, or simulated sensors. labels May 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 168 byte (0.01 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +168  +0.0%    +168    .text
    +102%    +168  +102%    +168    Sih::send_airspeed()
  +0.0%     +55  [ = ]       0    .debug_abbrev
  +0.0% +2.22Ki  [ = ]       0    .debug_info
  +0.0%    +509  [ = ]       0    .debug_line
   -66.7%      -2  [ = ]       0    [Unmapped]
    +0.0%    +511  [ = ]       0    [section .debug_line]
  +0.0% +1.08Ki  [ = ]       0    .debug_loclists
  +0.0%     +73  [ = ]       0    .debug_rnglists
  +0.0%     +13  [ = ]       0    .debug_str
  -1.4%    -168  [ = ]       0    [Unmapped]
  +0.0% +3.94Ki  +0.0%    +168    TOTAL

px4_fmu-v6x [Total VM Diff: 0 byte (0 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +55  [ = ]       0    .debug_abbrev
  -0.0%      -2  [ = ]       0    .debug_info
  -0.0%      -5  [ = ]       0    .debug_line
    [NEW]      +2  [ = ]       0    [Unmapped]
    -0.0%      -7  [ = ]       0    [section .debug_line]
  +0.0%     +48  [ = ]       0    TOTAL

Updated: 2026-05-19T07:09:36


// pitot tube measures forward (body-x) airspeed
airspeed.true_airspeed_m_s = fmaxf(0.1f, _v_B(0) + generate_wgn() * 0.2f);
const Vector3f v_apparent_B = _q.rotateVectorInverse(_v_apparent_N);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks correct - while we're at it we could also change the conversion in generate_force_and_torques to look the same (_q_E.rotateVectorInverse(_R_N2E * _v_apparent_N); is equivalent to this)

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. scope:simulation SITL, Gazebo, jmavsim, lockstep, or simulated sensors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants