Skip to main content

A comprehensive Robot Framework library for ROS2 operations

Project description

Robot Framework ROS2 Library

A comprehensive Robot Framework library for testing and automating ROS2 applications.

Test Animation

What is Robot Framework?

Robot Framework is an open-source automation framework that uses keyword-driven testing with simple, readable syntax. It's perfect for ROS2 because:

📚 Learn more: Robot Framework Documentation

  • 🔧 Keyword-Driven: Complex ROS2 operations become simple keywords (Navigate To Pose, Wait For Topic)
  • 📊 Rich Reporting: Built-in HTML reports with detailed logs for debugging
  • 🔄 CI/CD Ready: Seamlessly integrates with automated testing pipelines
  • 👥 Accessible: Non-programmers can write and understand test cases
  • 🧪 System Testing: Ideal for testing complex multi-node ROS2 systems

Features

Core ROS2 Operations

  • Topic Operations: List topics, get topic info, echo messages, publish messages, wait for topics
  • Service Operations: List services, call services, get service info, wait for services
  • Node Operations: List nodes, get node info, wait for nodes
  • Parameter Operations: List, get, set parameters, check parameter existence
  • Launch Operations: Launch files and packages, find launch files, manage launch processes
  • Run Operations: Run nodes directly, run with remapping, find executables, manage node processes

Native ROS2 Python Node Operations (NEW!)

  • Native Topic Operations: Direct publishing/subscribing using ROS2 Python nodes
  • Native Service Operations: Direct service calls using ROS2 Python service clients
  • Native Parameter Operations: Direct parameter access using ROS2 Python parameter clients
  • Native TF2 Operations: Direct transform operations using ROS2 Python TF2
  • Message Storage: Automatic message buffering and retrieval
  • Real-time Communication: Low-latency, high-performance ROS2 communication

Advanced Features

  • Process Management: Start, monitor, and terminate ROS2 processes
  • Discovery: Find launch files and executables in packages
  • Remapping: Topic and service remapping for node execution
  • Timeout Support: Configurable timeouts for all operations
  • Hybrid Mode: Automatic fallback from native to CLI operations when needed

Installation

From Source

git clone https://github.com/bekirbostanci/ros2_robotframework.git
cd ros2_robotframework
pip install -e .

From PyPI (when published)

pip install ros2-robotframework

Dependencies

This library requires ROS2 to be installed and sourced. Make sure you have:

  • ROS2 (tested with Jazz and Humble)
  • Python 3.8 or higher
  • All ROS2 message packages (std_msgs, geometry_msgs, etc.)

Quick Start

Basic Usage

*** Settings ***
Library    ROS2ClientLibrary    use_native_node=True

*** Test Cases ***
Test Basic ROS2 Operations
    # List available topics
    ${topics}=    List Topics
    Log    Available topics: ${topics}
    
    # Check if a specific topic exists
    ${exists}=    Topic Exists    /chatter
    Should Be True    ${exists}
    
    # Get topic information
    ${info}=    Get Topic Info    /chatter
    Log    Topic info: ${info}

Test Native ROS2 Operations
    # Subscribe to a topic using native ROS2 node
    ${success}=    Native Subscribe Topic    /chatter    std_msgs/msg/String
    Should Be True    ${success}
    
    # Publish a message using native ROS2 node
    ${success}=    Native Publish String    /chatter    "Hello World!"
    Should Be True    ${success}
    
    # Wait for and get the message
    ${message}=    Native Wait For Message    /chatter    timeout=5.0
    Should Not Be None    ${message}
    Log    Received: ${message}[data]

Launch and Run Operations

*** Settings ***
Library    ROS2ClientLibrary

*** Test Cases ***
Test Launch File
    # Launch a ROS2 launch file
    ${process}=    Launch Package    demo_nodes_cpp    talker_listener.launch.py
    Should Not Be Equal    ${process}    ${None}
    
    # Wait for topics to appear
    ${available}=    Wait For Topic    /chatter    timeout=10.0
    Should Be True    ${available}
    
    # Echo some messages
    ${messages}=    Echo Topic    /chatter    count=3
    
    # Clean up
    ${terminated}=    Terminate Launch Process    ${process}
    Should Be True    ${terminated}

Test Run Node
    # Run a node directly
    ${process}=    Run Node    demo_nodes_cpp    talker
    Should Not Be Equal    ${process}    ${None}
    
    # Wait for the node to start
    Sleep    2s
    
    # Check if process is running
    ${running}=    Is Process Running    ${process}
    Should Be True    ${running}
    
    # Terminate the process
    ${terminated}=    Terminate Node Process    ${process}
    Should Be True    ${terminated}

