for_developers:signal_live_monitoring
This is an old revision of the document!
Live Monitoring of Signals
Overview
With the following method a signal can be monitored while the application is running.
But this method should be used with caution, because it ca degrade the real time performance of the system. For this reason only one or two signals can be monitored at a time, if the real time performance is needed.
To keep the real time performance on an acceptable level, std:cout and std:endl should only be used once!
Implementation
Following example contains a timing measurement and monitoring of one signal.
In ControlSystem.cpp after creating task and before adding it to the executor:
... eeros::task::Periodic td("control system",dt, timedomain); td.monitors.push_back([&](eeros::PeriodicCounter &c, Logger<LogWriter> &log) { static int ticks = 0; // mseconds if (++ticks < 1000) return; ticks = 0; eeros::PeriodicCounter counter = c; c.reset(); std:cout << "CS: period max: " << setw(7) << counter.period.max*1000 << " ActPos Robot: " << dirKin.getOut().getSignal().getValue() // vector with 2 elements << std::endl; }); eeros::Executor::instance().add(td); ...
for_developers/signal_live_monitoring.1471271706.txt.gz · Last modified: 2016/08/15 16:35 by gehrig