How to fix timing issue?
I'm having an issue calculating the change of time that corresponds with values being published by one of my nodes. My calculations of the delta are as follows and I run this function every loop of my subscriber.
void estimate::getTime(){
now= ros::Time::now().toSec();
if(last_update>0){
dt=(now-last_update);
}
last_update=now;
}
I have noticed that as I add subscribers to the node i'm working on, I begin to get lots of errors in the delta t. is there some concept I'm missing that is causing this to happen?
Thanks for any help