User Tools

Site Tools


eeros_architecture:hal:config_ros

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
Next revisionBoth sides next revision
eeros_architecture:hal:config_ros [2017/12/14 17:07] grafeeros_architecture:hal:config_ros [2017/12/14 18:32] – [Implemented Message Types] graf
Line 9: Line 9:
 | devHandle | string | e.g. testNodeHAL, this is the name of the node created by the HAL | | devHandle | string | e.g. testNodeHAL, this is the name of the node created by the HAL |
 | type | string | e.g. AnalogIn / AnalogOut / DigIn / DigOut | | type | string | e.g. AnalogIn / AnalogOut / DigIn / DigOut |
-| additionalArguments | string | & 'see next table                     & 'see next table'         \\ \bottomrule +| additionalArguments | string | see table below |
- +
-\end{tabular} +
- +
-\end{table} +
  
 +===== Additional Arguments =====
 +The ''additionalArguments'' are special arguments containing additional information about the communication with a ROS network. The next table shows all currently available arguments. ''topic'' and ''msgType'' are mandatory.
  
 ^ Keyword ^ Type ^ Remarks ^ ^ Keyword ^ Type ^ Remarks ^
- +| topic | string | topic to listen or subscribe | 
-The \textit{additionalArguments} are special arguments which are parsed in the wrapper library \textit{ros-eeros}. +| msgType | string | message type | 
- +| dataField | string | data member of message | 
-These arguments contain additional information which are necessary to communicate with a ROS network. +| callOne | boolean | ???? | 
- +| queueSize | int | size of buffer, default = 1000 | 
-All arguments are separated with a semicolon. +| useEerosSystemTime | boolean | use system time or timestamp of message |
- +
-The available arguments are listed in table \ref{tableAdditionalArgumentsEeros}. +
- +
  
 An example for an additional argument could be: An example for an additional argument could be:
 +<code>
 +  "additionalArguments": "topic=/testNode/TestTopic3; msgType=sensor_msgs::LaserScan; dataField=scan_time; callOne=false; queueSize=100"
 +</code>
  
 +===== Implemented Message Types =====
 +The table below shows all currently implemented message types and associated data fields. If your desired message type is not implemented yet, you can easily implement it yourself, see below.
  
 +^ type ^ msgType ^ dataField ^
 +| AnalogIn | std_msgs::Float64 | - |
 +| ::: | sensor_msgs::LaserScan | angle_min |
 +| ::: | ::: | angle_max |
 +| ::: | ::: | angle_increment |
 +| ::: | ::: | time_increment |
 +| ::: | ::: | scan_time |
 +| ::: | ::: | range_min |
 +| ::: | ::: | range_max |
 +| AnalogOut | std_msgs::Float64 | - |
 +| ::: | sensor_msgs::LaserScan | angle_min |
 +| ::: | ::: | angle_max |
 +| ::: | ::: | angle_increment |
 +| ::: | ::: | time_increment |
 +| ::: | ::: | scan_time |
 +| ::: | ::: | range_min |
 +| ::: | ::: | range_max |
 +| DigIn | std_msgs::BatteryState | present |
 +| DigOut | std_msgs::BatteryState | present |
  
