Is different subscriber working like different thread?
For example, I want to subscribe to 2 topics ("/scan" and "/odometry")
the "/scan" frequency is 10Hz, while the "/odometry" frequency is 50Hz.
But in my program, the scanCallBack
function is computational heavy, so it cannot process as fast as the "/scan".
the odomCallBack
function is not that heavy, so it has the potential to process like 50Hz.
I expected them to work separately, but when I try print out time, I found the odomCallBack
function now has the same frequency as the scanCallBack
function, at 6Hz.
So does it mean the subscribers can affect each other, instead of working separately like different threads?
By the way, how can I fix this problem?
Why not use two nodes?
@jayess I need to do sensor fusion. So I need to put them in one program.