CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/libraries/AP_DDS/AP_DDS_Service_Table.h
Views: 1798
1
#include "uxr/client/client.h"
2
#include <AP_DDS/AP_DDS_config.h>
3
4
enum class ServiceIndex: uint8_t {
5
#if AP_DDS_ARM_SERVER_ENABLED
6
ARMING_MOTORS,
7
#endif // #if AP_DDS_ARM_SERVER_ENABLED
8
#if AP_DDS_MODE_SWITCH_SERVER_ENABLED
9
MODE_SWITCH,
10
#endif // AP_DDS_MODE_SWITCH_SERVER_ENABLED
11
#if AP_DDS_ARM_CHECK_SERVER_ENABLED
12
PREARM_CHECK,
13
#endif // AP_DDS_ARM_CHECK_SERVER_ENABLED
14
#if AP_DDS_VTOL_TAKEOFF_SERVER_ENABLED
15
TAKEOFF,
16
#endif // AP_DDS_VTOL_TAKEOFF_SERVER_ENABLED
17
#if AP_DDS_PARAMETER_SERVER_ENABLED
18
SET_PARAMETERS,
19
GET_PARAMETERS
20
#endif // AP_DDS_PARAMETER_SERVER_ENABLED
21
};
22
23
static inline constexpr uint8_t to_underlying(const ServiceIndex index)
24
{
25
static_assert(sizeof(index) == sizeof(uint8_t));
26
return static_cast<uint8_t>(index);
27
}
28
29
constexpr struct AP_DDS_Client::Service_table AP_DDS_Client::services[] = {
30
#if AP_DDS_ARM_SERVER_ENABLED
31
{
32
.req_id = to_underlying(ServiceIndex::ARMING_MOTORS),
33
.rep_id = to_underlying(ServiceIndex::ARMING_MOTORS),
34
.service_rr = Service_rr::Replier,
35
.service_name = "rs/ap/arm_motorsService",
36
.request_type = "ardupilot_msgs::srv::dds_::ArmMotors_Request_",
37
.reply_type = "ardupilot_msgs::srv::dds_::ArmMotors_Response_",
38
.request_topic_name = "rq/ap/arm_motorsRequest",
39
.reply_topic_name = "rr/ap/arm_motorsReply",
40
.qos = {
41
.durability = UXR_DURABILITY_TRANSIENT_LOCAL,
42
.reliability = UXR_RELIABILITY_RELIABLE,
43
.history = UXR_HISTORY_KEEP_LAST,
44
.depth = 5,
45
},
46
},
47
#endif // AP_DDS_ARM_SERVER_ENABLED
48
#if AP_DDS_MODE_SWITCH_SERVER_ENABLED
49
{
50
.req_id = to_underlying(ServiceIndex::MODE_SWITCH),
51
.rep_id = to_underlying(ServiceIndex::MODE_SWITCH),
52
.service_rr = Service_rr::Replier,
53
.service_name = "rs/ap/mode_switchService",
54
.request_type = "ardupilot_msgs::srv::dds_::ModeSwitch_Request_",
55
.reply_type = "ardupilot_msgs::srv::dds_::ModeSwitch_Response_",
56
.request_topic_name = "rq/ap/mode_switchRequest",
57
.reply_topic_name = "rr/ap/mode_switchReply",
58
},
59
#endif // AP_DDS_MODE_SWITCH_SERVER_ENABLED
60
#if AP_DDS_ARM_CHECK_SERVER_ENABLED
61
{
62
.req_id = to_underlying(ServiceIndex::PREARM_CHECK),
63
.rep_id = to_underlying(ServiceIndex::PREARM_CHECK),
64
.service_rr = Service_rr::Replier,
65
.service_name = "rs/ap/prearm_checkService",
66
.request_type = "std_srvs::srv::dds_::Trigger_Request_",
67
.reply_type = "std_srvs::srv::dds_::Trigger_Response_",
68
.request_topic_name = "rq/ap/prearm_checkRequest",
69
.reply_topic_name = "rr/ap/prearm_checkReply",
70
},
71
#endif // AP_DDS_ARM_CHECK_SERVER_ENABLED
72
#if AP_DDS_VTOL_TAKEOFF_SERVER_ENABLED
73
{
74
.req_id = to_underlying(ServiceIndex::TAKEOFF),
75
.rep_id = to_underlying(ServiceIndex::TAKEOFF),
76
.service_rr = Service_rr::Replier,
77
.service_name = "rs/ap/experimental/takeoffService",
78
.request_type = "ardupilot_msgs::srv::dds_::Takeoff_Request_",
79
.reply_type = "ardupilot_msgs::srv::dds_::Takeoff_Response_",
80
.request_topic_name = "rq/ap/experimental/takeoffRequest",
81
.reply_topic_name = "rr/ap/experimental/takeoffReply",
82
},
83
#endif // AP_DDS_VTOL_TAKEOFF_SERVER_ENABLED
84
#if AP_DDS_PARAMETER_SERVER_ENABLED
85
{
86
.req_id = to_underlying(ServiceIndex::SET_PARAMETERS),
87
.rep_id = to_underlying(ServiceIndex::SET_PARAMETERS),
88
.service_rr = Service_rr::Replier,
89
.service_name = "rs/ap/set_parametersService",
90
.request_type = "rcl_interfaces::srv::dds_::SetParameters_Request_",
91
.reply_type = "rcl_interfaces::srv::dds_::SetParameters_Response_",
92
.request_topic_name = "rq/ap/set_parametersRequest",
93
.reply_topic_name = "rr/ap/set_parametersReply",
94
},
95
{
96
.req_id = to_underlying(ServiceIndex::GET_PARAMETERS),
97
.rep_id = to_underlying(ServiceIndex::GET_PARAMETERS),
98
.service_rr = Service_rr::Replier,
99
.service_name = "rs/ap/get_parameterService",
100
.request_type = "rcl_interfaces::srv::dds_::GetParameters_Request_",
101
.reply_type = "rcl_interfaces::srv::dds_::GetParameters_Response_",
102
.request_topic_name = "rq/ap/get_parametersRequest",
103
.reply_topic_name = "rr/ap/get_parametersReply",
104
},
105
#endif // AP_DDS_PARAMETER_SERVER_ENABLED
106
};
107
108