Skip to content
Snippets Groups Projects
Commit 1fc12a34 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Set the diagnostic_period in the constructor. Used its value to control the...

Set the diagnostic_period in the constructor. Used its value to control the sleep in the local spin function.
parent b6790da0
No related branches found
Tags kinetic
No related merge requests found
......@@ -277,6 +277,9 @@ IriBaseAlgorithm<Algorithm>::IriBaseAlgorithm(const ros::NodeHandle &nh) :
// allow Ctrl+C management
signal(SIGHUP, &IriBaseAlgorithm<Algorithm>::hupCalled);
// set the diagnostic updater period
this->private_node_handle_.setParam("diagnostic_period",0.1);
}
template <class Algorithm>
......@@ -365,7 +368,7 @@ int IriBaseAlgorithm<Algorithm>::spin(void)
// update diagnostics
this->diagnostic_.update();
ros::WallDuration(0.1).sleep();
ros::WallDuration(this->diagnostic_.getPeriod()).sleep();
}
// stop ros
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment