getting_started:tutorials:sequencer4
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
getting_started:tutorials:sequencer4 [2018/06/28 13:36] – graf | getting_started:tutorials:sequencer4 [2021/03/31 15:40] (current) – [Monitor Checking two Sequences] ursgraf | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== How to Organize Sequences and Steps ====== | ||
- | Sometimes its not obvious what sould go into a separate step and what to pack directly into a sequence. Let's study the following example. \\ | ||
- | A robot finished a homing sequence. It should move to a ready position before further action can happen. For this purpose a sequence '' | ||
- | <code cpp> | ||
- | class Readying : public Sequence { | ||
- | public: | ||
- | Readying(std:: | ||
- | int action() { | ||
- | cs.pathPlanner.move(readyPos); | ||
- | } | ||
- | |||
- | bool checkExitCondition() { | ||
- | bool end = cs-> | ||
- | if (end) safetySystem-> | ||
- | return end; | ||
- | } | ||
- | }; | ||
- | </ | ||
- | The sequence consists of a single action - set the final destination of the path planner. It will terminate as soon as the path planner has reached this position. Before returning it will trigger a safety event which causes the safety system to switch to the next level. | + | ====== Sequence with two Monitors ====== |
- | ==== Alternative Solution | + | In the EEROS library you will find a directory with examples. For this example see [[https:// |
- | The same goal as above could be achieved | + | |
- | <code cpp> | + | Open a shell in the build directory of your EEROS library and run |
- | class Move : public Step { | + | < |
- | Move(std:: | + | $ ./ |
- | + | </ | |
- | int action() { | + | |
- | | + | This example shows a sequence with two associated monitors. The '' |
- | } | + | [{{ .: |
- | + | \\ | |
- | bool checkExitCondition() { | + | |
- | return cs->pathPlanner.endReached(); | + | |
- | } | + | |
- | } | + | ==== Altering the Monitor Behavior |
+ | Change the behavior of '' | ||
+ | If you change the behavior of the timeout monitor to '' | ||
+ | |||
+ | ===== Monitor Checking two Sequences ===== | ||
+ | The next example is [[https:// | ||
+ | Open a shell in the build directory | ||
+ | < | ||
+ | $ ./ | ||
+ | </code> | ||
+ | |||
+ | This example shows a sequence with two associated monitors. The '' | ||
+ | [{{ .: | ||
+ | \\ | ||
- | class Readying : public Sequence { | ||
- | public: | ||
- | Readying(std:: | ||
- | int action() { | ||
- | move(readyPos); | ||
- | safetySystem-> | ||
- | } | ||
- | private: | ||
- | Move move; | ||
- | }; | ||
- | </ |
getting_started/tutorials/sequencer4.1530185781.txt.gz · Last modified: 2018/06/28 13:36 (external edit)