Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_DDS: Make GPS DDS features depend on GPS #28341

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ryanf55
Copy link
Collaborator

@Ryanf55 Ryanf55 commented Oct 8, 2024

Purpose

Make the DDS features that depend on GPS rely on AP_GPS_ENABLED.

Details

Follow up to #28177 where we hard-coded navsatfix enable flag to 1.
If you disabled GPS on master now and enabled DDS, you would get a compile error,

@Ryanf55 Ryanf55 marked this pull request as draft October 8, 2024 00:45
@peterbarker
Copy link
Contributor

... this one definitely needs to compile :-)

Not really sure what you're doing with that "NEEDS" variable, either...

@Ryanf55 Ryanf55 force-pushed the dds-dependent-ifdefs-gps branch from 72d29f2 to f2c0478 Compare November 19, 2024 19:37
@Ryanf55 Ryanf55 marked this pull request as ready for review November 19, 2024 19:38
@Ryanf55
Copy link
Collaborator Author

Ryanf55 commented Nov 19, 2024

... this one definitely needs to compile :-)

Not really sure what you're doing with that "NEEDS" variable, either...

NEEDS are a convenience to only have a single define to decide whether a header is needed.

Could also call it AP_DDS_HAS_GPS if that helps make it clearer.

Before:

#if AP_DDS_NAVSATFIX_PUB_ENABLED || AP_DDS_STATIC_TF_PUB_ENABLED // And potentially more!
#include <AP_GPS/AP_GPS.h>
#endif

After:

#if AP_DDS_NEEDS_GPS
#include <AP_GPS/AP_GPS.h>
#endif

This pattern could be adopted in all the places we have:

#if AP_SCRIPTING_ENABLED || AP_EXTERNAL_CONTROL_ENABLED

libraries/AP_DDS/AP_DDS_Client.cpp Outdated Show resolved Hide resolved
* Only allow DDS to share GPS data if you have GPS supported
* Fix missing visualodom include

Signed-off-by: Ryan Friedman <[email protected]>
@Ryanf55 Ryanf55 force-pushed the dds-dependent-ifdefs-gps branch from b57bb3a to 2f8a758 Compare January 6, 2025 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants