eeros_architecture:hal:config_ros
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
eeros_architecture:hal:config_ros [2017/12/14 17:58] – [Additional Arguments] graf | eeros_architecture:hal:config_ros [2018/01/18 15:54] – [Additional Arguments] graf | ||
---|---|---|---|
Line 18: | Line 18: | ||
| msgType | string | message type | | | msgType | string | message type | | ||
| dataField | string | data member of message | | | dataField | string | data member of message | | ||
- | | callOne | boolean | ???? | | + | | callOne | boolean | newest availabe message is fetched (false), oldest not yet read message is fetched (true) |
| queueSize | int | size of buffer, default = 1000 | | | queueSize | int | size of buffer, default = 1000 | | ||
| useEerosSystemTime | boolean | use system time or timestamp of message | | | useEerosSystemTime | boolean | use system time or timestamp of message | | ||
Line 39: | Line 39: | ||
| ::: | ::: | range_min | | | ::: | ::: | range_min | | ||
| ::: | ::: | range_max | | | ::: | ::: | range_max | | ||
+ | | AnalogOut | std_msgs:: | ||
+ | | ::: | sensor_msgs:: | ||
+ | | ::: | ::: | angle_max | | ||
+ | | ::: | ::: | angle_increment | | ||
+ | | ::: | ::: | time_increment | | ||
+ | | ::: | ::: | scan_time | | ||
+ | | ::: | ::: | range_min | | ||
+ | | ::: | ::: | range_max | | ||
+ | | DigIn | std_msgs:: | ||
+ | | DigOut | std_msgs:: | ||
- | AnalogOut & std\_msgs:: | + | You can find a complete example, including a *.json file, in the [[getting_started: |
- | + | ||
- | & sensor\_msgs:: | + | |
- | + | ||
- | & & angle\_max | + | |
- | + | ||
- | & & angle\_increment \\ | + | |
- | + | ||
- | & & time\_increment | + | |
- | + | ||
- | & & scan\_time | + | |
- | + | ||
- | & & range\_min | + | |
- | + | ||
- | & & range\_max | + | |
- | + | ||
- | DigIn & sensor\_msgs:: | + | |
- | + | ||
- | DigOut | + | |
- | + | ||
- | \end{tabular} | + | |
- | + | ||
- | \end{table} | + | |
- | + | ||
- | + | ||
- | + | ||
- | You can find a complete example, including a *.json file, in the eeros framework (/ | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | \subsection{How to use} | + | |
- | + | ||
- | Refere to the documentation of the EEROS HAL\footnote{http:// | + | |
- | + | ||
- | + | ||
- | + | ||
- | First initialize the HAL in your main function: | + | |
- | + | ||
- | \lstset{language=c} | + | |
- | + | ||
- | \begin{lstlisting} | + | |
- | + | ||
- | ... | + | |
- | + | ||
- | int main(int argc, char **argv) { | + | |
- | + | ||
- | ... | + | |
- | + | ||
- | // HAL | + | |
- | + | ||
- | // //////////////////////////////////////////////////////////////////////// | + | |
- | + | ||
- | HAL& hal = HAL:: | + | |
- | + | ||
- | hal.readConfigFromFile(& | + | |
- | + | ||
- | ... | + | |
- | + | ||
- | \end{lstlisting} | + | |
- | + | ||
- | + | ||
- | + | ||
- | Add the header file to your control system: | + | |
- | + | ||
- | \lstset{language=c} | + | |
- | + | ||
- | \begin{lstlisting} | + | |
- | + | ||
- | #include < | + | |
- | + | ||
- | \end{lstlisting} | + | |
- | + | ||
- | + | ||
- | + | ||
- | You can now declare \textit{PeripheralInputs} and \textit{PeripheralOutputs}: | + | |
- | + | ||
- | \lstset{language=c} | + | |
- | + | ||
- | \begin{lstlisting} | + | |
- | + | ||
- | PeripheralInput< | + | |
- | + | ||
- | PeripheralInput< | + | |
- | + | ||
- | PeripheralOutput< | + | |
- | + | ||
- | PeripheralOutput< | + | |
- | + | ||
- | \end{lstlisting} | + | |
- | + | ||
- | + | ||
- | + | ||
- | Call the constructor of the peripheral IOs with the \textit{signalID} used in the *.json file | + | |
- | + | ||
- | \begin{lstlisting} | + | |
- | + | ||
- | class MyControlSystem { | + | |
- | + | ||
- | public: | + | |
- | + | ||
- | MyControlSystem(double ts, ros:: | + | |
- | + | ||
- | dt(ts), | + | |
- | + | ||
- | ... | + | |
- | + | ||
- | analogIn0(" | + | |
- | + | ||
- | digitalIn0(" | + | |
- | + | ||
- | analogOut0(" | + | |
- | + | ||
- | digitalOut0(" | + | |
- | ... | ||
- | } |
eeros_architecture/hal/config_ros.txt · Last modified: 2023/02/27 14:44 by ursgraf