Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_DDS: add param DDS_DOMAIN_ID #27258

Merged
merged 1 commit into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -816,9 +824,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
Loading