Skip to content

Conversation

@demvlad
Copy link
Contributor

@demvlad demvlad commented Nov 12, 2025

NED velocities are added into GPS data.
GPS NED velocities are used in MAVLink telemetry and stored in black box log.
The GPS accuracy is added into MAVLink telemetry.

Summary by CodeRabbit

  • New Features

    • GPS logging now records velocity components (north, east, down).
    • MAVLink telemetry now includes real GPS-derived altitude and timestamps.
  • Improvements

    • Telemetry and global position messages use actual GPS velocities and accuracy values instead of placeholders, improving situational awareness and telemetry fidelity.

@github-actions
Copy link

Do you want to test this code? You can flash it directly from the Betaflight App:

  • Simply put #14762 (this pull request number) in the Select commit field in the Firmware Flasher tab (you need to Enable expert mode, Show release candidates and Development).

WARNING: It may be unstable. Use only for testing!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 12, 2025

Walkthrough

GPS north/east/down velocities are captured from UBLOX NAV‑VELNED / NAV‑PVT, stored in a new velned field in the GPS solution, emitted to blackbox logs, and included in MAVLink telemetry while several placeholder altitude/accuracy/timestamp fields are replaced with real GPS values.

Changes

Cohort / File(s) Summary
GPS Data Structures
src/main/io/gps.h
Add gpsVelned_s (velN, velE, velD int16_t, cm/s) and add velned member to gpsSolutionData_t.
GPS Data Population
src/main/io/gps.c
Populate gpsSol.velned.velN/velE/velD from UBLOX NAV‑VELNED (cast to int16_t) and NAV‑PVT (divide by 10 → cm/s); update speed/groundCourse fields and set ubxHaveNewSpeed.
Blackbox Logging
src/main/blackbox/blackbox.c
Append three GPS_velned fields to GPS G‑frame definitions and write velN, velE, velD using blackboxWriteSignedVB.
MAVLink Telemetry
src/main/telemetry/mavlink.c
Replace placeholder zeros with actual GPS data: HDOP/VDOP, altitude (altCm * 10), accuracies (hAcc, vAcc, sAcc), velocity components (velN/velE/velD), origin altitude, and use micros() for timestamp; set heading/track uncertainty to UINT32_MAX and yaw to 0.

Sequence Diagram(s)

sequenceDiagram
    participant UBX as UBLOX Receiver
    participant GPS as src/main/io/gps.c
    participant Store as gpsSolutionData (gps.h)
    participant Blackbox as src/main/blackbox/blackbox.c
    participant MAVLink as src/main/telemetry/mavlink.c

    UBX->>GPS: NAV-VELNED / NAV-PVT messages (velocities + related data)
    GPS->>GPS: parse, scale (NAV-PVT ÷10), cast (NAV-VELNED → int16)
    GPS->>Store: store velN, velE, velD in gpsSol.velned

    rect rgb(220,235,255)
      Store->>Blackbox: read velned
      Blackbox->>Blackbox: emit GPS G-frame including velN/E/D
    end

    rect rgb(235,245,220)
      Store->>MAVLink: read velned, dop, acc, alt
      MAVLink->>MAVLink: populate GPS_RAW_INT / global payloads (replace placeholders with real values)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Attention areas:
    • src/main/io/gps.c: verify unit/scaling (NAV‑PVT ÷10 → cm/s) and casting safety for high velocities.
    • src/main/telemetry/mavlink.c: confirm MAVLink field units/order (GPS_RAW_INT, global position) and semantics for micros()/UINT32_MAX.
    • Cross-file consistency: ensure int16_t range and scaling match between gps.h, blackbox logging, and MAVLink outputs.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: adding NED velocities to GPS data structure and logging, which is the core focus across all modified files.
Description check ✅ Passed The description provides a clear summary of the changes (NED velocities added, used in MAVLink telemetry and black box, GPS accuracy added to telemetry) but lacks technical details about implementation, affected files, and testing steps as would be expected.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 48ed018 and 6216544.

📒 Files selected for processing (1)
  • src/main/telemetry/mavlink.c (3 hunks)
