Assert the live ROS graph topology visible from the scenario node.
Verify nodes, topics, publishers, subscribers, services, actions, and their
providers with the expect_* and refute_* assertions. Use the eventually_*
helpers when entities may appear asynchronously.
Summary
Functions
Wait (event-driven) until an action server for action_name appears.
Wait (event-driven) until a node named name appears in the ROS graph.
Wait (event-driven) until service_name appears in the ROS graph.
Wait (event-driven) until topic_name appears in the ROS graph.
Assert that an action server for action_name exists in the ROS graph.
Assert that node_name provides action_name.
Assert that a node named name (in namespace, default /) exists.
Assert that node_name provides all actions in action_list.
Assert that node_name publishes on all topics in topic_list.
Assert that node_name provides all services in service_list.
Assert that node_name subscribes to all topics in topic_list.
Assert that at least one publisher exists on topic_name.
Assert exactly expected publishers on topic_name.
Assert that node node_name publishes on topic_name.
Assert that service_name exists in the ROS graph.
Assert that node_name provides service_name.
Assert that at least one subscriber exists on topic_name.
Assert exactly expected subscribers on topic_name.
Assert that node node_name subscribes to topic_name.
Assert that topic_name exists in the ROS graph.
Assert that no action server for action_name exists in the ROS graph.
Assert that no node named name (in namespace, default /) exists.
Assert that service_name does not exist in the ROS graph.
Assert that topic_name does not exist in the ROS graph.
Return the name of the scenario's own ROS node.
Functions
Wait (event-driven) until an action server for action_name appears.
eventually_action "/navigate"
Wait (event-driven) until a node named name appears in the ROS graph.
Uses Rclex.GraphMonitor.on_entity/3 — no polling sleep. If the node is
already present the function returns immediately.
eventually_node "navigation"
eventually_node "navigation", timeout: 10_000
eventually_node "navigation", "/"
Wait (event-driven) until service_name appears in the ROS graph.
eventually_service "/safety/check"
Wait (event-driven) until topic_name appears in the ROS graph.
eventually_topic "/robot/state"
eventually_topic "/robot/state", timeout: 10_000
@spec expect_action(String.t()) :: :ok
Assert that an action server for action_name exists in the ROS graph.
expect_action "/navigate"
Assert that node_name provides action_name.
expect_action_provider "navigation", "/navigate"
Assert that a node named name (in namespace, default /) exists.
Uses the GraphMonitor's live snapshot. For nodes that may not have appeared
yet, use eventually_node/1,2.
expect_node "navigation"
Assert that node_name provides all actions in action_list.
expect_node_actions "navigation", ["/navigate"]
Assert that node_name publishes on all topics in topic_list.
expect_node_publishes "navigation", ["/robot/state", "/path"]
Assert that node_name provides all services in service_list.
expect_node_services "safety_manager", ["/safety/check"]
Assert that node_name subscribes to all topics in topic_list.
expect_node_subscribes "navigation", ["/goal", "/estop"]
@spec expect_publisher(String.t()) :: :ok
Assert that at least one publisher exists on topic_name.
expect_publisher "/robot/state"
@spec expect_publisher_count(String.t(), non_neg_integer()) :: :ok
Assert exactly expected publishers on topic_name.
expect_publisher_count "/robot/state", 1
Assert that node node_name publishes on topic_name.
expect_publisher_node "navigation", "/robot/state"
@spec expect_service(String.t()) :: :ok
Assert that service_name exists in the ROS graph.
expect_service "/safety/check"
Assert that node_name provides service_name.
expect_service_provider "safety_manager", "/safety/check"
@spec expect_subscriber(String.t()) :: :ok
Assert that at least one subscriber exists on topic_name.
expect_subscriber "/cmd_vel"
@spec expect_subscriber_count(String.t(), non_neg_integer()) :: :ok
Assert exactly expected subscribers on topic_name.
expect_subscriber_count "/cmd_vel", 2
Assert that node node_name subscribes to topic_name.
expect_subscriber_node "controller", "/cmd_vel"
@spec expect_topic(String.t()) :: :ok
Assert that topic_name exists in the ROS graph.
expect_topic "/robot/state"
@spec refute_action(String.t()) :: :ok
Assert that no action server for action_name exists in the ROS graph.
refute_action "/debug_action"
Assert that no node named name (in namespace, default /) exists.
refute_node "debug_node"
@spec refute_service(String.t()) :: :ok
Assert that service_name does not exist in the ROS graph.
refute_service "/debug/reset"
@spec refute_topic(String.t()) :: :ok
Assert that topic_name does not exist in the ROS graph.
refute_topic "/debug/state"
@spec scenario_node_name() :: String.t()
Return the name of the scenario's own ROS node.
node = scenario_node_name()
expect_node node