Skip to content

Commit

Permalink
Add board info to the downsampler
Browse files Browse the repository at this point in the history
  • Loading branch information
pattacini committed Nov 16, 2021
1 parent dc81e0f commit d240887
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/libraries/icubmod/embObjLib/mcEventDownsampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace mced {
return false;
}

bool mcEventDownsampler::start(const Config &config)
bool mcEventDownsampler::start()
{
if(nullptr != timer)
{
Expand Down Expand Up @@ -103,7 +103,7 @@ namespace mced {

void mcEventDownsampler::printreport()
{
yCError(MC_EVENT_DOWNSAMPLER) << "Detected " << counter - latch_2 << " events on aggregate since the last message";
yCError(MC_EVENT_DOWNSAMPLER) << info << "detected" << counter - latch_2 << "events on aggregate since the last message";
}

} // mced
8 changes: 3 additions & 5 deletions src/libraries/icubmod/embObjLib/mcEventDownsampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ namespace mced {
*/
struct Config
{
double period {0.};
Config() = default;
constexpr Config(double c) : period(c) {}
bool isvalid() const { return 0. != period; }
double period {.01};
std::string info {""};
};

/**
Expand Down Expand Up @@ -61,7 +59,7 @@ namespace mced {
* @return true if the difference is lower or equal to the threshold, false if it is higher.
*/
bool canprint();
Config config = 0.1;
Config config;

private:
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,8 @@ bool embObjMotionControl::open(yarp::os::Searchable &config)

event_downsampler = new mced::mcEventDownsampler();
event_downsampler->config.period = 0.01;
event_downsampler->start(event_downsampler->config);
event_downsampler->config.info = getBoardInfo();
event_downsampler->start();

if(false == res->serviceVerifyActivate(eomn_serv_category_mc, servparam))
{
Expand Down

0 comments on commit d240887

Please sign in to comment.