====== Hardware Abstraction Layer ====== The HAL provides an interface between the robot control system (consisting of control system, safety system, and sequencer) and the hardware of the robot. Any signal from a hardware input or output must pass through the HAL. * [[eeros_architecture:hal:using_hal|]] * [[eeros_architecture:hal:configuration_file|]] * [[eeros_architecture:hal:scaling|]] * [[eeros_architecture:hal:scaling_multi|]] * [[eeros_architecture:hal:config_ros|]] * [[eeros_architecture:hal:feature_functions|]] * [[eeros_architecture:hal:hardware_libraries|]] * [[eeros_architecture:hal:hardware_libraries_sim|]] * [[eeros_architecture:hal:input_devices|]] ===== Configuration of the HAL ===== The inputs and outputs of the system are given by a specific hardware setup. This can vary widely among different systems. To account for many possible hardware settings we use a configuration file. This file describes the current hardware together with the necessary library to access them, see [[Configuration File]]. The configuration given in the file can be loaded as follows: HAL& hal = HAL::instance(); hal.readConfigFromFile(std::string file); Most probably you want to pass the configuration file name via parameters to ''main'' with: HAL& hal = HAL::instance(); hal.readConfigFromFile(&argc, argv); Now, you can pass the configuration file with $ ./myApplication -c /path/to/config/NameOfConfigurationFile Note: This HAL option has to be the first option if additional command line options are used. This call causes the following actions: * the configuration file will be parsed * the necessary hardware libraries will be loaded * for each channel an appropriate object is created with the id given in the configuration file * these objects will be registered in the HAL manager ===== Available HAL Objects ===== All input objects of the HAL have a common type base type ''InputInterface'' while the output objects have a common type ''OutputInterface''. Digital inputs or outputs are of type ''Input'' or ''Output'' respectively. Analog inputs or outputs are of type ''ScalableInput'' or ''ScalableOutput'' respectively. \\ The following functions are available: OutputInterface* getOutput(std::string name, bool exclusive = true); Output* getLogicOutput(std::string name, bool exclusive = true); ScalableOutput* getScalableOutput(std::string name, bool exclusive = true); InputInterface* getInput(std::string name, bool exclusive = true); Input* getLogicInput(std::string name, bool exclusive = true); ScalableInput* getScalableInput(std::string name, bool exclusive = true);