An outer loop with a slower ros::Rate() and an inner loop with a faster ros::Rate() logic
Consider the situation where there is an outer control loop and an inner control loop. The outer loop runs at 100Hz and the inner loop runs at 500Hz. The inner loop will run 5 times before the outer loop gets called again.
However, the logic of the program would only like the outer loop to run after the inner loop finishes its cycle and sets a flag as true.
What happens in this situation? Does the outer loop forces itself to run again and re-writes data from the yet unfinished return value of the inner loop?