-
Notifications
You must be signed in to change notification settings - Fork 16.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AP_DDS: Added ROS 2 service support [skip ci]
- Loading branch information
1 parent
71907fb
commit 6542c3d
Showing
6 changed files
with
225 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include "uxr/client/client.h" | ||
|
||
enum class ServiceIndex: uint8_t { | ||
ARMING_MOTORS | ||
}; | ||
|
||
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), | ||
.srv_profile_label = "ArmMotorsService", | ||
.req_profile_label = "", | ||
.rep_profile_label = "ArmMotors_Replier", | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
types: | ||
idls: | ||
- > | ||
struct ArmMotors_Request | ||
{ | ||
boolean arm; | ||
}; | ||
struct ArmMotors_Response | ||
{ | ||
boolean result; | ||
}; | ||
systems: | ||
dds: { type: fastdds } | ||
ros2: { type: ros2 } | ||
|
||
routes: | ||
dds_server: | ||
server: dds | ||
clients: ros2 | ||
|
||
services: | ||
arm_motors: { | ||
request_type: ArmMotors_Request, | ||
reply_type: ArmMotors_Response, | ||
route: dds_server, | ||
remap: { | ||
dds: { | ||
topic: ArmMotorsService, | ||
}, | ||
ros2: { | ||
request_type: "ap_custom_services/ArmMotors:request", | ||
reply_type: "ap_custom_services/ArmMotors:response" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters