getting_started:practical_problems:seq_endless
This is an old revision of the document!
Do not use Endless Loops in Sequences
Though a sequence might run endlessly - or at least as long as a robot is powered - it should be avoided to write something like
public: int action() { while (true) step1(); }
when defining the method action of the sequence. Due to some extraordinary condition such as a fault or stopping the application prematurely the sequence should stop as soon as the sequencer itself stops. For this purpose the correct implementation of the action method is as follows:
public: int action() { while (Sequencer::running) step1(); }
getting_started/practical_problems/seq_endless.1506264477.txt.gz · Last modified: 2017/09/24 16:47 (external edit)