Skip to content

Commit

Permalink
AP_DDS: add param DDS_DOMAIN_ID
Browse files Browse the repository at this point in the history
- Require reboot.
- Set DDS_DOMAIN_ID range: 0 to 232..

Signed-off-by: Rhys Mainwaring <[email protected]>
  • Loading branch information
srmainwaring authored and Ryanf55 committed Aug 24, 2024
1 parent 69ef3bb commit 371a6f8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
13 changes: 11 additions & 2 deletions libraries/AP_DDS/AP_DDS_Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down Expand Up @@ -742,8 +750,9 @@ bool AP_DDS_Client::create()
.id = 0x01,
.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 char* participant_name = "ardupilot_dds";
const auto participant_req_id = uxr_buffer_create_participant_bin(&session, reliable_out, participant_id,
static_cast<uint16_t>(domain_id), participant_name, UXR_REPLACE);

//Participant requests
constexpr uint8_t nRequestsParticipant = 1;
Expand Down
3 changes: 3 additions & 0 deletions libraries/AP_DDS/AP_DDS_Client.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ class AP_DDS_Client
//! @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;
Expand Down

0 comments on commit 371a6f8

Please sign in to comment.