-1

How do i test ros2 on multiple simulation worlds with diferent scenarios. How do i load the world, scenario, test data. Save the results and compare with expected results, with deviations from expectations.

shrw
  • 1,719
  • 5
  • 27
  • 50
  • [Test Framework in ROS2](https://discourse.ros.org/t/test-framework-in-ros2/2667) might be a good starting point. I think using the launch files to start whatever simulation world you want would be the way – ignacio Apr 11 '23 at 18:42

1 Answers1

1

One solution is to use launch file EventHandlers.

The loop should follow these steps:

  1. Launch the first node using a launch file and a .yaml parameters file. The name of the node should be defined inside the launch file using a loop, appending a number to the node name. For example: Node_test1, Node_test2, ...
  2. Inside the node define a function that saves on file the results of your tests.
  3. Use an event handler to wait for the first node to finish and then run the second node with new parameters.

The .yaml file should have be defined like this:

Node_test1:
  ros__parameters:
  param_example: 0.01
  second_param_example: 10000

Node_test2:
  ros__parameters:
    param_example: 0.02
    second_param_example: 20000

Then you could create a different node which loads all the file inside a folder, does the required computations and finally save the results on another file.

Alesof
  • 321
  • 2
  • 8