ros2_assert_topic_published
Verify that a ROS2 topic publishes a message matching an optional condition within a timeout. Confirms expected message flow during testing.
Instructions
Assert that a message matching an optional condition has been published to a topic.
Args:
topic: Topic to check (e.g. '/robot/cmd_vel')
topic_type: Message type string (e.g. 'geometry_msgs/msg/Twist')
condition_expr: Python expression evaluating 'msg' (e.g. "msg['linear']['x'] > 0.5")
timeout_sec: Max wait duration in seconds
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes | ||
| topic_type | Yes | ||
| timeout_sec | No | ||
| condition_expr | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |