eeros_architecture:control_system:custom_blocks
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| eeros_architecture:control_system:custom_blocks [2018/11/13 10:59] – [What Kind of Signals?] graf | eeros_architecture:control_system:custom_blocks [2025/08/08 15:41] (current) – [Basic Block] ursgraf | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Custom Blocks ====== | ====== Custom Blocks ====== | ||
| - | If a certain functionality cannot be found in the [[eeros_architecture: | + | If a certain functionality cannot be found in the [[eeros_architecture: | 
| ==== How Many Inputs and Outputs? ==== | ==== How Many Inputs and Outputs? ==== | ||
| - | If your block has one input, one output, or one input and one output, you should design your block as an extension of '' | + | You should design your block as an extension of '' | 
| - | For all other cases your block will have to define the necessary inputs and outputs as fields of your new block class. | + | As a example we take a look at a new block | 
| + | <code cpp> | ||
| + | template < typename T = double > // make it available for many types | ||
| + | class MyBlock : public Blockio< | ||
| + |  | ||
| + | MyBlock() { ... } // constructor | ||
| + | virtual void run() { ... } // do what must be done in this block | ||
| + | }; | ||
| + | </ | ||
| ==== What Kind of Signals? ==== | ==== What Kind of Signals? ==== | ||
| Depending on the type of the signals you will design your class as a template class or you will define it with a given type. | Depending on the type of the signals you will design your class as a template class or you will define it with a given type. | ||
| Line 14: | Line 22: | ||
| There are cases that your blocks produces signals which do not depend on input signals from other blocks. It might generate its output signals from various other sources and will set its timestamp to a actual system time, or the time the original source signal was generated. | There are cases that your blocks produces signals which do not depend on input signals from other blocks. It might generate its output signals from various other sources and will set its timestamp to a actual system time, or the time the original source signal was generated. | ||
| + | |||
| + | ===== Using Basic Block ===== | ||
| + | Have a look at the [[eeros_architecture: | ||
eeros_architecture/control_system/custom_blocks.1542103168.txt.gz · Last modified: 2018/11/13 10:59 by graf
                
                