User Tools

Site Tools


getting_started:practical_problems:monitor

This is an old revision of the document!


Determine the Realtime Performance of your Application

It is of general interest to know whether your system fulfills your realtime requirements. As soon as a control system does not run reliably the question is in the room if your control algorithm has a bug or whether your underlying system does not perform as it is intended.
For this purpose you can use Monitoring Execution Timing. It will give you precise measurements of the performance of your system.

For a certain type of safety critical robots, it is desirable to change into a safe level in case of the jitter in periodicity of a time domain or the safety system itself to exceed a certain level. This could be achieved by using the monitor functions of the timer, see Monitoring Execution Timing. Assign your timedomain to a periodic with the same sampling time. Then, add a monitor function, which periodically checks for the maximum and triggers a specific safety event.

eeros::control::Timedomain timedomain("time domain", dt, true);
eeros::task::Periodic periodic("control system",dt, timedomain);
 
periodic.monitors.push_back([=](PeriodicCounter &c, Logger<LogWriter> &log) {
  if (c.period.max >= dt) safetySystem.triggerEvent(myEvent);
});
 
eeros::Executor::instance().add(periodic);

Make sure to add the periodic to the executor. Usually you add the timedomain to the executor and its associated periodic is generated internally. However, in this case, we have to declare the periodic explicitely in order to be able to assign the monitor function.

getting_started/practical_problems/monitor.1527756606.txt.gz · Last modified: 2018/05/31 10:50 by graf