🧰 Additional context used
🧠 Learnings (9)
📚 Learning: 2025-08-24T19:16:35.413Z
Learnt from: haslinghuis
Repo: betaflight/betaflight PR: 14620
File: src/main/telemetry/motor_sensor.c:0-0
Timestamp: 2025-08-24T19:16:35.413Z
Learning: In src/main/telemetry/motor_sensor.c DSHOT path, voltage, consumption, and dataAge fields are intentionally left uninitialized since they are not currently used by consumers. Initialization of these fields should be deferred to a separate PR when they become needed.

Applied to files:

  • src/main/telemetry/mavlink.c
📚 Learning: 2025-09-30T20:29:28.877Z
Learnt from: haslinghuis
Repo: betaflight/betaflight PR: 14683
File: src/main/cli/cli.c:5011-5014
Timestamp: 2025-09-30T20:29:28.877Z
Learning: In src/main/fc/rc_controls.h, the rcSmoothingFilter_t struct fields setpointCutoffFrequency and throttleCutoffFrequency are uint16_t types, not float. They should be printed directly without lrintf() conversion in CLI output.

Applied to files:

  • src/main/telemetry/mavlink.c
📚 Learning: 2025-10-26T08:47:16.557Z
Learnt from: demvlad
Repo: betaflight/betaflight PR: 0
File: :0-0
Timestamp: 2025-10-26T08:47:16.557Z
Learning: In Betaflight MAVLink telemetry (src/main/telemetry/mavlink.c), DEBUG fields are used as follows: DEBUG[0] indicates whether telemetry should transmit (actual free TX buffer space > mavlink_min_txbuffer), DEBUG[1] shows actual free TX buffer space, and DEBUG[2] through DEBUG[7] are data transmit counters used to determine actual stream data rates.

Applied to files:

  • src/main/telemetry/mavlink.c
📚 Learning: 2025-10-05T10:00:10.464Z
Learnt from: demvlad
Repo: betaflight/betaflight PR: 0
File: :0-0
Timestamp: 2025-10-05T10:00:10.464Z
Learning: In Betaflight MAVLink telemetry implementation (src/main/telemetry/mavlink.c), all mavlink_msg_*_pack() calls must use component ID 1 (MAV_COMP_ID_AUTOPILOT1) instead of 200 (MAV_COMP_ID_MISSIONPLANNER) for telemetry to be visible in ELRS TX modules and ground control stations like MissionPlanner. Component ID 200 is for ground station software, not flight controllers.

Applied to files:

  • src/main/telemetry/mavlink.c
