Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace RateThread with PeriodicThread for YARP 3.8 compatibility #33

Merged
merged 3 commits into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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