Skip to content

Commit cf2714e

Browse files
Ryanf55peterbarker
authored andcommitted
AP_DDS: Make GPS DDS features depend on GPS
* Only allow DDS to share GPS data if you have GPS supported * Fix missing visualodom include Signed-off-by: Ryan Friedman <[email protected]>
1 parent 63642b7 commit cf2714e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

libraries/AP_DDS/AP_DDS_Client.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
#if AP_DDS_ENABLED
55
#include <uxr/client/util/ping.h>
66

7+
#if AP_DDS_NEEDS_GPS
78
#include <AP_GPS/AP_GPS.h>
9+
#endif // AP_DDS_NEEDS_GPS
810
#include <AP_HAL/AP_HAL.h>
911
#include <RC_Channel/RC_Channel.h>
1012
#include <AP_RTC/AP_RTC.h>

libraries/AP_DDS/AP_DDS_config.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#pragma once
22

3+
#include <AP_GPS/AP_GPS_config.h>
34
#include <AP_HAL/AP_HAL_Boards.h>
45
#include <AP_Networking/AP_Networking_Config.h>
6+
#include <AP_VisualOdom/AP_VisualOdom_config.h>
57

68
#ifndef AP_DDS_ENABLED
79
#define AP_DDS_ENABLED 1
@@ -39,11 +41,11 @@
3941
#endif
4042

4143
#ifndef AP_DDS_NAVSATFIX_PUB_ENABLED
42-
#define AP_DDS_NAVSATFIX_PUB_ENABLED 1
44+
#define AP_DDS_NAVSATFIX_PUB_ENABLED AP_GPS_ENABLED
4345
#endif
4446

4547
#ifndef AP_DDS_STATIC_TF_PUB_ENABLED
46-
#define AP_DDS_STATIC_TF_PUB_ENABLED 1
48+
#define AP_DDS_STATIC_TF_PUB_ENABLED AP_GPS_ENABLED
4749
#endif
4850

4951
#ifndef AP_DDS_GPS_GLOBAL_ORIGIN_PUB_ENABLED
@@ -167,6 +169,9 @@
167169
// Whether to include Transform support
168170
#define AP_DDS_NEEDS_TRANSFORMS AP_DDS_DYNAMIC_TF_SUB_ENABLED || AP_DDS_STATIC_TF_PUB_ENABLED
169171

172+
// Whether DDS needs GPS
173+
#define AP_DDS_NEEDS_GPS AP_DDS_NAVSATFIX_PUB_ENABLED || AP_DDS_STATIC_TF_PUB_ENABLED
174+
170175
#ifndef AP_DDS_DEFAULT_UDP_IP_ADDR
171176
#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS
172177
#define AP_DDS_DEFAULT_UDP_IP_ADDR "192.168.144.2"

0 commit comments

Comments
 (0)