User Tools

Site Tools


getting_started:overview

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
getting_started:overview [2017/03/17 08:57] – [Control System] grafgetting_started:overview [2017/04/07 13:06] – [Hardware Abstraction Layer (HAL)] graf
Line 51: Line 51:
 ==== Hardware Abstraction Layer (HAL)==== ==== Hardware Abstraction Layer (HAL)====
  
-The HAL provides an interface between the program and the robot. Any command in the program must pass through the HAL in order to be carried out. Additionally, any inputs from sensors have to use the HAL to interact with the program. +The HAL provides an interface between the program and the robot. Any command in the program must pass through the HAL in order to be carried out. Additionally, any inputs from sensors have to use the HAL to interact with the program. In order to make eeros platform independent and runnable on any hardware system, a configuration file is used to describe the physical properties of the inputs and outputs. Such an in- or output could be connected through a plethora of busses such as PCIe, SPI or EtherCAT. For further information see [[eeros_architecture:hal:start|]].
  
-<box 100% green> 
-The safety system and the HAL are strongly coupled together. Make sure that all inputs and outputs in the HAL are handled by the safety system. 
-</box> 
- 
-=== Getting the HAL === 
-<code c> 
-  HAL& hal = HAL::instance(); 
-</code> 
- 
-=== Inputs and Outputs === 
-All input and output should be observed by the safety system. The safety system decides if a in- or output can be applied or not.  
- 
-  * Define inputs and outputs: 
-To access the digital I/O hardware within the comedi framework, you have to define the inputs and outputs and add them to the HAL. 
-<code c> 
-  ComediDevice* comedi0 = new ComediDevice("/dev/comedi0"); 
-  ComediDevice* comedi1 = new ComediDevice("/dev/comedi1"); 
-   
-  hal.addSystemInput(new ComediFqd("q0", comedi0, 11, 8, 10, 9, 6.28318530718 / (4 * 4096.0), 0, 0));   
-  hal.addSystemOutput(new ComediDigOut("watchdog", comedi1, 2, 22)); 
-  hal.addSystemOutput(new ComediDigOut("enable0", comedi0, 2, 24)); 
-  hal.addSystemOutput(new ComediDigOut("brake0", comedi1, 2, 4, true)); 
-</code> 
- 
-  * **Note:** The class //SystemInput<T>// and //SystemOutput<T>// are template classes. If you define a input or an output as boolean or double, it should really be a boolean (on or off) or a double (e.g. voltage) on the hardware.  
  
  
getting_started/overview.txt · Last modified: 2021/04/01 14:04 by jonasfrei