Utilities
- rclpy.utilities.get_available_rmw_implementations()
Return the set of all available RMW implementations as registered in the ament index.
The result can be overridden by setting an environment variable named
RMW_IMPLEMENTATIONS
. The variable can contain RMW implementation names separated by the platform specific path separator. Including an unavailable RMW implementation results in a RuntimeError.
- rclpy.utilities.get_default_context(*, shutting_down=False)
Return the global default context singleton.
- rclpy.utilities.get_rmw_implementation_identifier()
- rclpy.utilities.ok(*, context=None)
- rclpy.utilities.remove_ros_args(args=None)
- rclpy.utilities.shutdown(*, context=None)
- rclpy.utilities.timeout_sec_to_nsec(timeout_sec)
Convert timeout in seconds to rcl compatible timeout in nanoseconds.
Python tends to use floating point numbers in seconds for timeouts. This utility converts a python-style timeout to an integer in nanoseconds that can be used by rcl_wait.
- Parameters:
timeout_sec (float or None) – Seconds to wait. Block forever if None or negative. Don’t wait if < 1ns
- Return type:
int
- Returns:
rcl_wait compatible timeout in nanoseconds
- rclpy.utilities.try_shutdown(*, context=None)
Shutdown rclpy if not already shutdown.