Running Examples

# Run the basic test
robot examples/basics/ros2_basic_test.robot

# Run the Nav2 monitoring test
robot examples/medium/nav2_simple_monitoring_test.robot

Tested with Navigation2

This library has been extensively tested with Navigation2 applications. For testing and validation purposes, we used the following repository:

Test Repository: navigation2_ignition_gazebo_turtlebot3

Test Coverage

The library has been validated with:

  • Basic Navigation: Point-to-point navigation tasks
  • Obstacle Avoidance: Dynamic obstacle detection and avoidance
  • Path Planning: Global and local path planning algorithms
  • Recovery Behaviors: Navigation recovery and error handling
  • Multi-robot Scenarios: Testing with multiple robot instances

Note: While extensively tested with this specific repository, the library is designed to work with any ROS2 project and can be used with any ROS2-based robotic system, including custom robots, different navigation stacks, and various simulation environments.

Todo List

Completed Features

ROS2 Core Features

  • Core ROS2 Operations: Topic, service, node, parameter, launch, and run operations
  • Native ROS2 Python Node Operations: Direct publishing/subscribing using ROS2 Python nodes
  • Native Service Operations: Direct service calls using ROS2 Python service clients
  • Native Parameter Operations: Direct parameter access using ROS2 Python parameter clients
  • Native TF2 Operations: Direct transform operations using ROS2 Python TF2
  • Message Storage: Automatic message buffering and retrieval
  • Process Management: Start, monitor, and terminate ROS2 processes
  • Discovery: Find launch files and executables in packages
  • Remapping: Topic and service remapping for node execution
  • Timeout Support: Configurable timeouts for all operations

Navigation2 Features

  • Navigation2 Client: Complete Navigation2 client with native ROS2 operations
  • Navigate to Pose: Point-to-point navigation with action client
  • Navigate Through Poses: Multi-waypoint navigation
  • Costmap Operations: Global and local costmap clearing
  • Pose Management: Initial pose setting and AMCL pose monitoring
  • Velocity Control: Direct velocity command publishing
  • Navigation Status: Real-time navigation status monitoring
  • Recovery Behaviors: Navigation recovery and error handling
  • Multi-robot Support: Testing with multiple robot instances

Planned Features

  • Performance Monitoring: Add built-in performance metrics and timing for operations
  • Multi-robot Support: Enhanced support for testing multiple robots simultaneously
  • Custom Message Types: Better support for custom ROS2 message types and validation
  • Integration Testing: Add comprehensive integration test suites
  • Documentation: Expand API documentation with more examples and use cases
  • CI/CD Integration: Add GitHub Actions workflows for automated testing
  • Extending ROS2 Version Support: Add compatibility for additional ROS2 distributions (e.g., Foxy, Galactic, Humble, Iron, Jazzy)

Test Results

Here's an example of the test output and monitoring capabilities:

Test Report

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ros2_robotframework-1.0.2.tar.gz (51.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ros2_robotframework-1.0.2-py3-none-any.whl (53.2 kB view details)

Uploaded Python 3

File details

Details for the file ros2_robotframework-1.0.2.tar.gz.

File metadata

  • Download URL: ros2_robotframework-1.0.2.tar.gz
  • Upload date:
  • Size: 51.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ros2_robotframework-1.0.2.tar.gz
Algorithm Hash digest
SHA256 aa84c5b745a6ebf1570846158373a382ae2a2286b7d784c334266d8ff4a4dbbc
MD5 3a33337e2ec8622cb058dfaf828c4f61
BLAKE2b-256 e9b3c64a3d9a16b51848767be35755818aa348eec95efc4d15ee0a6627aec467

See more details on using hashes here.

Provenance

The following attestation bundles were made for ros2_robotframework-1.0.2.tar.gz:

Publisher: release.yml on bekirbostanci/ros2_robotframework

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ros2_robotframework-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ros2_robotframework-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 96106d826b6247cb4d1dec24dcd9ef618b651e6b26ab6ef1969d448574182568
MD5 65fc6e7b4d968333ccaad7f0b6f00db1
BLAKE2b-256 b892da06aadf350aeff8ebbc793748c1cfd7c3c7be26127659439432df642519

See more details on using hashes here.

Provenance

The following attestation bundles were made for ros2_robotframework-1.0.2-py3-none-any.whl:

Publisher: release.yml on bekirbostanci/ros2_robotframework

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page