-\begin{snugshade*} +You can find a complete example, including a *.json file, in the [[getting_started:tutorials:start|]].
- +
-\textit{\char"22additionalArguments\char"22: \char"22topic=/testNode/TestTopic3; msgType=sensor\_msgs::LaserScan; \\ +
- +
-dataField=scan\_time; callOne=false; queueSize=100\char"22,+
- +
-\end{snugshade*} +
- +
- +
- +
- +
- +
-Table \ref{tableAdditionalArgumentsEeros} shows all currently available \textit{additionalArguments}. +
- +
-\textbf{Topic} and \textbf{msgType} are mandatory arguments. +
- +
- +
- +
-\begin{table} +
- +
-\centering +
- +
-\caption{Additional arguments specific for ros-eeros} +
- +
-\label{tableAdditionalArgumentsEeros} +
- +
-\begin{tabular}{@{}lll@{}} +
- +
-\toprule +
- +
-Key        & Typical value           & Description                                \\ \midrule +
- +
-\textbf{topic}      & /testNode/TestTopic1    & Topic to listen / subscribe                \\ +
- +
-\textbf{msgType }   & sensor\_msgs::LaserScan & ROS message type of topic                  \\  +
- +
-dataField & scan\_time              & Desired data member of message             \\ +
- +
-callOne    & true                    & Oldest, not yet fetched message is fetched \\ +
- +
-callOne    & false                   & Newest available message is fetched        \\ +
- +
-queueSize  & 1000                    & Size of buffer; queueSize=1000 if omitted  \\  +
- +
-useEerosSystemTime  & fals           & Use system time or timestamp of received msg  \\ \bottomrule +
- +
-\end{tabular} +
- +
-\end{table} +
- +
- +
- +
-In table \ref{tableImplementedMsgTypes} are all currently implemented message types and associated data fields. +
- +
-If your desired message type is not implemented yet, you can easily implement it yourself. +
- +
-See chapter \ref{sectionImplementMsgType} for a guide to implement additional message types and data fields in \textit{ros-eeros}. +
- +
- +
- +
-\begin{table}[] +
- +
-\centering +
- +
-\caption{Currently implemented message types in ros-eeros} +
- +
-\label{tableImplementedMsgTypes} +
- +
-\begin{tabular}{lll} +
- +
-\cline{2-3} +
- +
-HAL type  & msgType                    & dataField        \\ \cline{2-3}  +
- +
-AnalogIn  & std\_msgs::Float64         & -                \\ +
- +
-          & sensor\_msgs::LaserScan    & angle\_min       \\ +
- +
-          &                            & angle\_max       \\ +
- +
-          &                            & angle\_increment \\ +
- +
-          &                            & time\_increment  \\ +
- +
-          &                            & scan\_time       \\ +
- +
-          &                            & range\_min       \\ +
- +
-          &                            & range\_max       \\ +
- +
-AnalogOut & std\_msgs::Float64         & -                \\ +
- +
-          & sensor\_msgs::LaserScan    & angle\_min       \\ +
- +
-          &                            & angle\_max       \\ +
- +
-          &                            & angle\_increment \\ +
- +
-          &                            & time\_increment  \\ +
- +
-          &                            & scan\_time       \\ +
- +
-          &                            & range\_min       \\ +
- +
-          &                            & range\_max       \\ +
- +
-DigIn     & sensor\_msgs::BatteryState & present          \\ +
- +
-DigOut    & sensor\_msgs::BatteryState & present          \\ \cline{2-3}  +
- +
-\end{tabular} +
- +
-\end{table} +
- +
- +
- +
-You can find a complete example, including a *.json file, in the eeros framework (/examples/hal/Ros*).+
  
 +===== How to Use the  =====
  
  
Line 163: Line 65:
 First initialize the HAL in your main function: First initialize the HAL in your main function:
  
-\lstset{language=c} +<code cpp>
- +
-\begin{lstlisting} +
 ... ...
  
Line 182: Line 81:
  
  ...  ...
- +</code>
-\end{lstlisting} +
  
  
Line 201: Line 98:
 You can now declare \textit{PeripheralInputs} and \textit{PeripheralOutputs}: You can now declare \textit{PeripheralInputs} and \textit{PeripheralOutputs}:
  
-\lstset{language=c} +<code cpp>
- +
-\begin{lstlisting} +
  PeripheralInput<double> analogIn0;  PeripheralInput<double> analogIn0;
  
Line 212: Line 106:
  
  PeripheralOutput<bool> digitalOut0;  PeripheralOutput<bool> digitalOut0;
- +</code>
-\end{lstlisting}+
  
  
Line 219: Line 112:
 Call the constructor of the peripheral IOs with the \textit{signalID} used in the *.json file Call the constructor of the peripheral IOs with the \textit{signalID} used in the *.json file
  
-\begin{lstlisting}+<code cpp>
  
 class MyControlSystem { class MyControlSystem {
Line 242: Line 135:
  
 } }
 +</code>
eeros_architecture/hal/config_ros.txt · Last modified: 2023/02/27 14:44 by ursgraf