eeros_architecture:sequencer:sequence
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
eeros_architecture:sequencer:sequence [2017/12/05 15:52] – [Simple Example] graf | eeros_architecture:sequencer:sequence [2018/08/07 12:41] – [Waiting for Sequences to Finish] graf | ||
---|---|---|---|
Line 6: | Line 6: | ||
[{{ : | [{{ : | ||
Sequence A runs. That is, all its steps run consecutively. After step 1 is done the sequence B is called. As B is blocking its two steps run while A is being blocked. Only after B finishes does the control return back to A where step 2 and step 3 are then executed. After this sequence C is called. As C is nonblocking its two steps run in parallel to the remaining steps of sequence A. A must wait for C to finish by calling //join//. \\ | Sequence A runs. That is, all its steps run consecutively. After step 1 is done the sequence B is called. As B is blocking its two steps run while A is being blocked. Only after B finishes does the control return back to A where step 2 and step 3 are then executed. After this sequence C is called. As C is nonblocking its two steps run in parallel to the remaining steps of sequence A. A must wait for C to finish by calling //join//. \\ | ||
- | A nonblocking sequence will run in its own thread of execution while a nonblocking | + | A nonblocking sequence will run in its own thread of execution while a blocking |
- | IMPORTANT The main sequence must always be defined as nonblocking. Otherwise, the main program | + | IMPORTANT The main sequence must always be defined as nonblocking. Otherwise, the flow of control |
===== Sequence and Step ===== | ===== Sequence and Step ===== | ||
Line 42: | Line 42: | ||
class MoveSequence : public Sequence { | class MoveSequence : public Sequence { | ||
public: | public: | ||
- | MoveSequence(std:: | + | MoveSequence(std:: |
int action() { | int action() { | ||
robot.moveXY(10, | robot.moveXY(10, | ||
Line 55: | Line 55: | ||
The sequence // | The sequence // | ||
+ | ===== Waiting for Sequences to Finish ===== | ||
+ | Usually at some stage in your program you have to wait for a given sequence to finish until the program should continue. There are to methods to accomplish this. | ||
+ | <code cpp> | ||
+ | wait() | ||
+ | </ |
eeros_architecture/sequencer/sequence.txt · Last modified: 2020/05/22 11:08 by ursgraf