shared variable between callbacks
Hi all, I have a ros node that is supposed to accept two sources (IMU and PointCloud) with two different frequecies (Imu is ~200 Hz, PointCloud is ~30 Hz). So expect around 7 IMU messages for every cloud message.
If I use a message filter, I can collect in a single callback the two closest signals.
Instead, I would like to independently collect all the occurences of IMU between two point cloud messages, so that I can use them to get a better interpolation of the IMU signal to synchronize the two signals.
Would two callbacks + a global variable (a std::vector) suffice? Should I implement some blocking mechanism to prevent the global variable from being modified when I'm inside the cloud callback?
Are the callbacks sequential? In that case, how can I make them concurrent?