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

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

parent 7cc4da0d
No related branches found
No related tags found
No related merge requests found
......@@ -290,16 +290,15 @@ IriBaseAlgorithm<Algorithm>::~IriBaseAlgorithm()
template <class Algorithm>
void IriBaseAlgorithm<Algorithm>::setRate(double rate_hz)
{
this->loop_rate_=rate_hz;
this->loop_rate_=ros::Rate(rate_hz);
}
template <class Algorithm>
double IriBaseAlgorithm<Algorithm>::getRate(void)
{
return this->loop_rate_;
return 1.0/this->loop_rate_.expectedCycleTime().toSec();
}
template <class Algorithm>
void IriBaseAlgorithm<Algorithm>::reconfigureCallback(Config &config, uint32_t level)
{
......
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