ros2cli.helpers module

ros2cli.helpers.before_invocation(func, hook)

Invoke a hook before every func invocation.

hook may take no arguments or take the func and arbitrary positional and keyword arguments.

ros2cli.helpers.bind(func, *args, **kwargs)

Bind a function with a set of arguments.

A functools.partial equivalent that is actually a function.

ros2cli.helpers.get_ros_domain_id()
ros2cli.helpers.pretty_print_call(func, *args, **kwargs)

Print a function invocation.

See before_invocation for usage as a hook.

ros2cli.helpers.wait_for(predicate, timeout, period=0.1)

Wait for a predicate to evaluate to True.

Parameters:
  • timeout – duration, in seconds, to wait for the predicate to evaluate to True. Non-positive durations will result in an indefinite wait.

  • period – predicate evaluation period, in seconds.

Returns:

predicate result