Skip to content

Add support for MAV_CMD_DO_SET_GLOBAL_ORIGIN (replaces SET_GPS_GLOBAL…#14566

Merged
HTRamsey merged 4 commits into
mavlink:masterfrom
peterbarker:pr/MAV_CMD_DO_SET_GLOBAL_ORIGIN
Jul 3, 2026
Merged

Add support for MAV_CMD_DO_SET_GLOBAL_ORIGIN (replaces SET_GPS_GLOBAL…#14566
HTRamsey merged 4 commits into
mavlink:masterfrom
peterbarker:pr/MAV_CMD_DO_SET_GLOBAL_ORIGIN

Conversation

@peterbarker

Copy link
Copy Markdown
Contributor

…_ORIGIN msg)

tries the command and falls back to the message using the existing methods for this sort of thing

Description

QGC only supports the deprecated message equivalent of this command

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/Build changes
  • Other

Testing

  • Tested locally
  • Added/updated unit tests
  • Tested with simulator (SITL)
  • Tested with hardware

I used ArduPilot on a CUAVv5 . With modern ArduPilot the command succeeds. With modern ArduPiulot with MAV_CMD_DO_SET_GLOBAL_ORIGIN hacked out it correctly falls back to using the message.

Platforms Tested

  • Linux
  • Windows
  • macOS
  • Android
  • iOS

Flight Stacks Tested

  • PX4
  • ArduPilot

Screenshots

image

Checklist

  • I have read the Contribution Guidelines
  • I have read the Code of Conduct
  • My code follows the project's coding standards
  • I have added tests that prove my fix/feature works
  • New and existing unit tests pass locally

Related Issues

n/a


By submitting this pull request, I confirm that my contribution is made under the terms of the project's dual license (Apache 2.0 and GPL v3).

…_ORIGIN msg)

tries the command and falls back to the message using the existing methods for this sort of thing
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.90476% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 30.57%. Comparing base (f29efd3) to head (42623fa).
⚠️ Report is 114 commits behind head on master.

Files with missing lines Patch % Lines
src/Vehicle/MavCommandQueue.cc 30.76% 5 Missing and 4 partials ⚠️
src/Comms/MockLink/MockLink.cc 78.94% 0 Missing and 4 partials ⚠️
src/Vehicle/Vehicle.cc 70.00% 0 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14566      +/-   ##
==========================================
+ Coverage   25.47%   30.57%   +5.10%     
==========================================
  Files         769      787      +18     
  Lines       65912    67499    +1587     
  Branches    30495    31271     +776     
==========================================
+ Hits        16788    20639    +3851     
+ Misses      37285    32936    -4349     
- Partials    11839    13924    +2085     
Flag Coverage Δ
unittests 30.57% <61.90%> (+5.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/Comms/MockLink/MockLink.h 65.78% <ø> (-3.66%) ⬇️
src/Vehicle/MavCommandQueue.h 100.00% <ø> (ø)
src/Vehicle/Vehicle.h 68.75% <ø> (+28.12%) ⬆️
src/Vehicle/Vehicle.cc 28.43% <70.00%> (+7.03%) ⬆️
src/Comms/MockLink/MockLink.cc 55.69% <78.94%> (+4.81%) ⬆️
src/Vehicle/MavCommandQueue.cc 55.29% <30.76%> (+12.88%) ⬆️

... and 402 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 27065dc...42623fa. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hamishwillee hamishwillee left a comment

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.

FYI reviewer, I don't know if the code is good, but this feature is desirable. An implementation will be going into PX4 soon PX4/PX4-Autopilot#24697

Note that for PX4 at least, fixes are going in that will NAK this command if param1,2,3,4 are not sent as NaN. We don't yet enforce that or that the values of param 5,6,7 must be set to valid values (i.e. a NaN for param7) can't be handled sensibly.

Note, the command is currently in develoment.xml.

@peterbarker

peterbarker commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

(I'm not ignoring the request for code coverage testing, I'm just working through the process here)

❯ [2048/2049] Linking CXX executable Debug/QGroundControl                                                                                     
  vagrant@ubuntu:~$ cd shadow-build                                                                                                           
  vagrant@ubuntu:~/shadow-build$ ctest -N | grep SetEstimatorOrigin                                                                           
    Test #191: SetEstimatorOriginTest                                                                                                         
  vagrant@ubuntu:~/shadow-build$ ctest -R SetEstimatorOriginTest --output-on-failure                                                          
  Test project /home/vagrant/shadow-build                                                                                                     
      Start 191: SetEstimatorOriginTest                                                                                                       
  1/1 Test #191: SetEstimatorOriginTest ...........   Passed    1.57 sec                                                                      
                                                                                                                                              
  100% tests passed, 0 tests failed out of 1                                                                                                  
                                                                                                                                              
  Label Time Summary:                                                                                                                         
  Integration    =   1.57 sec*proc (1 test)                                                                                                   
  Vehicle        =   1.57 sec*proc (1 test)                                                                                                   
                                                                                                                                              
  Total Test time (real) =   1.58 sec                                                                                                         
  vagrant@ubuntu:~/shadow-build$                                                                                                              

Aside: Running ctest -L "Integration|Vehicle" --output-on-failure failed locally because of network failures; consider local delivery of terrain tiles?

@peterbarker
peterbarker requested a review from HTRamsey as a code owner June 29, 2026 05:53
@HTRamsey
HTRamsey merged commit c239bca into mavlink:master Jul 3, 2026
44 checks passed
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.

3 participants