在 ROS 平台中,我們經常需要在各個 node 之中傳輸各種資料。 當這些資料屬於數kb~數MB 的小型檔案時, Ros 可以很順利且快速的進行傳輸,但是當這些檔案大至數百MB甚至GB以上時,在每個節點進行資料打包, 傳輸, 接收, 解包資料將會變得非常浪費時間與資源。 甚至在高頻率的資料傳輸上,將會導致嚴重的延遲或是資料丟失的情形發生。 ROS 平台為了改善這個問題,提供了一種解法 "nodelet" ,其作法近似於C++裏面的 zero copy。 實現的作法是將某一個節點(通常是第一個)所處理完成的資料記憶體位址記下來,後續在進行資料傳輸時,並不實現資料本體,而是改用傳輸記憶體位址的方式進行。 這種作法可以大大改善傳輸效率,將可能造成嚴重延遲的大型檔案轉為僅為幾KB不到的記憶體位置,達到在傳輸資料時近乎零延遲的情形。 In the ROS platform, we often need to transfer various materials among the nodes. When these materials belong to a small file of several kb to several megabytes, Ros can be transmitted smoothly and quickly, but when these files are as large as hundreds of MB or even GB, data is packaged, transmitted, and received at each node. Unpacking data will become a waste of time and resources. Even in the transmission of high-frequency data, serious delays or data loss will occur. To improve this problem, the ROS platform provides a solution "nodelet" that works similar to zero copy in C++. T