From 3c79eae8731b9b9b3f7f162498e3e86741582c17 Mon Sep 17 00:00:00 2001 From: Rhys Mainwaring Date: Tue, 4 Jun 2024 18:22:20 +0100 Subject: [PATCH] AP_DDS: add param DDS_DOMAIN_ID - Require reboot. - Set DDS_DOMAIN_ID range: 0 to 232.. Signed-off-by: Rhys Mainwaring --- libraries/AP_DDS/AP_DDS_Client.cpp | 11 ++++++++++- libraries/AP_DDS/AP_DDS_Client.h | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/libraries/AP_DDS/AP_DDS_Client.cpp b/libraries/AP_DDS/AP_DDS_Client.cpp index 3daa69f6b8..16289b3309 100644 --- a/libraries/AP_DDS/AP_DDS_Client.cpp +++ b/libraries/AP_DDS/AP_DDS_Client.cpp @@ -72,6 +72,14 @@ const AP_Param::GroupInfo AP_DDS_Client::var_info[] { #endif + // @Param: _DOMAIN_ID + // @DisplayName: DDS DOMAIN ID + // @Description: Set the ROS_DOMAIN_ID + // @Range: 0 232 + // @RebootRequired: True + // @User: Standard + AP_GROUPINFO("_DOMAIN_ID", 4, AP_DDS_Client, domain_id, 0), + AP_GROUPEND }; @@ -743,7 +751,8 @@ bool AP_DDS_Client::create() .type = UXR_PARTICIPANT_ID }; const char* participant_ref = "participant_profile"; - const auto participant_req_id = uxr_buffer_create_participant_ref(&session, reliable_out, participant_id,0,participant_ref,UXR_REPLACE); + const auto participant_req_id = uxr_buffer_create_participant_ref(&session, reliable_out, participant_id, + static_cast(domain_id), participant_ref, UXR_REPLACE); //Participant requests constexpr uint8_t nRequestsParticipant = 1; diff --git a/libraries/AP_DDS/AP_DDS_Client.h b/libraries/AP_DDS/AP_DDS_Client.h index 18dcadfc9f..27d103ca73 100644 --- a/libraries/AP_DDS/AP_DDS_Client.h +++ b/libraries/AP_DDS/AP_DDS_Client.h @@ -198,6 +198,9 @@ public: //! @brief Parameter storage static const struct AP_Param::GroupInfo var_info[]; + //! @brief ROS_DOMAIN_ID + AP_Int32 domain_id; + //! @brief Convenience grouping for a single "channel" of data struct Topic_table { const uint8_t topic_id;