User Tools

Site Tools


eeros_architecture:sequencer:step_or_sequence

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
eeros_architecture:sequencer:step_or_sequence [2019/03/14 09:25] – created grafeeros_architecture:sequencer:step_or_sequence [2026/02/19 15:09] (current) ursgraf
Line 1: Line 1:
 ====== How to Organize Sequences and Steps ====== ====== 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. \\+Sometimes its not obvious what should 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 ''readying'' is implemented as follows: A robot finished a homing sequence. It should move to a ready position before further action can happen. For this purpose a sequence ''readying'' is implemented as follows:
 <code cpp> <code cpp>
Line 9: Line 9:
   int action() {   int action() {
     cs.pathPlanner.move(readyPos);  // we assume that the control system comprises of a path planner     cs.pathPlanner.move(readyPos);  // we assume that the control system comprises of a path planner
 +    return 0;
   }   }
   
Line 25: Line 26:
 <code cpp> <code cpp>
 class Move : public Step { class Move : public Step {
-  Move(std::string name, Sequencer& seq, BaseSequence* caller) : Step(name, seq, caller) { }+  Move(std::string name, Sequence* caller) : Step(name, caller) { }
      
   int action() {   int action() {
     cs.pathPlanner.move(readyPos);  // we assume that the control system comprises of a path planner     cs.pathPlanner.move(readyPos);  // we assume that the control system comprises of a path planner
 +    return 0;
   }   }
   
Line 38: Line 40:
 class Readying : public Sequence { class Readying : public Sequence {
 public: public:
-  Readying(std::string name, Sequencer& seq) : Sequence(name, seq), move("move", seq, this) {setNonBlocking();}+  Readying(std::string name, Sequencer& seq) : Sequence(name, seq), move("move", this) {setNonBlocking();}
  
   int action() {   int action() {
     move(readyPos);     move(readyPos);
     if (Sequencer::running) safetySystem->triggerEvent(safetyProperties->readyDone);     if (Sequencer::running) safetySystem->triggerEvent(safetyProperties->readyDone);
 +    return 0;
   }   }
 private: private:
eeros_architecture/sequencer/step_or_sequence.1552551949.txt.gz · Last modified: 2019/03/14 09:25 by graf