Usually, when we work with robotic systems, the resources are shared, not always available, or the experiments cannot be done regularly because of the cost or time required to prepare and perform them. For this reason, it is good practice to record the data of the experiment session for future analysis and to work, develop, and test our algorithms. However, the process of saving good data so that we can reproduce the experiment offline is not trivial. Fortunately, we have powerful tools in ROS that already solve this problem.
ROS can save all messages published by the nodes through the topics. It has the ability to create a bag file that contains the messages as they are with all their fields and timestamps. This allows reproducing the experiment offline and simulating the real condition, which is the latency of message transmission. Moreover, ROS tools do all this efficiently with a high bandwidth and an adequate manner to organize the saved data.
In the next...