asam-ev / qc-framework

Mozilla Public License 2.0
15 stars 8 forks source link

Support to use Configuation GUI in Linux #16

Closed andreaskern74 closed 1 week ago

andreaskern74 commented 6 months ago

Is your feature request related to a problem? Please describe.

Currently, the Configuration GUI runs only in Windows, because when calling the Checker Bundle executables (to determine the configuration), it expects the file ending .exe. Additionally, the whole runtime to start the check and reporting is also included and has the same restrictions (will be removed with #15).

Describe the solution you'd like

Support for selecting/configuring Checker Bundles in Linux. The call of them is part of #15.

Describe alternatives you've considered

Take a look into the discussion/decision in #11, because if we decide to use manifest files as basis for including Checker Libraries into the framework, then the whole process of registering Checker Bundles / Report Modules change.

MatteoRagni commented 6 months ago

I'm leaving here some notes for compiling under Linux Ubuntu 22.04 LTS. I'm not inserting the instructions in the project because a little more testing is required before converting the notes into actual project instructions.

Unofficial Compile instructions for Ubuntu 22.04 LTS and GCC-11.4

Prerequisites

Install required package for the project. We assume that you have already installed build-essentials and a recent version of cmake (I used 3.28.3) from Kitware repository.

System packages

Additional packages required for compiling the project are:

sudo apt update
sudo apt install \
  qtbase5-dev \
  libqt5xmlpatterns5-dev \
  libxerces-c-dev \
  pkg-config

dev_essential

Moreover, cariad-tech dev_essential is required. In particular, you should checkout to release/v1.1.1 tag.

Once cloned and entered in the dev_essential directory:

mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/dev_essential ..
make install  # you need write permissions on /opt

Schemas

Create a directory schemas with two subdirectories, xodr and insert in here .xsdfiles as downloaded from ASAM public releases. My files are organized as follows:

ls -R schemas
schemas:
xodr  xosc

schemas/xodr:
opendrive_11.xsd  opendrive_16_core.xsd      opendrive_16_road.xsd      opendrive_17_object.xsd
opendrive_12.xsd  opendrive_16_junction.xsd  opendrive_16_signal.xsd    opendrive_17_railroad.xsd
opendrive_13.xsd  opendrive_16_lane.xsd      opendrive_17_core.xsd      opendrive_17_road.xsd
opendrive_14.xsd  opendrive_16_object.xsd    opendrive_17_junction.xsd  opendrive_17_signal.xsd
opendrive_15.xsd  opendrive_16_railroad.xsd  opendrive_17_lane.xsd

schemas/xosc:
openscenario_100.xsd  openscenario_111.xsd

Compile and Install

We need to patch CMakeFile.txt of the qc-framework project to convince cmake that we actually have libraries for XercesC. The patch uses pkg-config to find the requirement:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c5d8339..60f1f97 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,7 +43,6 @@ elseif()
 endif()

 find_package(dev_essential REQUIRED)
-find_package(XercesC REQUIRED)

 # QT
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -51,6 +50,13 @@ set(CMAKE_AUTOUIC ON)
 set(CMAKE_AUTORCC ON)
 find_package(Qt5 REQUIRED COMPONENTS Gui Xml Network XmlPatterns Widgets)

+find_package(XercesC)
+if (NOT XercesC_FOUND)
+    find_package(PkgConfig REQUIRED)
+    pkg_check_modules(XercesC REQUIRED IMPORTED_TARGET xerces-c)
+    add_library(XercesC::XercesC ALIAS PkgConfig::XercesC)
+endif()
+
 # Add subdirectories
 add_subdirectory(doc)
 add_subdirectory(src)

Once patch is applied we can go on and compile the project, providing helping location for both Qt5 and dev_essential:

mkdir build
cd build

export dev_essential_DIR=/opt/dev_essential/lib/cmake/dev_essential
export Qt5_DIR=/usr/lib/x86_64-linux-gnu/cmake/Qt5

cmake -DASAM_OPENDRIVE_XSD_DIR=../schemas/xodr \
      -DASAM_OPENSCENARIO_XSD_DIR=../schemas/xosc \
      -DCMAKE_INSTALL_PREFIX=/opt/qcframework ..
make install  # you need write permissions on /opt

That's it folks!

ClemensLinnhoff commented 3 months ago

Why do I need the dev_essential? And why do I need write permissions on opt?

Is it planned to make the Linux install more intuitive? To be honest I expected to do the usual

mkdir build
cd build
cmake ..
cmake --build .
hoangtungdinh commented 3 months ago

Hi @ClemensLinnhoff , over the past few weeks, the framework has been updated and the dev_essential dependency has been removed. Currently, the software can be installed as follows.

      - name: Install dependencies
        working-directory: dependencies
        run: |
          echo "Installing Dependencies..."
          sudo apt update
          sudo apt install \
            g++ \
            g++-10 \
            make \
            build-essential \
            cmake \
            libgtest-dev \
            qtbase5-dev \
            libqt5xmlpatterns5-dev \
            libxerces-c-dev \
            pkg-config
          echo "Dependencies installed."
        shell: bash

      - name: Build framework
        run: |
          echo Building framework...
          cmake -G "Unix Makefiles" -B./build -S . \
            -DCMAKE_INSTALL_PREFIX="/home/$(whoami)/qc-build" \
            -DENABLE_FUNCTIONAL_TESTS=$TEST_ENABLED  -DXERCES_ROOT="/usr" \
            -DQt5_DIR="/usr/lib/x86_64-linux-gnu/cmake/Qt5/" \
            -DQt5XmlPatterns_DIR="/usr/lib/x86_64-linux-gnu/cmake/Qt5XmlPatterns/"
          cmake --build ./build --target install --config Release -j4
          cmake --install ./build
          echo Done.
        shell: bash

https://github.com/asam-ev/qc-framework/blob/develop/.github/workflows/build-on-change-linux-bare.yaml#L47-L79

ClemensLinnhoff commented 3 months ago

Ah perfect, thanks. It would be great, if you could add that to the install documentation.

ClemensLinnhoff commented 3 months ago

But the ConfigGUI still is not supported under Ubuntu, right?

Are there any example to write my own configurations without the GUI? The documentation states that I can use the shell scripts "CheckXodr.sh and CheckXosc.sh" but I cannot find them. The doc also states that there are default configurations DefaultXodrConfiguration.xml and DefaultXoscConfiguration.xml which I also cannot find.

hoangtungdinh commented 3 months ago

Hi @ClemensLinnhoff, currently, it is possible to use the ConfigGUI in Ubuntu. However, we have removed the responsibility of executing checker bundles from the ConfigGUI, following https://github.com/asam-ev/qc-framework/issues/15.

Currently, the ConfigGUI is only for users to interactively create and save a configuration file. Therefore, it is also possible to manually create a configuration file in the XML format, following the predefined schema.

Here is an example of a configuration file.

We will soon release a ready-to-use Docker-based demo pipeline that demonstrates the complete workflow of the framework. We will also update the documentation, as you suggested in https://github.com/asam-ev/qc-framework/issues/83, so that anyone can build their own checker bundle and integrate it into the framework.

ClemensLinnhoff commented 3 months ago

Thanks for the update. Then I will just wait for a couple of weeks for the updated documentation. I know that the framework is still under development. I was just eager to try it out.

hoangtungdinh commented 2 months ago

Hi @ClemensLinnhoff, we have finished the Docker based demo pipeline. You can test the current framework on OpenScenario XML and OpenDrive files using this demo pipeline. Please let me know if you have any feedback.

ClemensLinnhoff commented 2 months ago

I tested the docker pipeline with the example files. The result thes are created but they don't contain any issues. Is that just because the files are valid? In that case, could you provide examples, that generate errors?

ClemensLinnhoff commented 2 months ago

And this still does not explain how I can set up my own configuration using my own checker bundles in a pipeline.

ClemensLinnhoff commented 2 months ago

currently, it is possible to use the ConfigGUI in Ubuntu

I pulled the latest commit of the develop branch. And the ConfigGUI is still not built. At least it is not in the bin folder, where the ReportGUI is.

MatteoRagni commented 2 months ago

currently, it is possible to use the ConfigGUI in Ubuntu

I pulled the latest commit of the develop branch. And the ConfigGUI is still not built. At least it is not in the bin folder, where the ReportGUI is.

@ClemensLinnhoff just tested on linux, and it is not creating the gui, as you are reporting.

If you modify file https://github.com/asam-ev/qc-framework/blob/main/src/runtime/CMakeLists.txt#L34 and remove lines 34, 35, and 38 (in practice remove the if in order to make Cmake execute the install and qc4openx_install_qt lines) and re-make install you should get the configuration gui.

"it works on my computer"

your mileage may vary...

hoangtungdinh commented 2 months ago

I tested the docker pipeline with the example files. The result thes are created but they don't contain any issues. Is that just because the files are valid? In that case, could you provide examples, that generate errors?

Hi @ClemensLinnhoff , indeed, the example OpenScenario/OpenDrive folders mentioned in the demo pipeline instructions contain both "valid" and "invalid" files. So some of them will not contain any issues. Here is an invalid file that would result in issues.

I also attached here the result with issue from the invalid file. Result.xqar.txt

MatteoRagni commented 2 months ago

And this still does not explain how I can set up my own configuration using my own checker bundles in a pipeline.

Regarding this specific topic I strongly suggest to wait until the project has started to work on manifest concept.

(Someone correct me if this is a wrong suggestion...)

The relevant draft merge request for reference.

hoangtungdinh commented 2 months ago

currently, it is possible to use the ConfigGUI in Ubuntu

I pulled the latest commit of the develop branch. And the ConfigGUI is still not built. At least it is not in the bin folder, where the ReportGUI is.

@ClemensLinnhoff just tested on linux, and it is not creating the gui, as you are reporting.

If you modify file https://github.com/asam-ev/qc-framework/blob/main/src/runtime/CMakeLists.txt#L34 and remove lines 34, 35, and 38 (in practice remove the if in order to make Cmake execute the install and qc4openx_install_qt lines) and re-make install you should get the configuration gui.

"it works on my computer"

your mileage may vary...

Thanks for the question and the clarification @ClemensLinnhoff @MatteoRagni. Indeed currently, the ConfigurationGUI is only built, not installed. So it will be somewhere in the build folder, not the install folder, unless we modify the build script like @MatteoRagni suggested.

However, the ConfigurationGUI has not been fully updated either and only supports creating configuration files, not running the framework.

In the coming weeks we will be working on support for including custom checker libraries in the framework.

andreaskern74 commented 4 weeks ago

We decided in the CCB that the complete Configuation GUI is postponed to the next project iteration, because form user perspective, the config can be simply generate by using/adapting the template configuration file.

@hoangtungdinh : Can you please remove the ConfigGUI from the current version? I will create a new issue to re-activate it later and link these tickets together.

AsamDiegoSanchez commented 2 weeks ago

I´ve added it to the wishlist milestone

andreaskern74 commented 2 weeks ago

I think we can close this one, because #133 contains now all information --> CCB.