-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcall_get_specs.py
More file actions
43 lines (30 loc) · 918 Bytes
/
call_get_specs.py
File metadata and controls
43 lines (30 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
''' test call cap services '''
import rclpy
from capabilities2_msgs.srv import GetCapabilitySpecs
def test_get_capability_specs_srv(n):
# get cap specs
client = n.create_client(
GetCapabilitySpecs,
'/capabilities/get_capability_specs'
)
# wait for service
client.wait_for_service()
# send request
request = GetCapabilitySpecs.Request()
future = client.call_async(request)
rclpy.spin_until_future_complete(n, future)
# print result
for s in future.result().capability_specs:
print(s.package + '-' + s.type)
print(s.content)
# main
if __name__ == '__main__':
rclpy.init()
node = rclpy.create_node('test_call_cap_srvs')
# do tests
# test_get_interfaces_srv(node)
# test_get_semantic_interfaces_srv(node)
# test_get_providers_srv(node)
test_get_capability_specs_srv(node)
rclpy.shutdown()
exit(0)