### Install Examples Source: https://eclipse.dev/openpass/content/html/installation_guide/further_guidance/10_cmake If set to ON, `opSimulation` configuration examples are copied to the `examples` folder within the installation directory during the installation step. ```cmake option(INSTALL_EXAMPLES "Install examples" ON) ``` -------------------------------- ### C++ Input/Output Signal Handling Example Source: https://eclipse.dev/openpass/content/html/developer_information/30_coding_conventions This C++ code demonstrates the recommended abstraction for input and output signal transmission using maps of ComponentPort pointers, showing how to set and get signal values. ```cpp std::map outputPorts; bool success = outputPorts.at(localLinkId)->SetSignalValue(data); std::map inputPorts; bool success = inputPorts.at(localLinkId)->GetSignalValue(data); ``` -------------------------------- ### Verify Docker Installation Source: https://eclipse.dev/openpass/content/html/developer_information/ide_support/30_vscode Commands to verify the Docker installation and its version on both Windows (via WSL) and Linux environments. ```bash wsl -d Ubuntu docker -H unix:///var/run/docker.sock --version docker --version ``` -------------------------------- ### Install WSL and Ubuntu on Windows Source: https://eclipse.dev/openpass/content/html/developer_information/ide_support/30_vscode Installs the Windows Subsystem for Linux (WSL) and the Ubuntu distribution, which is a prerequisite for running Docker on Windows for development. ```bash wsl --install wsl --list --online wsl --install -d wsl -l -v wsl --set-version 2 ``` -------------------------------- ### Build and Install Simulation Core (Make) Source: https://eclipse.dev/openpass/content/html/installation_guide/30_install_openpass Compiles the openPASS simulation core and installs it. The '-j3' flag enables parallel building for faster compilation. ```make make -j3 install ``` -------------------------------- ### Install Docker on Ubuntu (WSL) Source: https://eclipse.dev/openpass/content/html/developer_information/ide_support/30_vscode Installs Docker CE on an Ubuntu distribution within WSL, including adding necessary repositories and configuring user permissions. This enables containerized development. ```bash . /etc/os-release curl -fsSL https://download.docker.com/linux/${ID}/gpg | sudo tee /etc/apt/trusted.gpg.d/docker.asc echo "deb [arch=amd64] https://download.docker.com/linux/${ID} ${VERSION_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/docker.list sudo apt update sudo apt install docker-ce docker-ce-cli containerd.io sudo usermod -aG docker $USER sudo dockerd echo -e "[network]\ngenerateResolvConf = false" | sudo tee -a /etc/wsl.conf sudo unlink /etc/resolv.conf echo nameserver 1.1.1.1 | sudo tee /etc/resolv.conf update-alternatives --config iptables ``` -------------------------------- ### Build Documentation (Make) Source: https://eclipse.dev/openpass/content/html/installation_guide/30_install_openpass Generates the documentation for openPASS. This step is required before installation if WITH_DOC is enabled. ```make make doc ``` -------------------------------- ### Execute Dependency Installation Script (Windows) Source: https://eclipse.dev/openpass/content/html/_sources/installation_guide/20_install_prerequisites.rst Navigates to the scripts directory and executes the 15_prepare_thirdParty.sh script to install dependencies on Windows using MSYS. ```shell cd utils/ci/scripts ./15_prepare_thirdParty.sh ``` -------------------------------- ### ClangFormat Installation Commands Source: https://eclipse.dev/openpass/content/html/developer_information/30_coding_conventions Provides commands for installing ClangFormat on Windows using 'pacman' and on Linux (Debian/Ubuntu) using 'apt'. These commands ensure the tool is available for code formatting. ```bash pacman -S mingw-w64-x86_64-clang apt -y install clang-format ``` -------------------------------- ### Scenery Configuration Example (XML) Source: https://eclipse.dev/openpass/content/html/_sources/user_guide/configs/scenery.rst Provides a full example of a SceneryConfiguration.xodr file, demonstrating the structure and content required for defining road networks and static objects according to the ASAM OpenDRIVE 1.6 standard. This example includes line numbers for easy reference. ```xml
``` -------------------------------- ### Install Docker (Bash) Source: https://eclipse.dev/openpass/content/html/_sources/developer_information/ide_support/30_vscode.rst Installs Docker on a Linux system using the apt package manager. It first updates the package list and then installs the 'docker.io' package. The snippet also includes a command to add the user to the 'docker' group for non-sudo Docker usage. ```bash sudo apt update sudo apt install docker.io sudo usermod -aG docker ``` -------------------------------- ### Install MSYS2 Binary Packages for OpenPASS (Windows) Source: https://eclipse.dev/openpass/content/html/installation_guide/20_install_prerequisites A comprehensive list of pacman commands to install all required binary packages for building, running, and documenting OpenPASS on Windows using MSYS2. Includes packages for the simulator, documentation, testing, and development. ```bash pacman -S \ # for building and running the simulator make \ mingw-w64-x86_64-ccache \ mingw-w64-x86_64-cmake \ mingw-w64-x86_64-doxygen \ mingw-w64-x86_64-gcc \ mingw-w64-x86_64-gdb \ mingw-w64-x86_64-graphviz \ mingw-w64-x86_64-make \ patch \ # for documentation mingw-w64-x86_64-python \ mingw-w64-x86_64-python-pip \ mingw-w64-x86_64-python-lxml \ # fonts and equation rendering in the documentation mingw-w64-x86_64-texlive-bin \ mingw-w64-x86_64-texlive-core \ mingw-w64-x86_64-texlive-font-utils \ mingw-w64-x86_64-texlive-latex-extra \ mingw-w64-x86_64-zziplib \ # documentation with only pacman libxslt-devel \ mingw-w64-x86_64-python-sphinx \ mingw-w64-x86_64-python-sphinx-tabs \ mingw-w64-x86_64-python-sphinx_rtd_theme \ mingw-w64-x86_64-python-setuptools \ mingw-w64-x86_64-python-myst-parser \ # for testing (optional) mingw-w64-x86_64-python-pytest \ mingw-w64-x86_64-python-pandas \ # for developing purposes (optional) mingw-w64-x86_64-clang ``` -------------------------------- ### Install Binary Packages for OpenPASS Simulator (Linux) Source: https://eclipse.dev/openpass/content/html/_sources/installation_guide/20_install_prerequisites.rst Installs essential binary packages required for the OpenPASS simulator on a Linux system using apt. This includes build tools, development libraries, and runtime environments. ```bash # for simulator apt -y install antlr4 apt -y install build-essential apt -y install ca-certificates apt -y install ccache apt -y install cmake apt -y install clang-format-15 apt -y install doxygen apt -y install g++ apt -y install gcc apt -y install git apt -y install googletest apt -y install graphviz apt -y install libboost-filesystem-dev apt -y install libprotobuf-dev apt -y install libantlr4-runtime4.9 apt -y install libantlr4-runtime-java apt -y install libantlr4-runtime-dev apt -y install openjdk-17-jre apt -y install pkg-config apt -y install protobuf-compiler apt -y install python3 apt -y install python3-distutils apt -y install python3-pip apt -y install uuid-dev ``` -------------------------------- ### C/C++ Code Example with Documentation Source: https://eclipse.dev/openpass/content/html/developer_information/30_coding_conventions A complete C code example demonstrating the application of file headers, constants, multi-line comments, and parameter documentation for a function that calculates the area of a circle. ```c /// @file main.c #include /// Mathematical constant PI #define PI 3.1415 /// Radius in meters #define RADIUS_M 7.82 //! Calculates the area of the circle. //! //! @param[in] radius Radius of the circle //! @param[out] area Area of the circle float CalculateArea(float radius) { float area; area = PI * radius * radius; return area; } ``` -------------------------------- ### Full Simulation Configuration Example (XML) Source: https://eclipse.dev/openpass/content/html/_sources/user_guide/configs/simulationconfig.rst A comprehensive example demonstrating the complete structure of a simulation configuration file, including environment, turning rates, observations, and spawners. ```xml THE_OBSERVATION_LIBRARY ``` -------------------------------- ### Initialize Agent with Teleport and Follow Route Actions (XML) Source: https://eclipse.dev/openpass/content/html/user_guide/configs/scenario This example shows how to initialize an agent ('Ego') with a starting position via TeleportAction and then assign it a specific path using FollowRouteAction. The TeleportAction is crucial for spawning, and FollowRouteAction dictates the agent's trajectory. The example includes multiple waypoints to define the route. ActivateControllerAction enables control. ```xml ``` -------------------------------- ### Example: Create openscenario_engine Conan Package Source: https://eclipse.dev/openpass/content/html/installation_guide/60_conan An example of the 'conan create' command to build the 'openscenario_engine' package with version 0.1, user 'openpass', and channel 'testing'. It includes the '--build=missing' flag and specifies a default Conan profile. ```shell $ conan create . --name openscenario_engine --version 0.1 --user openpass --channel testing --build=missing -pr:a default ``` -------------------------------- ### Input Port Signal Reception Example - C++ Source: https://eclipse.dev/openpass/content/html/_sources/developer_information/30_coding_conventions.rst Illustrates the process of receiving signal data from an input port using a map of component ports. It demonstrates the typical pattern for getting signal values. ```cpp std::map inputPorts; // ... assume inputPorts is populated ... bool success = inputPorts.at(localLinkId)->GetSignalValue(data); ``` -------------------------------- ### Example SSP Connection Definition in XML Source: https://eclipse.dev/openpass/content/html/_sources/advanced_topics/simulator/system_structure_and_parameterization_%28SSP%29.rst This snippet shows how connections between components within an SSP (System Structure Protocol) are defined in an XML-based SSD (System Structure Description) file. It illustrates a connection between two internal components, specifying the start and end points of the connection. ```xml suppressUnitConversion="false"/> ``` -------------------------------- ### XML Parameter Definition Example Source: https://eclipse.dev/openpass/content/html/_sources/user_guide/configs/systemconfigblueprint.rst This snippet demonstrates how to define parameters within a SystemConfigBlueprint file using XML. It includes examples for string parameters and parameters with normal distribution values, specifying mean, standard deviation, and range. ```xml StringParameter string Lorem ipsum RandomParameter normalDistribution 15.0 2.5 10.0 20.0 ``` -------------------------------- ### Build and Install openPASS Source: https://eclipse.dev/openpass/content/html/installation_guide/further_guidance/10_cmake Standard make targets for building and installing the openPASS project. `make` builds the project, `make install` installs it, and `make ` builds a specific module or component. ```bash make make install make ``` -------------------------------- ### Configure CMake Target and opSimulation Debugging (launch.json) Source: https://eclipse.dev/openpass/content/html/developer_information/ide_support/30_vscode Defines launch configurations for debugging CMake targets and the 'opsimulation' executable. This JSON file is used by VS Code's C++ debugging extensions. It specifies program paths, arguments, working directories, and debugger settings. Ensure 'make install' is run before debugging 'opsimulation'. ```json { "version": "0.2.0", "configurations": [ { "name": "CMake Target", "type": "cppdbg", "request": "launch", "program": "${command:cmake.launchTargetPath}", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [ { "name": "PATH", "value": "$PATH:${command:msys2.root}\bin;${command:mingw64.root}\x86_64-w64-mingw32\lib${command:cmake.buildkit.launch.path}" } ], "externalConsole": false, "MIMode": "gdb", "miDebuggerPath": "${command:cmake.buildkit.gdb.exe}", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ] }, { "name": "opsimulation", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}\bin\core\opSimulation.exe", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}\bin\core", "environment": [ { "name": "PATH", "value": "$PATH:${command:msys2.root}\bin;${command:mingw64.root}\x86_64-w64-mingw32\lib${command:cmake.buildkit.launch.path}" } ], "externalConsole": false, "MIMode": "gdb", "miDebuggerPath": "${command:cmake.buildkit.gdb.exe}", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ] } ] } ``` ```json { "version": "0.2.0", "configurations": [ { "name": "CMake Target", "type": "cppdbg", "request": "launch", "program": "${command:cmake.launchTargetPath}", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", "externalConsole": false, "MIMode": "gdb", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ] }, { "name": "opsimulation", "type": "cppdbg", "request": "launch", "program": "/usr/local/openPASS/bin/core/opSimulation", "args": [], "stopAtEntry": false, "cwd": "/usr/local/openPASS/bin/core/", "externalConsole": false, "MIMode": "gdb", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ] } ] } ``` -------------------------------- ### Create Conan Package from Source Source: https://eclipse.dev/openpass/content/html/installation_guide/60_conan Demonstrates the basic syntax for creating a Conan package from source code using the 'conan create' command. It specifies the path to the recipe, package name, version, user, channel, build options, and profile. ```shell $ conan create --name $pkg --version $version --user $user --channel $channel --build=missing $packageOptions -pr:a "$conanprofile" ``` -------------------------------- ### Install System Runtime Dependencies Source: https://eclipse.dev/openpass/content/html/installation_guide/further_guidance/10_cmake During the installation step, this configuration copies detected system runtime dependencies (e.g., MinGW system libraries) to the install directory. On Windows, automatic resolution might fail if other MinGW instances are installed; explicitly setting `CMAKE_PREFIX_PATH` is recommended. ```cmake option(INSTALL_SYSTEM_RUNTIME_DEPS "Install system runtime dependencies" OFF) ``` -------------------------------- ### Build and Execute Unit Tests (Make) Source: https://eclipse.dev/openpass/content/html/installation_guide/30_install_openpass Compiles and runs the unit tests for openPASS. The ARGS parameter allows for customization, such as parallel execution. ```make make test ARGS="--output-on-failure -j3" ``` -------------------------------- ### Install Docker on Windows using PowerShell (WSL) Source: https://eclipse.dev/openpass/content/html/_sources/developer_information/ide_support/30_vscode.rst This snippet provides PowerShell commands to install Windows Subsystem for Linux (WSL) and then install Docker within an Ubuntu distribution. It covers checking WSL version and installing necessary packages for Docker. ```powershell wsl --install wsl --list --online wsl --install -d wsl -l -v wsl --set-version 2 ``` -------------------------------- ### Setting CMAKE_PREFIX_PATH for Dependencies (Bash) Source: https://eclipse.dev/openpass/content/html/_sources/installation_guide/further_guidance/10_cmake.rst This bash command demonstrates how to set the CMAKE_PREFIX_PATH variable to specify the installation prefixes for project dependencies. It is crucial for CMake to locate necessary libraries and packages, especially when using non-standard versions or custom builds. The example shows different paths for Windows (using MSYS Makefiles) and Linux, highlighting the need to escape semicolons on Linux. ```bash cmake -G "MSYS Makefiles" -D CMAKE_PREFIX_PATH="\ /mingw64/bin;\ $PWD/../deps/thirdParty/win64/FMILibrary;\ $PWD/../deps/thirdParty/win64/osi; $PWD/../deps/thirdParty/win64/minizip; -D .. ``` ```bash cmake -D CMAKE_PREFIX_PATH=\ $PWD/../deps/thirdParty/linux64/FMILibrary\; $PWD/../deps/thirdParty/linux64/osi\; $PWD/../deps/thirdParty/linux64/minizip\ -D \ .. ``` -------------------------------- ### Parametrize FMU with ParameterSet (XML) Source: https://eclipse.dev/openpass/content/html/advanced_topics/simulator/system_structure_and_parameterization_%28SSP%29 This example illustrates how to parametrize FMUs within an SSD component using a ParameterSet. It defines various parameters such as Logging, CsvOutput, and Input_OSMPSensorViewIn with their respective data types and values. ```xml ``` -------------------------------- ### Install Extra Runtime Dependencies Source: https://eclipse.dev/openpass/content/html/installation_guide/further_guidance/10_cmake During the installation step, this configuration copies detected runtime dependencies (e.g., required shared libraries) specified in `CMAKE_PREFIX_PATH` to the install directory. ```cmake option(INSTALL_EXTRA_RUNTIME_DEPS "Install extra runtime dependencies" OFF) ``` -------------------------------- ### Install Python Packages for OpenPASS Development (Linux) Source: https://eclipse.dev/openpass/content/html/_sources/installation_guide/20_install_prerequisites.rst Installs Python packages required for OpenPASS development and testing using pip3. This includes testing frameworks, documentation generators, and linters. ```bash # python packages pip3 install "approvaltests==3.1.0" empty-files "conan>2.0" watchdog pip3 install breathe exhale myst-parser "sphinx==7.2.6" sphinx-rtd-theme sphinx-tabs sphinxcontrib-spelling ``` -------------------------------- ### Install Python Packages for OpenPASS (Windows) Source: https://eclipse.dev/openpass/content/html/installation_guide/20_install_prerequisites Installs essential Python packages required for OpenPASS development and testing using pip3. This includes libraries for testing, dependency management (conan), and documentation generation. ```python pip3 install "approvaltests==3.1.0" breathe "conan>2.0" empty-files exhale watchdog ```