User Tools

Site Tools


eeros_architecture:control_system:subsystem

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
eeros_architecture:control_system:subsystem [2023/06/28 13:10] – [Using Subio Block] ursgrafeeros_architecture:control_system:subsystem [2023/06/28 13:18] (current) – [Using Subio Block] ursgraf
Line 8: Line 8:
 ==== Using Subio Block ==== ==== Using Subio Block ====
  
-Define the necessary inner blocks in your custom class. In the constructor you create the inner blocks and connect them among each other. The run-method must call all the run-methods of the inner blocks. Write getter methods for all the inputs into and outputs out of the new subsystem+Define the number of inputs and outputs of your sysbsystem together with the necessary inner blocks in your custom class. In the constructor you create the inner blocks and connect them among each other. The run-method must call all the run-methods of the inner blocks. Set the outputs of your subsystem to suitable outputs of your inner blocks.
 <code cpp> <code cpp>
-class Observer : public eeros::control::Blockio<0,0> {+class Observer : public eeros::control::Subio<1,1,Vector2,Vector2> {
  public:   public: 
   Observer() : gain1({5.0, 2.2}) ... {   Observer() : gain1({5.0, 2.2}) ... {
     sum1.getIn(1).connect(sum2.getOut());     sum1.getIn(1).connect(sum2.getOut());
     sum1.negateInput(1);     sum1.negateInput(1);
 +    setOut(sum1.getOut());
     ...     ...
   }   }
Line 25: Line 26:
   }   }
      
-  virtual eeros::control::Input<Vector2>& getSum1In() {return sum1.getIn();} 
-  virtual eeros::control::Input<Vector2>& getSum2In() {return sum2.getIn();} 
-  virtual eeros::control::Output<Vector2>& getGain1Out() {return gain1.getOut();} 
- 
  private:   private: 
   eeros::control::Gain<Vector2> gain1;   eeros::control::Gain<Vector2> gain1;
eeros_architecture/control_system/subsystem.1687950605.txt.gz · Last modified: 2023/06/28 13:10 by ursgraf