Skip to content
Snippets Groups Projects
Commit 10c6dcea authored by Fernando Herrero's avatar Fernando Herrero
Browse files

Fix get/setRate functions using ros::Rate API correctly

parent fa0185f2
No related branches found
No related tags found
No related merge requests found
......@@ -373,13 +373,13 @@ void *IriBaseNodeDriver<Driver>::mainThread(void *param)
template <class Driver>
void IriBaseNodeDriver<Driver>::setRate(double rate_hz)
{
this->loop_rate_=rate_hz;
this->loop_rate_=ros::Rate(rate_hz);
}
template <class Driver>
double IriBaseNodeDriver<Driver>::getRate(void)
{
return this->loop_rate_;
return 1.0/this->loop_rate_.expectedCycleTime().toSec();
}
template <class Driver>
......
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