ardupilot/libraries/AP_DDS/AP_DDS_Service_Table.h
Rhys Mainwaring c71ef23657 AP_DDS: create entities by binary
- Add topic name and type to topic table.
- Use binary creation functions for participants and topics.
- Add constant for domain ID.
- Create publishers and datawriters by binary
- Create subscribers, datareaders and services by binary
- Add extra fields to the services table.
- Remove dds_xrce_profile.xml
- Document additional service table fields
- Add QoS struct to topic and service tables
- Replace profile labels with enums.

Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
2024-05-29 17:47:52 +10:00

42 lines
1.5 KiB
C++

#include "uxr/client/client.h"
enum class ServiceIndex: uint8_t {
ARMING_MOTORS,
MODE_SWITCH
};
static inline constexpr uint8_t to_underlying(const ServiceIndex index)
{
static_assert(sizeof(index) == sizeof(uint8_t));
return static_cast<uint8_t>(index);
}
constexpr struct AP_DDS_Client::Service_table AP_DDS_Client::services[] = {
{
.req_id = to_underlying(ServiceIndex::ARMING_MOTORS),
.rep_id = to_underlying(ServiceIndex::ARMING_MOTORS),
.service_rr = Service_rr::Replier,
.service_name = "rs/ap/arm_motorsService",
.request_type = "ardupilot_msgs::srv::dds_::ArmMotors_Request_",
.reply_type = "ardupilot_msgs::srv::dds_::ArmMotors_Response_",
.request_topic_name = "rq/ap/arm_motorsRequest",
.reply_topic_name = "rr/ap/arm_motorsReply",
.qos = {
.durability = UXR_DURABILITY_TRANSIENT_LOCAL,
.reliability = UXR_RELIABILITY_RELIABLE,
.history = UXR_HISTORY_KEEP_LAST,
.depth = 5,
},
},
{
.req_id = to_underlying(ServiceIndex::MODE_SWITCH),
.rep_id = to_underlying(ServiceIndex::MODE_SWITCH),
.service_rr = Service_rr::Replier,
.service_name = "rs/ap/mode_switchService",
.request_type = "ardupilot_msgs::srv::dds_::ModeSwitch_Request_",
.reply_type = "ardupilot_msgs::srv::dds_::ModeSwitch_Response_",
.request_topic_name = "rq/ap/mode_switchRequest",
.reply_topic_name = "rr/ap/mode_switchReply",
},
};