Skip to content

tharaka27/ros2_test_runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ROS2 Test Runner

This Python package provides a convenient way to run ROS2 programs multiple times and collect timing and other statistics. It can be used to analyze the performance and behavior of ROS2 systems.

Features

  • Run ROS2 files multiple times with customizable parameters.
  • Collect timing statistics such as execution time, latency, and frequency.
  • Easy integration with existing ROS2 workflows.

Usage

  1. Change the configuration file (config.json) specifying the ROS2 files you want to execute and their parameters. Here's an example:
{
    "testcases" :
    [
        {
            "name" : "testcase_baseline",
            "numberOfInvocations": 2,
            "packages":[
                {
                    "name" : "panda_moveit_config",
                    "launch" : "moveit.launch.py",
                    "leader" : false
                },{
                    "name" : "paper_benchmarks",
                    "launch" : "benchmark_baseline.launch.py",
                    "leader" : true
                }
            ],
            "checkpoint" : "[checkpoint]",
            "terminate" : "[terminate]",
            "askToTerminate" : "source_frame - frame does not exist",
            "pre_commands" : [
                "cd /home/ros/ws_moveit ",
                ". install/setup.sh "
            ]
        },
        {
            "name" : "testcase_asynchronous",
            "numberOfInvocations": 2,
            "packages":[
                {
                    "name" : "panda_moveit_config",
                    "launch" : "moveit.launch.py",
                    "leader" : false
                },{
                    "name" : "paper_benchmarks",
                    "launch" : "benchmark_asynchronous.launch.py",
                    "leader" : true
                }
            ],
            "checkpoint" : "[checkpoint]",
            "terminate" : "[terminate]",
            "askToTerminate" : "source_frame - frame does not exist",
            "pre_commands" : [
                "cd /home/ros/ws_moveit ",
                ". install/setup.sh "
            ]
        },
        {
            "name" : "testcase_synchronous",
            "numberOfInvocations": 2,
            "packages":[
                {
                    "name" : "panda_moveit_config",
                    "launch" : "moveit.launch.py",
                    "leader" : false
                },{
                    "name" : "paper_benchmarks",
                    "launch" : "benchmark_synchronous.launch.py",
                    "leader" : true
                }
            ],
            "checkpoint" : "[checkpoint]",
            "terminate" : "[terminate]",
            "askToTerminate" : "source_frame - frame does not exist",
            "pre_commands" : [
                "cd /home/ros/ws_moveit ",
                ". install/setup.sh "
            ]
        }

    ],
    "output_file" : "example.txt"
}

You need to log checkpoint and terminate string from as RCL_INFO.

Checkpoint

When the "checkpoint" keyword is encountered in the stdout, the statistics collection process records a timestamp in the statistics collection file, signifying the occurrence of this event.

Terminate

The "terminate" keyword is utilized to signal the end of a current run and initiate a new run in the statistics collection process.

  1. Then run the runner.py
python3 runner.py
  1. After execution, you can find the log lines of checkpoints in the example.txt. It will contain timing statistics.

Contributing

Contributions are welcome! If you encounter any issues or have suggestions for improvement, please open an issue on the project's GitHub repository.

Contact

For any inquiries or support, please contact the project maintainer:

We hope this package helps you in analyzing and optimizing your ROS2 systems. Happy coding!

About

A python package to conveniently collect statistics data in ros2

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages