Skip to content

Commit 2b04110

Browse files
authored
Included get_available_rmw_implementations (#517)
Signed-off-by: ahcorde <[email protected]>
1 parent 9b70fcb commit 2b04110

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rclpy/rclpy/utilities.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
from rclpy.constants import S_TO_NS
1919
from rclpy.context import Context
2020

21+
import ament_index_python
22+
2123
g_default_context = None
2224
g_context_lock = threading.Lock()
2325

@@ -68,6 +70,12 @@ def get_rmw_implementation_identifier():
6870
return rclpy_implementation.rclpy_get_rmw_implementation_identifier()
6971

7072

73+
def get_available_rmw_implementations():
74+
"""Return the set of all available RMW implementations as registered in the ament index."""
75+
rmw_implementations = ament_index_python.get_resources('rmw_typesupport')
76+
return {name for name in rmw_implementations if name != 'rmw_implementation'}
77+
78+
7179
def timeout_sec_to_nsec(timeout_sec):
7280
"""
7381
Convert timeout in seconds to rcl compatible timeout in nanoseconds.

0 commit comments

Comments
 (0)