eeros_architecture:hal:config_ros
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
eeros_architecture:hal:config_ros [2017/12/14 18:34] – [How to Use the] graf | eeros_architecture:hal:config_ros [2023/02/27 14:44] (current) – [Configuration File for ROS] ursgraf | ||
---|---|---|---|
Line 3: | Line 3: | ||
As described in [[getting_started: | As described in [[getting_started: | ||
The EEROS HAL digital and analog inputs and outputs can be defined as usual in a JSON file. In this file you specify into which message type these signals get packed. There are hundreds of different message types in ROS and it is possible to create custom types. For this reason, we currently support only a few by default. If one wishes to use other message types, the wrapper library can easily be extended. | The EEROS HAL digital and analog inputs and outputs can be defined as usual in a JSON file. In this file you specify into which message type these signals get packed. There are hundreds of different message types in ROS and it is possible to create custom types. For this reason, we currently support only a few by default. If one wishes to use other message types, the wrapper library can easily be extended. | ||
+ | |||
+ | WARNING | ||
+ | The naming of messages changes from ROS1 to ROS2, e.g. | ||
+ | * ROS1: std_msgs:: | ||
+ | * ROS2: std_msgs:: | ||
+ | The information below is for ROS1. Change accordingly for ROS2. | ||
The keywords for the EEROS-ROS wrapper library must be set as follows: | The keywords for the EEROS-ROS wrapper library must be set as follows: | ||
Line 18: | Line 24: | ||
| 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 52: | Line 58: | ||
You can find a complete example, including a *.json file, in the [[getting_started: | You can find a complete example, including a *.json file, in the [[getting_started: | ||
- | ===== How to Use the ===== | ||
- | |||
- | You can now declare \textit{PeripheralInputs} and \textit{PeripheralOutputs}: | ||
- | |||
- | <code cpp> | ||
- | PeripheralInput< | ||
- | |||
- | PeripheralInput< | ||
- | |||
- | PeripheralOutput< | ||
- | |||
- | PeripheralOutput< | ||
- | </ | ||
- | |||
- | |||
- | |||
- | Call the constructor of the peripheral IOs with the \textit{signalID} used in the *.json file | ||
- | |||
- | <code cpp> | ||
- | |||
- | class MyControlSystem { | ||
- | |||
- | public: | ||
- | |||
- | MyControlSystem(double ts, ros:: | ||
- | |||
- | dt(ts), | ||
- | |||
- | ... | ||
- | |||
- | analogIn0(" | ||
- | |||
- | digitalIn0(" | ||
- | |||
- | analogOut0(" | ||
- | |||
- | digitalOut0(" | ||
- | |||
- | ... | ||
- | |||
- | } | ||
- | </ |
eeros_architecture/hal/config_ros.1513272875.txt.gz · Last modified: 2017/12/14 18:34 (external edit)