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:41] – [What Kind of Signals Does Your Block Handle] graf | eeros_architecture:control_system:custom_blocks [2021/07/08 19:37] (current) – [How Many Inputs and Outputs?] 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? ==== |
- | Depending on the type of the signals you have to define | + | You should design your block as an extension |
- | ===== What Kind of Signals? ===== | + | As a example we take a look at a new block |
- | Depending on the type of the signals you have to define | + | <code cpp> |
+ | template < typename T = double > // make it available for many types | ||
+ | class MyBlock : public Blockio< | ||
+ | | ||
+ | | ||
+ | virtual void run() { ... } // do what must be done in this block | ||
+ | }; | ||
+ | </ | ||
+ | ==== 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. | ||
+ | |||
+ | ==== How to Handle the Timestamp ==== | ||
+ | If your block is not time dependent, you will simply set the timestamp of the output to the same value as the timestamp of the input. If sampling time matters, you will have to calculate the timestamp of the output from the timestamp of the input and inner workings of your block. \\ | ||
+ | |||
+ | 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. |
eeros_architecture/control_system/custom_blocks.1542102070.txt.gz · Last modified: 2018/11/13 10:41 by graf