📚 Learning: 2025-10-29T16:03:23.891Z
Learnt from: nerdCopter
Repo: betaflight/betaflight PR: 0
File: :0-0
Timestamp: 2025-10-29T16:03:23.891Z
Learning: In Betaflight firmware reviews, do not suggest adding DEBUG_PRINTF, logging, or diagnostic output. Betaflight follows embedded systems best practices with silent error handling using return codes and graceful fallbacks. Debug output was explicitly removed per Betaflight standards (see commit 12b2813ac in PR #14733).

Applied to files:

  • src/main/telemetry/mavlink.c
📚 Learning: 2025-09-28T08:42:08.229Z
Learnt from: demvlad
Repo: betaflight/betaflight PR: 0
File: :0-0
Timestamp: 2025-09-28T08:42:08.229Z
Learning: In Betaflight, duplicate #define statements in common_pre.h can cause the configurator to not properly detect available telemetry protocols. When USE_TELEMETRY_MAVLINK is defined multiple times, it can break the protocol registration system, causing MAVLink telemetry to disappear from the configurator's Port tab even when properly defined.

Applied to files:

  • src/main/telemetry/mavlink.c
📚 Learning: 2025-10-29T16:03:51.429Z
Learnt from: nerdCopter
Repo: betaflight/betaflight PR: 0
File: :0-0
Timestamp: 2025-10-29T16:03:51.429Z
Learning: In Betaflight embedded drivers, error handling should use silent failure with bool return values and graceful fallbacks, not DEBUG_PRINTF or console logging. DEBUG_PRINTF is inappropriate for production flight controller code due to code bloat, performance impact, and lack of console output in production hardware. The standard pattern is: return false on error, provide fallback behavior where possible, and avoid string formatting in drivers.

Applied to files:

  • src/main/telemetry/mavlink.c
📚 Learning: 2025-07-09T09:22:27.106Z
Learnt from: jianpingwu1
Repo: betaflight/betaflight PR: 14519
File: lib/main/GD32F4/Drivers/GD32F4xx_standard_peripheral/Source/gd32f4xx_can.c:110-110
Timestamp: 2025-07-09T09:22:27.106Z
Learning: In Betaflight GD32F4 firmware library integration, typos and minor issues in vendor-supplied code from GigaDevice Semiconductor are kept as-is to maintain synchronization with upstream library updates, avoiding local modifications that could complicate future library version updates.

Applied to files:

  • src/main/telemetry/mavlink.c
📚 Learning: 2025-07-06T15:59:35.310Z
Learnt from: ledvinap
Repo: betaflight/betaflight PR: 14517
File: src/main/cms/cms_menu_firmware.c:191-192
Timestamp: 2025-07-06T15:59:35.310Z
Learning: In the Betaflight codebase, the constants MAX_MANUFACTURER_ID_LENGTH and MAX_BOARD_NAME_LENGTH already include space for the null terminator, so arrays should be sized exactly to these constants without adding +1. The previous +1 additions were over-allocating by one byte.

Applied to files:

  • src/main/telemetry/mavlink.c
🧬 Code graph analysis (1)
src/main/telemetry/mavlink.c (2)
src/test/unit/flight_failsafe_unittest.cc (2)
  • micros (730-733)
  • micros (730-730)
src/platform/SIMULATOR/sitl.c (1)
  • micros (443-446)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: CI / Build (RP2350A)
  • GitHub Check: CI / Build (APM32F405)
  • GitHub Check: CI / Build (RP2350B)
🔇 Additional comments (4)
src/main/telemetry/mavlink.c (4)

294-297: LGTM: DOP values correctly implemented.

The HDOP and VDOP fields are correctly sourced from gpsSol.dop and the comments accurately reflect the MAVLink specification (unitless * 100).


349-351: LGTM: GPS global origin properly updated.

The altitude conversion correctly transforms centimeters to millimeters (cm × 10 = meters × 1000), and using micros() for the timestamp is appropriate—MAVLink accepts both UNIX epoch and system boot timestamps.


332-336: Units confirmed correct—velned fields properly stored in cm/s.

The velocity fields are correctly populated in centimeters per second as required by MAVLink:

  • From NAV-VELNED: direct assignment already in cm/s
  • From NAV-PVT: division by 10 converts mm/s to cm/s

The comment terminology could optionally be refined (velN/velE/velD represent northward/eastward/downward velocity in the NED coordinate system, not strictly "latitude/longitude/altitude speed"), but the implementation is correct.


304-315: Code is correct — accuracy fields are in mm as required by MAVLink.

The verification confirms:

  • UBLOX driver provides hAcc, vAcc, sAcc in mm natively (no conversion needed)
  • MSP protocol converts from cm to mm before storing: sbufReadU16(src) * 10
  • Virtual GPS stores all accuracy values in mm

All GPS data sources consistently populate gpsSol.acc fields in mm. The mavlink.c code correctly uses them directly without further conversion.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 60a9112 and 430a92a.

📒 Files selected for processing (4)
  • src/main/blackbox/blackbox.c (2 hunks)
  • src/main/io/gps.c (2 hunks)
  • src/main/io/gps.h (1 hunks)
  • src/main/telemetry/mavlink.c (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-05T10:00:10.464Z
Learnt from: demvlad
Repo: betaflight/betaflight PR: 0
File: :0-0
Timestamp: 2025-10-05T10:00:10.464Z
Learning: In Betaflight MAVLink telemetry implementation (src/main/telemetry/mavlink.c), all mavlink_msg_*_pack() calls must use component ID 1 (MAV_COMP_ID_AUTOPILOT1) instead of 200 (MAV_COMP_ID_MISSIONPLANNER) for telemetry to be visible in ELRS TX modules and ground control stations like MissionPlanner. Component ID 200 is for ground station software, not flight controllers.

Applied to files:

  • src/main/telemetry/mavlink.c
🧬 Code graph analysis (1)
src/main/telemetry/mavlink.c (3)
src/test/unit/flight_failsafe_unittest.cc (2)
  • micros (730-733)
  • micros (730-730)
src/test/unit/osd_unittest.cc (2)
  • micros (1306-1308)
  • micros (1306-1306)
src/platform/SIMULATOR/sitl.c (1)
  • micros (443-446)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (23)
  • GitHub Check: CI / Build (TBS_LUCID_FC)
  • GitHub Check: CI / Build (SPRACINGH7EXTREME)
  • GitHub Check: CI / Build (AIRBOTG4AIO)
  • GitHub Check: CI / Build (SPRACINGH7RF)
  • GitHub Check: CI / Build (CRAZYBEEF4FR)
  • GitHub Check: CI / Build (APM32F405)
  • GitHub Check: CI / Build (IFLIGHT_BLITZ_F722)
  • GitHub Check: CI / Build (NUCLEOF446)
  • GitHub Check: CI / Build (STM32H750)
  • GitHub Check: CI / Build (CRAZYBEEF4SX1280)
  • GitHub Check: CI / Build (AT32F435G)
  • GitHub Check: CI / Build (RP2350A)
  • GitHub Check: CI / Build (STM32H735)
  • GitHub Check: CI / Build (STM32F405)
  • GitHub Check: CI / Build (STM32F7X2)
  • GitHub Check: CI / Build (STM32H723)
  • GitHub Check: CI / Build (APM32F407)
  • GitHub Check: CI / Build (STM32H725)
  • GitHub Check: CI / Build (STM32H743)
  • GitHub Check: CI / Build (STM32F745)
  • GitHub Check: CI / Build (STM32H730)
  • GitHub Check: CI / Build (STM32F446)
  • GitHub Check: CI / Build (RP2350B)

@Quick-Flash
Copy link
Contributor

Good work. Just as a note, GPS velocities reported by GPS tend to be more accurate than the global position reported by GPS, so this will be quite worth while to implement into any of our GPS related code.

@demvlad
Copy link
Contributor Author

demvlad commented Nov 12, 2025

so this will be quite worth while to implement into any of our GPS related code.

@Quick-Flash
Thank you for review.
Yes, this is interested for using in alt hold or pos hold modes for example. Will it be better or not.
The UBLOX NAV-PVT message has mm/sec units, but I round it to cm/sec til.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 48c27df and 48ed018.

📒 Files selected for processing (1)
  • src/main/telemetry/mavlink.c (3 hunks)
🧰 Additional context used
🧠 Learnings (10)
📓 Common learnings
Learnt from: ledvinap
Repo: betaflight/betaflight PR: 14578
File: src/main/telemetry/jetiexbus.c:547-556
Timestamp: 2025-08-12T18:26:17.016Z
Learning: For Betaflight Jeti ExBus backport PR #14578: ledvinap prefers to keep the PR focused on backporting fixes from iNavFlight rather than expanding into broader architectural improvements. Additional improvements to TX/RX state machine should be handled in separate PRs.
📚 Learning: 2025-08-24T19:16:35.413Z
Learnt from: haslinghuis
Repo: betaflight/betaflight PR: 14620
File: src/main/telemetry/motor_sensor.c:0-0
Timestamp: 2025-08-24T19:16:35.413Z
Learning: In src/main/telemetry/motor_sensor.c DSHOT path, voltage, consumption, and dataAge fields are intentionally left uninitialized since they are not currently used by consumers. Initialization of these fields should be deferred to a separate PR when they become needed.

Applied to files:

  • src/main/telemetry/mavlink.c
📚 Learning: 2025-09-30T20:29:28.877Z
Learnt from: haslinghuis
Repo: betaflight/betaflight PR: 14683
File: src/main/cli/cli.c:5011-5014
Timestamp: 2025-09-30T20:29:28.877Z
Learning: In src/main/fc/rc_controls.h, the rcSmoothingFilter_t struct fields setpointCutoffFrequency and throttleCutoffFrequency are uint16_t types, not float. They should be printed directly without lrintf() conversion in CLI output.

Applied to files:

  • src/main/telemetry/mavlink.c
📚 Learning: 2025-10-26T08:47:16.557Z
Learnt from: demvlad
Repo: betaflight/betaflight PR: 0
File: :0-0
Timestamp: 2025-10-26T08:47:16.557Z
Learning: In Betaflight MAVLink telemetry (src/main/telemetry/mavlink.c), DEBUG fields are used as follows: DEBUG[0] indicates whether telemetry should transmit (actual free TX buffer space > mavlink_min_txbuffer), DEBUG[1] shows actual free TX buffer space, and DEBUG[2] through DEBUG[7] are data transmit counters used to determine actual stream data rates.

Applied to files:

  • src/main/telemetry/mavlink.c
📚 Learning: 2025-10-05T10:00:10.464Z
Learnt from: demvlad
Repo: betaflight/betaflight PR: 0
File: :0-0
Timestamp: 2025-10-05T10:00:10.464Z
Learning: In Betaflight MAVLink telemetry implementation (src/main/telemetry/mavlink.c), all mavlink_msg_*_pack() calls must use component ID 1 (MAV_COMP_ID_AUTOPILOT1) instead of 200 (MAV_COMP_ID_MISSIONPLANNER) for telemetry to be visible in ELRS TX modules and ground control stations like MissionPlanner. Component ID 200 is for ground station software, not flight controllers.

Applied to files:

  • src/main/telemetry/mavlink.c
📚 Learning: 2025-10-29T16:03:23.891Z
Learnt from: nerdCopter
Repo: betaflight/betaflight PR: 0
File: :0-0
Timestamp: 2025-10-29T16:03:23.891Z
Learning: In Betaflight firmware reviews, do not suggest adding DEBUG_PRINTF, logging, or diagnostic output. Betaflight follows embedded systems best practices with silent error handling using return codes and graceful fallbacks. Debug output was explicitly removed per Betaflight standards (see commit 12b2813ac in PR #14733).

Applied to files:

  • src/main/telemetry/mavlink.c
📚 Learning: 2025-09-28T08:42:08.229Z
Learnt from: demvlad
Repo: betaflight/betaflight PR: 0
File: :0-0
Timestamp: 2025-09-28T08:42:08.229Z
Learning: In Betaflight, duplicate #define statements in common_pre.h can cause the configurator to not properly detect available telemetry protocols. When USE_TELEMETRY_MAVLINK is defined multiple times, it can break the protocol registration system, causing MAVLink telemetry to disappear from the configurator's Port tab even when properly defined.

Applied to files:

  • src/main/telemetry/mavlink.c
📚 Learning: 2025-10-29T16:03:51.429Z
Learnt from: nerdCopter
Repo: betaflight/betaflight PR: 0
File: :0-0
Timestamp: 2025-10-29T16:03:51.429Z
Learning: In Betaflight embedded drivers, error handling should use silent failure with bool return values and graceful fallbacks, not DEBUG_PRINTF or console logging. DEBUG_PRINTF is inappropriate for production flight controller code due to code bloat, performance impact, and lack of console output in production hardware. The standard pattern is: return false on error, provide fallback behavior where possible, and avoid string formatting in drivers.

Applied to files:

  • src/main/telemetry/mavlink.c
📚 Learning: 2025-07-09T09:22:27.106Z
Learnt from: jianpingwu1
Repo: betaflight/betaflight PR: 14519
File: lib/main/GD32F4/Drivers/GD32F4xx_standard_peripheral/Source/gd32f4xx_can.c:110-110
Timestamp: 2025-07-09T09:22:27.106Z
Learning: In Betaflight GD32F4 firmware library integration, typos and minor issues in vendor-supplied code from GigaDevice Semiconductor are kept as-is to maintain synchronization with upstream library updates, avoiding local modifications that could complicate future library version updates.

Applied to files:

  • src/main/telemetry/mavlink.c
📚 Learning: 2025-07-06T15:59:35.310Z
Learnt from: ledvinap
Repo: betaflight/betaflight PR: 14517
File: src/main/cms/cms_menu_firmware.c:191-192
Timestamp: 2025-07-06T15:59:35.310Z
Learning: In the Betaflight codebase, the constants MAX_MANUFACTURER_ID_LENGTH and MAX_BOARD_NAME_LENGTH already include space for the null terminator, so arrays should be sized exactly to these constants without adding +1. The previous +1 additions were over-allocating by one byte.

Applied to files:

  • src/main/telemetry/mavlink.c
🧬 Code graph analysis (1)
src/main/telemetry/mavlink.c (1)
src/platform/SIMULATOR/sitl.c (1)
  • micros (443-446)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: CI / Build (SPRACINGH7RF)
  • GitHub Check: CI / Build (STM32H750)
  • GitHub Check: CI / Build (STM32H725)
  • GitHub Check: CI / Build (STM32H735)
  • GitHub Check: CI / Build (STM32H743)
  • GitHub Check: CI / Build (STM32H723)
  • GitHub Check: CI / Build (STM32H730)
  • GitHub Check: CI / Build (RP2350B)
  • GitHub Check: CI / Build (STM32F745)
  • GitHub Check: CI / Build (RP2350A)
  • GitHub Check: CI / Build (APM32F405)
  • GitHub Check: CI / Test
🔇 Additional comments (4)
src/main/telemetry/mavlink.c (4)

313-313: LGTM - Heading accuracy sentinel value is correct.

Using UINT32_MAX for unknown heading/track uncertainty is the correct approach, consistent with MAVLink's pattern for other accuracy fields. This properly signals to ground stations that heading accuracy data is unavailable, rather than falsely advertising perfect accuracy with a zero value.


332-336: LGTM - NED velocity implementation looks correct.

The NED (North-East-Down) velocity components are now populated from gpsSol.velned fields, which according to the PR objectives are converted from UBLOX NAV-PVT mm/s to cm/s units. This matches the MAVLink GLOBAL_POSITION_INT specification that expects ground speed components in m/s × 100 (cm/s). This is a valuable improvement as GPS-reported velocities are typically more accurate than derived position velocities.


349-351: LGTM - GPS origin altitude and timestamp improvements.

Replacing the placeholder zeros with actual GPS home position altitude (GPS_home_llh.altCm * 10 for mm units) and real timestamps (micros()) provides more accurate and useful data to ground stations. The unit conversions are correct per the MAVLink GPS_GLOBAL_ORIGIN specification.


304-311: GPS accuracy field units are correctly handled.

Verification confirms that gpsSol.acc.hAcc, gpsSol.acc.vAcc, and gpsSol.acc.sAcc are already in millimeter and mm/s units as expected by MAVLink:

  • Structure (gps.h): Fields are documented as mm and mm/s
  • MSP source (msp.c lines 3680-3682): Explicitly converts cm to mm with * 10
  • UBX source (gps.c lines 2257-2259): Uses u-blox native units (already mm/s)
  • Virtual GPS (gps_virtual.c lines 36-38): Hardcoded in correct units

No conversions are needed in telemetry/mavlink.c; the values are already correct.

@demvlad demvlad marked this pull request as draft November 15, 2025 05:56
@demvlad demvlad marked this pull request as ready for review November 15, 2025 07:14
@demvlad
Copy link
Contributor Author

demvlad commented Nov 15, 2025

My self made GCS sees the new GPS data by MAVLink well.

IMG_20251115_130956_673_Edited

@blckmn blckmn merged commit b1ea896 into betaflight:master Nov 19, 2025
34 checks passed
@demvlad demvlad deleted the gps_ned_velo branch November 19, 2025 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants