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 revisionBoth sides next revision
eeros_architecture:hal:config_ros [2017/12/14 18:34] – [How to Use the] grafeeros_architecture:hal:config_ros [2017/12/14 18:35] – [How to Use the] graf
Line 52: Line 52:
 You can find a complete example, including a *.json file, in the [[getting_started:tutorials:start|]]. You can find a complete example, including a *.json file, in the [[getting_started:tutorials:start|]].
  
-===== How to Use the  ===== 
  
- 
-You can now declare \textit{PeripheralInputs} and \textit{PeripheralOutputs}: 
- 
-<code cpp> 
- PeripheralInput<double> analogIn0; 
- 
- PeripheralInput<bool> digitalIn0; 
- 
- PeripheralOutput<double> analogOut0; 
- 
- PeripheralOutput<bool> digitalOut0; 
-</code> 
- 
- 
- 
-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::NodeHandle& rosNodeHandler): 
- 
- dt(ts), 
- 
- ... 
- 
- analogIn0("scanTimeIn0"), // argument has to match signalId of json 
- 
- digitalIn0("batteryPresent0"), 
- 
- analogOut0("scanTimeEchoOut0"), 
- 
- digitalOut0("batteryPresentEchoOut0"), 
- 
- ... 
- 
-} 
-</code> 
eeros_architecture/hal/config_ros.txt · Last modified: 2023/02/27 14:44 by ursgraf