Quick Start Guide
Get started with ROS2 RobotFramework in a few simple steps.
Prerequisites
ROS2 installed and sourced
Python 3.8 or higher
Library installed (see Installation)
Your First Test
Create a test file (e.g., my_test.robot):
*** Settings *** Library ROS2ClientLibrary *** Test Cases *** Test Basic ROS2 Operations # List available topics ${topics}= List Topics Log Available topics: ${topics} # Check if a topic exists ${exists}= Topic Exists /chatter Should Be True ${exists}Run the test:
robot my_test.robot
Basic Operations
- Topic Operations
List topics:
${topics}= List TopicsCheck topic exists:
${exists}= Topic Exists /chatterGet topic info:
${info}= Get Topic Info /chatter
- Node Operations
List nodes:
${nodes}= List NodesCheck node exists:
${exists}= Node Exists /talkerWait for node:
${available}= Wait For Node /talker timeout=10.0
- Service Operations
List services:
${services}= List ServicesCheck service available:
${exists}= Service Available /add_two_intsCall service:
${response}= Call Service /add_two_ints example_interfaces/srv/AddTwoInts "a: 5, b: 3"
Running Examples
Try the included examples:
# Run basic ROS2 test
robot examples/basics/ros2_basic_test.robot
# Run Navigation2 test
robot examples/medium/nav2_simple_monitoring_test.robot