Skip to content

Commit

Permalink
Replace RateThread with PeriodicThread for YARP 3.8 compatibility (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro authored Jun 1, 2022
1 parent 9214833 commit 585fa2a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]

### Fixed
- Remove use of deprecated YARP header to ensure compatibility with YARP 3.8 (https://github.com/robotology/idyntree-yarp-tools/pull/32).
- Remove use of deprecated YARP headers and classes to ensure compatibility with YARP 3.8 (https://github.com/robotology/idyntree-yarp-tools/pull/32, https://github.com/robotology/idyntree-yarp-tools/pull/33).

## [0.0.5] - 2022-05-27

Expand Down
6 changes: 3 additions & 3 deletions src/modules/idyntree-sole-gui/plugin/ObserverThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ bool getVectorOfStringFromProperty(yarp::os::Property& prop, std::string key, st
return true;
}

ObserverThread::ObserverThread(yarp::os::ResourceFinder& config, int period) : RateThread(period)
ObserverThread::ObserverThread(yarp::os::ResourceFinder& config, int period) : PeriodicThread((double)period/1000.0)
{
yDebug("ObserverThread running at %g ms.", getRate());
yDebug("ObserverThread running at %g s.", getPeriod());

bool ok = this->init(config);
assert(ok);
Expand Down Expand Up @@ -228,7 +228,7 @@ bool ObserverThread::init(yarp::os::ResourceFinder& config)
initIMUFilter.resize(3, 0.0);
initIMUFilter[2] = -9.81;

filtIMUGravity = new iCub::ctrl::FirstOrderLowPassFilter(6.0, this->getRate()/1000.0, initIMUFilter);
filtIMUGravity = new iCub::ctrl::FirstOrderLowPassFilter(6.0, this->getPeriod(), initIMUFilter);
}

return true;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/idyntree-sole-gui/plugin/include/ObserverThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <vector>

#include <yarp/os/ResourceFinder.h>
#include <yarp/os/RateThread.h>
#include <yarp/os/PeriodicThread.h>
#include <yarp/os/Log.h>

#include <yarp/dev/IAnalogSensor.h>
Expand All @@ -33,7 +33,7 @@ using namespace yarp::dev;

class QPainter;

class ObserverThread : public yarp::os::RateThread
class ObserverThread : public yarp::os::PeriodicThread
{
protected:
// Attribute to read encoders position
Expand Down

0 comments on commit 585fa2a

Please sign in to comment.