GTest Framework for ROS2 Course - C++
Understand the GTest (Google Test) framework and how to integrate it with ROS2
Course Summary
In this course, we will talk about GTest basics and how you can use GTest to test robotics applications built on ROS2
What you will learn
-
First, learn the basics of CMake as a build system focusing on making shared libraries and how to link a library to an executable.
-
Then, GTest is introduced in a step-by-step way that can be easily transferred for use with other packages or software projects. You will dive into test assertions and what assertion types are available.
-
Continue with ROS2 node unit testing. You will write a publisher and subscriber node in C++ and learn how to test its interfaces using GTest.
-
Next, you will learn a general method for creating system tests. You will explore how to set up a test environment inside a ROS2 workspace, write a system test with ROS2, and convert and adapt it to suit your system test needs.
-
Finally, you will practice by applying the knowledge and skills you have learned in this course in a final project. Your goal will be to validate that the software code provided performs as expected.
Course Overview
Course Introduction
Before we address what GTest is and how it works, we will clarify what software testing is and why it is essential in robotics.
Unit Testing with Google Test
Learn to set up your environment for Unit Testing and how to use the basic assertions of GTest.
Test Subscribers and Publishers using GTest
Learn to create basic tests for ROS2 nodes using Publisher and Subscriber nodes.
Full-System and Sub-System Tests
System tests verify the overall functionality of a complete system composed of multiple nodes to ensure that they all work together as expected on a high level. In this unit, you will learn how to create a comprehensive Navigation2 (Nav2) system test that utilizes Gazebo.
Course Project
In this last unit, you will write tests that cover a ROS2 package. Get ready to apply the approach from the previous units, only this time, push yourself and fight to get it done on your own.
Teachers
Roberto Zegers
PMP, B.Sc in Business Management. He loves all things robotics and is constantly exploring technology advancements evolving and shaping up the future of business.