Skip to content

AP_GPS: Fix DNU constant values in AP_GPS_SBF.cpp#32642

Merged
peterbarker merged 1 commit into
ArduPilot:masterfrom
UAVcihang:patch-2
Apr 15, 2026
Merged

AP_GPS: Fix DNU constant values in AP_GPS_SBF.cpp#32642
peterbarker merged 1 commit into
ArduPilot:masterfrom
UAVcihang:patch-2

Conversation

@UAVcihang
Copy link
Copy Markdown
Contributor

@UAVcihang
Copy link
Copy Markdown
Contributor Author

UAVcihang commented Apr 1, 2026

@rmackay9
Copy link
Copy Markdown
Contributor

rmackay9 commented Apr 1, 2026

Hi @UAVcihang,

Thanks for this. Could you fix the commit title to start with "AP_GPS:"? Also it appears that you didn't use the PR template for some reason. In any case, can you clarify what testing has been done?

@rmackay9 rmackay9 mentioned this pull request Apr 1, 2026
72 tasks
@UAVcihang
Copy link
Copy Markdown
Contributor Author

Hi @UAVcihang,

Thanks for this. Could you fix the commit title to start with "AP_GPS:"? Also it appears that you didn't use the PR template for some reason. In any case, can you clarify what testing has been done?

yes

Comment thread libraries/AP_GPS/AP_GPS_SBF.cpp Outdated
static bool is_DNU(double value)
{
constexpr double DNU = -2e10f;
constexpr double DNU = -2e+10f;
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.

What does this accomplish?

Comment thread libraries/AP_GPS/AP_GPS_SBF.cpp Outdated
check_new_itow(temp.TOW, sbf_msg.length);

constexpr double floatDNU = -2e-10f;
constexpr double floatDNU = -2e+10f;
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.

use is_DNU

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.

We could also probably profit to drop the 'f' qualifier since we are using true double.

Comment thread libraries/AP_GPS/AP_GPS_SBF.cpp Outdated

// just breakout any consts we need for Do Not Use (DNU) reasons
constexpr double doubleDNU = -2e-10;
constexpr double doubleDNU = -2e+10;
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.

Use is_DNU

@peterbarker
Copy link
Copy Markdown
Contributor

@UAVcihang rapid iteration here would be appreciated; we should get this into the next 4.7 beta

@CraigElder CraigElder changed the title Fix DNU constant values in AP_GPS_SBF.cpp AP_GPS: Fix DNU constant values in AP_GPS_SBF.cpp Apr 14, 2026
@tridge
Copy link
Copy Markdown
Contributor

tridge commented Apr 14, 2026

change is correct
image

@peterbarker peterbarker force-pushed the patch-2 branch 2 times, most recently from 676dc5e to 56721dc Compare April 14, 2026 00:17
@peterbarker
Copy link
Copy Markdown
Contributor

@UAVcihang thanks for this!

We've gone ahead and made changes live on devcall for this one :-)

Marking for merge

@peterbarker peterbarker merged commit fe11e77 into ArduPilot:master Apr 15, 2026
109 checks passed
@peterbarker
Copy link
Copy Markdown
Contributor

We've merged this one - thanks @UAVcihang

@Georacer Georacer moved this from Pending to 4.7.0-beta4 in 4.7 Backports Apr 28, 2026
@Georacer Georacer mentioned this pull request Apr 30, 2026
9 tasks
@Georacer
Copy link
Copy Markdown
Contributor

This has been included in 4.7.0-beta4. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 4.7.0-beta4

Development

Successfully merging this pull request may close these issues.

7 participants