controller_manager.test_utils module

controller_manager.test_utils.check_controllers_running(node, cnames, namespace='', state='active', timeout=10.0)

Check if the specified controllers are running on the given node.

Args:

node (Node): The ROS 2 node instance to use for discovering controllers. cnames (list of str): List of controller names to check. namespace (str, optional): The namespace in which to look for controllers. Defaults to “”. state (str, optional): The desired state of the controllers. Defaults to “active”. timeout (float, optional): The maximum time to wait for the node to appear, in seconds. Defaults to 10.0.

Raises:

AssertionError: If any of the specified controllers are not found or not in the desired state within the timeout period.

controller_manager.test_utils.check_if_js_published(topic, joint_names)

Check if a JointState message is published on a given topic with the expected joint names.

Args:

topic (str): The name of the topic to check. joint_names (list of str): The expected joint names in the JointState message.

Raises:
AssertionError: If the topic is not found, the number of joints in the message is incorrect,

or the joint names do not match the expected names.

controller_manager.test_utils.check_node_running(node, node_name, timeout=5.0)

Checks if a node with the specified name is running within a given timeout.

Args:

node (Node): The ROS 2 node instance to use for discovering nodes. node_name (str): The name of the node to check for. timeout (float, optional): The maximum time to wait for the node to appear, in seconds. Defaults to 5.0.

Raises:

AssertionError: If the node with the specified name is not found within the timeout period.