Energy Efficiency of ROS Nodes in Different Languages: Publisher–Subscriber Case Studies

The Robot Operating System (ROS) is a de facto standard for pro- gramming robotic systems. It currently provides well-established client libraries for two major languages: C++ and Python. Different programming languages are known for their different abstraction levels, and as a consequence, their resource usage, including energy consumption. With energy efficiency being recurrently a quality requirement, it is important to understand how programming in those two languages may affect the energy consumption of robotic systems. In this study, we analyze the impact on energy consump- tion when programming ROS nodes in those two main supported languages. We design and conduct an empirical experiment on ROS 2 nodes implemented in C++ and Python for simple and well- documented topic-based examples. We statistically assess to what extent energy consumption is affected by language choice, where nodes programmed in C++ presented a consistently better energy efficiency. A deeper analysis of the measured variables indicates that the energy efficiency difference between the two client libraries is closely related to the underlying architecture.

Find my other publications here.