Creating plugins for the calculator application using pluginlib

Creating a calculator application using plugins is a slightly tedious task compared to writing a single code. The aim of this example, however, is to show how to add new features to a calculator without modifying the main application code.

In this example, we will see a computer application that loads plugins to perform each operation. Here, we only implement the main operations ,such as addition, subtraction, multiplication, and division. We can expand to any level by writing individual plugins for each operation.

Before going on to create the plugin definition, we can access the calculator code from the pluginlib_calculator folder for reference.

We are going to create an ROS ...

Get Mastering ROS for Robotics Programming - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.