This project is focused on creating and executing tests for the TortoiseBot robot simulation in both ROS1 and ROS2 environments. The primary goal is to develop a robust testing framework (GTest & Unit Tests) to ensure the functionality and reliability of the waypoints action server, allowing the robot to follow predefined paths accurately.
Key Topics Learnt
GTest.
Unit Test.
Method
Basically, we can differentiate between 3 main tools that we are going to use when creating tests for our ROS projects. These are:
gtest: This tool is used for testing C++ code at the library level (at the C++ API level). It is Google's C++ test framework.
unittest: This tool is used for testing Python code at the library level (at the Python API level).
rostest: This tool is used for testing at the ROS node level.
Usually for ROS projects, rostest in combination with one of the above (gtest or unittest) are used.
Basically, we can divide the tests into 3 levels of testing. They are:
Library unit tests: These are the tests without ROS. This means that they are not meant to test any ROS-related issue. These tests are performed using the unittest or gtest frameworks by themselves.
ROS unit tests: These will test your ROS code related to a single node. They will start your node and test its external API, like published or subscribed topics, etc. These tests are performed using a combination of a rostest alongside either a unittest or gtest.
ROS integration tests: These will start up multiple nodes and test that they all work together as expected. For instance, that your robot does what it's supposed to do. These tests are also done using a combination of a rostest with a unittest/gtest.
ROS 1 test environment.
ROS 2 test environment.