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 peterbarker committed Jul 20, 2024
1 parent 8674bb8 commit 5919ef6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 9 additions & 2 deletions libraries/AP_DDS/AP_DDS_Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,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 @@ -819,9 +827,8 @@ bool AP_DDS_Client::create()
.type = UXR_PARTICIPANT_ID
};
const char* participant_name = "ardupilot_dds";
const uint16_t domain_id = 0;
const auto participant_req_id = uxr_buffer_create_participant_bin(&session, reliable_out, participant_id,
domain_id, participant_name, UXR_REPLACE);
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 @@ -213,6 +213,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 Enum used to mark a topic as a data reader or writer
enum class Topic_rw : uint8_t {
DataReader = 0,
Expand Down

0 comments on commit 5919ef6

Please sign in to comment.