Skip to content

Commit

Permalink
AP_DDS: Make GPS DDS features depend on GPS
Browse files Browse the repository at this point in the history
* Only allow DDS to share GPS data if you have GPS supported
* Fix missing visualodom include

Signed-off-by: Ryan Friedman <[email protected]>
  • Loading branch information
Ryanf55 committed Nov 19, 2024
1 parent 79b596d commit f2c0478
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions libraries/AP_DDS/AP_DDS_Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
#include "AP_DDS_config.h"
#if AP_DDS_ENABLED
#include <uxr/client/util/ping.h>
#include <AP_GPS/AP_GPS_config.h>

#if AP_DDS_NEEDS_GPS
#include <AP_GPS/AP_GPS.h>
#endif // AP_DDS_NEEDS_GPS
#include <AP_HAL/AP_HAL.h>
#include <RC_Channel/RC_Channel.h>
#include <AP_RTC/AP_RTC.h>
Expand Down
9 changes: 7 additions & 2 deletions libraries/AP_DDS/AP_DDS_config.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#pragma once

#include <AP_GPS/AP_GPS_config.h>
#include <AP_HAL/AP_HAL_Boards.h>
#include <AP_Networking/AP_Networking_Config.h>
#include <AP_VisualOdom/AP_VisualOdom_config.h>

#ifndef AP_DDS_ENABLED
#define AP_DDS_ENABLED 1
Expand Down Expand Up @@ -39,11 +41,11 @@
#endif

#ifndef AP_DDS_NAVSATFIX_PUB_ENABLED
#define AP_DDS_NAVSATFIX_PUB_ENABLED 1
#define AP_DDS_NAVSATFIX_PUB_ENABLED AP_GPS_ENABLED
#endif

#ifndef AP_DDS_STATIC_TF_PUB_ENABLED
#define AP_DDS_STATIC_TF_PUB_ENABLED 1
#define AP_DDS_STATIC_TF_PUB_ENABLED AP_GPS_ENABLED
#endif

#ifndef AP_DDS_GPS_GLOBAL_ORIGIN_PUB_ENABLED
Expand Down Expand Up @@ -144,6 +146,9 @@
// Whether to include Transform support
#define AP_DDS_NEEDS_TRANSFORMS AP_DDS_DYNAMIC_TF_SUB_ENABLED || AP_DDS_STATIC_TF_PUB_ENABLED

// Whether DDS needs GPS
#define AP_DDS_NEEDS_GPS AP_DDS_NAVSATFIX_PUB_ENABLED || AP_DDS_STATIC_TF_PUB_ENABLED

#ifndef AP_DDS_DEFAULT_UDP_IP_ADDR
#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS
#define AP_DDS_DEFAULT_UDP_IP_ADDR "192.168.13.2"
Expand Down

0 comments on commit f2c0478

Please sign in to comment.