Commit 585eafb4 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Merge branch 'generic_dyn_reconf' into 'master'

Solved a bug with the module rate handle functions: It is a ros::Rate object...

See merge request !2
parents 814d7e09 e5aac862
......@@ -278,13 +278,13 @@ void CModule<ModuleCfg>::set_rate(double rate_hz)
if(rate_hz<=0.0)
throw CModuleException(_HERE_,"Module rate must be positive",this->name);
else
this->module_rate=rate_hz;
this->module_rate=ros::Rate(rate_hz);
}
template<class ModuleCfg>
double CModule<ModuleCfg>::get_rate(void)
{
return this->module_rate;
return 1.0/(this->module_rate.expectedCycleTime().toSec());
}
template<class ModuleCfg>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment