User Tools

Site Tools


getting_started:tutorials:sequencer4

This is an old revision of the document!


How to Organize Sequences and Steps

class Readying : public Sequence {
public:
  Readying(std::string name, Sequencer& seq) : Sequence(name, seq) {setNonBlocking();}
 
  int action() {
    cs.setMaxSpeed(1.0);            // we assume that the control system offers some speed limitation
    cs.pathPlanner.move(readyPos);  // we assume that the control system comprises of a path planner
  }
 
  bool checkExitCondition() {
    bool end = cs->pathPlanner.endReached();
    if (end) safetySystem->triggerEvent(safetyProperties->readyDone);
    return end;
  }
};
class Move : public Step {
  int action() {
    cs.setMaxSpeed(1.0);            // we assume that the control system offers some speed limitation
    cs.pathPlanner.move(readyPos);  // we assume that the control system comprises of a path planner
  }
 
  bool checkExitCondition() {
    return cs->pathPlanner.endReached();
  }
}
 
class Readying : public Sequence {
public:
  Readying(std::string name, Sequencer& seq) : Sequence(name, seq) {setNonBlocking();}
 
  int action() {
    move(readyPos);
    safetySystem->triggerEvent(safetyProperties->readyDone);
  }
 
  bool checkExitCondition() {
    bool end = cs->pathPlanner.endReached();
    if (end) safetySystem->triggerEvent(safetyProperties->readyDone);
    return end;
  }
};
getting_started/tutorials/sequencer4.1530172531.txt.gz · Last modified: 2018/06/28 09:55 (external edit)