/module_manager_node/list_virtual_groupsΒΆ

Caution

This documentation page has been auto-generated.

It may be missing some details.

/module_manager_node/list_virtual_groups Quick Facts

Category

πŸ›  Robot management

Message type

pal_module_srvs/srv/ListVirtualGroups

Lists all the virtual groups. For each group the contained list of modules is reported.

See The startup process of the robot and application management.

Quick snippetsΒΆ

Call the service from command-lineΒΆ
$ ros2 service call /module_manager_node/list_virtual_groups pal_module_srvs/srv/ListVirtualGroups
# (tip: press Tab to complete the message prototype)

How to use in your codeΒΆ

Example of a complete ROS2 node asynchronously calling the serviceΒΆ
 1#!/usr/bin/env python
 2
 3import sys
 4import rclpy
 5from rclpy.node import Node
 6
 7from pal_module_srvs.srv import ListVirtualGroups
 8
 9class ListVirtualGroupsClientAsync(Node):
10
11    def __init__(self):
12        super().__init__('module_manager_node_list_virtual_groups_client_async')
13        self.cli = self.create_client(ListVirtualGroups, 'module_manager_node_list_virtual_groups')
14        while not self.cli.wait_for_service(timeout_sec=1.0):
15            self.get_logger().info('service not available, waiting again...')
16        self.req = ListVirtualGroups.Request()
17
18    def send_request(self, a, b):
19        # TODO: adapt to the service's parameters
20        # self.req.a = a
21        # self.req.b = b
22        self.future = self.cli.call_async(self.req)
23        rclpy.spin_until_future_complete(self, self.future)
24        return self.future.result()
25
26
27if __name__ == '__main__':
28    rclpy.init(args=args)
29
30    srv_client = ListVirtualGroupsClientAsync()
31
32    # TODO: adapt to your parameters
33    response = srv_client.send_request(sys.argv[1], sys.argv[2])
34    srv_client.get_logger().info(
35        'Result of module_manager_node_list_virtual_groups: %s' % response)
36
37    rclpy.shutdown()