Search this site
Embedded Files
  • Home
  • Solar Energy
    • IECON2017
    • INTERCON2017
    • Thesis Research
    • Solar Energy
    • Solar Heater
  • Robotics
    • ROS2 Control
    • 3D Mapping
    • Starbots Coffee Shop Arm
    • Gtest & Unit Test
    • Robotics Web Development
    • Arms Kinematics
    • Mobile Kinematics
    • Perception & Manipulation
    • Autonomous Navigation
    • Obstacle Avoidance
    • Four Wheel Independent Steering
    • Turtlebot3
    • Gazebo Simulation
    • UGV
    • Sumo
    • Aurdiosity
    • Drone
  • Electronics
    • BLDC Motor Upgrade
    • NAS Server
    • Lenovo x250
    • Canon G3100
    • LG TV
    • Wasp Killer
  • Computer Vision
    • Tracking Algorithm Based on Yolact and SIFT
    • Yolo v5 Obstacle Detection
    • VR Simulator
    • Color Based Person Tracker
    • Discrete Cosine Transform
    • OpenGL
  • Courses & Certificates
 

Gtest & Unit Test

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.

  • Launch Gazebo Headless ROS 1

File
  • Launch Gazebo Headless ROS 2

File

Results

Tips

Files

  • GitHub - Test

  • GitHub - CICD ROS 1

  • GitHub - CICD ROS 2

Google Sites
Report abuse
Page details
Page updated
Google Sites
Report abuse