Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2025 Apr 2:12:1548250.
doi: 10.3389/frobt.2025.1548250. eCollection 2025.

Energy efficiency in ROS communication: a comparison across programming languages and workloads

Affiliations

Energy efficiency in ROS communication: a comparison across programming languages and workloads

Michel Albonico et al. Front Robot AI. .

Abstract

Introduction: The Robot Operating System (ROS) is a widely used framework for robotic software development, providing robust client libraries for both C++ and Python. These languages, with their differing levels of abstraction, exhibit distinct resource usage patterns, including power and energy consumption-an increasingly critical quality metric in robotics.

Methods: In this study, we evaluate the energy efficiency of ROS two nodes implemented in C++ and Python, focusing on the primary ROS communication paradigms: topics, services, and actions. Through a series of empirical experiments, with programming language, message interval, and number of clients as independent variables, we analyze the impact on energy efficiency across implementations of the three paradigms.

Results: Our data analysis demonstrates that Python consistently demands more computational resources, leading to higher power consumption compared to C++. Furthermore, we find that message frequency is a highly influential factor, while the number of clients has a more variable and less significant effect on resource usage, despite revealing unexpected architectural behaviors of underlying programming and communication layers.

Keywords: ROS; ROS communication; energy efficiency; programming language; robotic.

PubMed Disclaimer

Conflict of interest statement

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Figures

FIGURE 1
FIGURE 1
UML sequence diagram for publisher/subscriber communication.
FIGURE 2
FIGURE 2
UML sequence diagram for service communication.
FIGURE 3
FIGURE 3
UML sequence diagram for action communication.
FIGURE 4
FIGURE 4
Underlying layers of a ROS node programming.
FIGURE 5
FIGURE 5
Adapted UML deployment diagram of experiment instrumentation.
FIGURE 6
FIGURE 6
Power distribution for the publisher node across 20 executions, varying the number of clients and message interval. (A) Message interval: 0.05 s, (B) Message interval: 0.1 s, (C) Message interval: 0.2 s, (D) Message interval: 0.5 s, (E) Message interval: 1.0 s.
FIGURE 7
FIGURE 7
Power distribution for the publisher node across 20 executions, varying the number of clients at 0.2-s message interval. (A) Overall distribution at 0.2 s interval, (B) Distribution at 0.2 s interval by number of clients.
FIGURE 8
FIGURE 8
Power consumption distribution for one subscriber node across 20 executions, while varying the number of clients and message interval. (A) Message interval: 0.05 s, (B) Message interval: 0.1 s, (C) Message interval: 0.2 s, (D) Message interval: 0.5 s, (E) Message interval: 1.0 s.
FIGURE 9
FIGURE 9
Power consumption distribution for the service server node across 20 executions, varying the number of clients and message interval. (A) Message interval: 0.05 s, (B) Message interval: 0.1 s, (C) Message interval: 0.2 s, (D) Message interval: 0.5 s, (E) Message interval: 1.0 s.
FIGURE 10
FIGURE 10
Power consumption distribution for one service client node across 20 executions, while varying the number of clients and message interval. (A) Message interval: 0.05 s, (B) Message interval: 0.1 s, (C) Message interval: 0.2 s, (D) Message interval: 0.5 s, (E) Message interval: 1.0 s.
FIGURE 11
FIGURE 11
Power consumption distribution for the action server node across 20 executions, varying the number of clients and message interval. (A) Message interval: 0.05 s, (B) Message interval: 0.1 s, (C) Message interval: 0.2 s, (D) Message interval: 0.5 s, (E) Message interval: 1.0 s.
FIGURE 12
FIGURE 12
Power consumption distribution for one action client node across 20 executions, while varying the number of clients and message interval. (A) Message interval: 0.05 s, (B) Message interval: 0.1 s, (C) Message interval: 0.2 s, (D) Message interval: 0.5 s, (E) Message interval: 1.0 s.
FIGURE 13
FIGURE 13
Power consumption distribution over all the combinations of independent variables for publisher/server nodes across the 20 executions.
FIGURE 14
FIGURE 14
Power consumption distribution over all the combinations of independent variables for subscriber/client nodes across the 20 executions.

References

    1. Abdi H., Williams L. J. (2010). Tukey’s honestly significant difference (HSD) test. Encycl. Res. Des. 3 (1), 1–5.
    1. Abdulsalam S., Lakomski D., Gu Q., Jin T., Zong Z. (2014). “Program energy efficiency: the impact of language, compiler and implementation choices,” in International green computing conference (IEEE; ), 1–6.
    1. Albonico M., Junior Varela P., Jose Rohling A., Wortmann A. (2024). Energy efficiency of ROS nodes in different languages: publisher/subscriber case studies (RoSE ’24) . New York, NY, USA: Association for Computing Machinery, 1–8. 10.1145/3643663.3643963 - DOI
    1. Basili V., Caldiera G., Rombach H. D. (1994). The goal question metric approach. Encycl. Softw. Eng., 528–532.
    1. Bernard L. W. (1951). On the comparison of several mean values: an alternative approach. Biometrika 38 (3/4), 330–336. 10.2307/2332579 - DOI

LinkOut - more resources