diff --git a/.github/workflows/codegenerator.yaml b/.github/workflows/codegenerator.yaml index 3ad3363..d22b068 100644 --- a/.github/workflows/codegenerator.yaml +++ b/.github/workflows/codegenerator.yaml @@ -9,8 +9,8 @@ on: push: branches: [ "car_control" ] paths: - - 'fidl/**.fidl' - - 'fidl/**.fdepl' + - 'car_control/fidl/**.fidl' + - 'car_control/fidl/**.fdepl' workflow_dispatch: jobs: @@ -24,9 +24,9 @@ jobs: - name: 1) Delete old generated code, if exists. And create new folders. run: | - rm -rf ${{ github.workspace }}/src-gen - mkdir -p ${{ github.workspace }}/src-gen/core - mkdir -p ${{ github.workspace }}/src-gen/someip + rm -rf ${{ github.workspace }}/car_control/src-gen + mkdir -p ${{ github.workspace }}/car_control/src-gen/core + mkdir -p ${{ github.workspace }}/car_control/src-gen/someip - name: 2) Download CommonAPI Core Generator. run: | @@ -41,18 +41,18 @@ jobs: - name: 4) Generate CommonAPI Code from Core Generator. run: | echo $(find ${{ github.workspace }} -type f -name '*.fidl') - core-generator/commonapi-core-generator-linux-x86_64 -sk $(find ${{ github.workspace }} -type f -name '*.fidl') -d ${{ github.workspace }}/src-gen/core + core-generator/commonapi-core-generator-linux-x86_64 -sk $(find ${{ github.workspace }} -type f -name '*.fidl') -d ${{ github.workspace }}/car_control/src-gen/core - name: 5) Generate CommonAPI Code with the vSOME/IP Generator. run: | echo $(find ${{ github.workspace }} -type f -name '*.fdepl') - someip-generator/commonapi-someip-generator-linux-x86_64 $(find ${{ github.workspace }} -type f -name '*.fdepl') -d ${{ github.workspace }}/src-gen/someip + someip-generator/commonapi-someip-generator-linux-x86_64 $(find ${{ github.workspace }} -type f -name '*.fdepl') -d ${{ github.workspace }}/car_control/src-gen/someip - name: 6) Save generated code in src-gen (Commit and Push) if: github.event_name == 'push' run: | git config user.name "$(git log -n 1 --pretty=format:%an)" git config user.email "$(git log -n 1 --pretty=format:%ae)" - git add src-gen + git add car_control/src-gen git commit -m "Auto Generated fidl" || true git push \ No newline at end of file diff --git a/README.md b/README.md index bac05c7..147fc72 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ # **DES Project - Car Control**
- # Index -#### [Introduction](#introduction-1) +## [Introduction](#introduction-1)
# HOW TO USE @@ -40,8 +39,6 @@ The configuration file has 4 possible sections; all sections are optional ####################################################### SOURCE: MOONs Repo ####################################################### -Kian, use this and add ajust process to infos from setup.sh file - # CommonAPI vSomeIP Setup (RPi 4B) ## Contents @@ -416,58 +413,66 @@ make -j8 #### Setup PI ##### ################# SYSTEM DEPENCENDIES ################# -# See Some ip documentations & dockerfile from johang #https://github.com/SEA-ME/Team-Pilot/tree/Moon/Project-2/CommonAPI-vSomeIP -##### Java 8 -# sudo apt update -# sudo apt install openjdk-8-jdk -# java -version -###### Boost-dev -## sudo apt-get install libboost-all-dev -###### libdbus -# sudo apt-get install libdbus-1-dev -###### ascii -# sudo apt install ascii - +See Some ip documentations & dockerfile from johang +https://github.com/SEA-ME/Team-Pilot/tree/Moon/Project-2/CommonAPI-vSomeIP +Java 8, Boost-dev, libdbus and ascii +```bash +sudo apt update +sudo apt install openjdk-8-jdk +sudo apt-get install libboost-all-dev +sudo apt-get install libdbus-1-dev +sudo apt install ascii +``` +Install python dependencies globally - not recommended +```bash +pip install piracer-py +``` ################# DEPENCENDIES for COMMONAPI & vSOME/IP ################# -# ASSUME TO INSTALL IN HOME DIRECTORY -# https://github.com/COVESA/capicxx-someip-tools/wiki/CommonAPI-C---SomeIP-in-10-minutes#step3 -# https://github.com/COVESA/capicxx-dbus-tools/wiki/CommonAPI-C---D-Bus-in-10-minutes +ASSUME TO INSTALL IN HOME DIRECTORY +https://github.com/COVESA/capicxx-someip-tools/wiki/CommonAPI-C---SomeIP-in-10-minutes#step3 +https://github.com/COVESA/capicxx-dbus-tools/wiki/CommonAPI-C---D-Bus-in-10-minutes ###### CommonAPI Core Runtime Library -# cd ~ -# git clone https://github.com/GENIVI/capicxx-core-runtime.git -# cd capicxx-core-runtime/ -# mkdir build -# cd build -# cmake .. -# make -# sudo make install - +```bash +cd ~ +git clone https://github.com/GENIVI/capicxx-core-runtime.git +cd capicxx-core-runtime/ +mkdir build +cd build +cmake .. +make +sudo make install +``` ###### vSOME/IP Library -# cd ~ -# git clone https://github.com/COVESA/vsomeip.git -# cd vsomeip -# mkdir build -# cd build -# cmake -DENABLE_SIGNAL_HANDLING=1 -DDIAGNOSIS_ADDRESS=0x10 .. -# make -# sudo make install - +```bash +cd ~ +git clone https://github.com/COVESA/vsomeip.git +cd vsomeip +mkdir build +cd build +cmake -DENABLE_SIGNAL_HANDLING=1 -DDIAGNOSIS_ADDRESS=0x10 .. +make +sudo make install +``` ###### CommonAPI SOMEip Runtime Library -# git clone https://github.com/GENIVI/capicxx-someip-runtime.git -# cd capicxx-someip-runtime -# mkdir build -# cd build -# cmake -DUSE_INSTALLED_COMMONAPI=OFF .. -# make -# sudo make install - +```bash +git clone https://github.com/GENIVI/capicxx-someip-runtime.git +cd capicxx-someip-runtime +mkdir build +cd build +cmake -DUSE_INSTALLED_COMMONAPI=OFF .. +make +sudo make install +``` ################# COMMONAPI generator ################# -# ASSUME TO INSTALL IN HOME DIRECTORY -# CORE TOOL: https://github.com/COVESA/capicxx-core-tools -# VSOME TOOL: https://github.com/COVESA/capicxx-someip-tools -# SEE: https://github.com/SEA-ME-COSS/DES-Head-Unit/tree/main/setting +ASSUME TO INSTALL IN HOME DIRECTORY +CORE TOOL: https://github.com/COVESA/capicxx-core-tools +VSOME TOOL: https://github.com/COVESA/capicxx-someip-tools +SEE: https://github.com/SEA-ME-COSS/DES-Head-Unit/tree/main/setting +This needs to be run before running Build.sh +Unfornauteley, the generator does not run on the target system (Raspberry Pi). Therefore, the teams laptop or ci automation (github action) can be used. +```bash #!/bin/bash #delete "src-gen-carinfo" folder if it exists if [ -d "src-gen-carinfo" ]; then @@ -476,23 +481,7 @@ fi #run generator /home/seame02/generator/core-generator/commonapi-core-generator-linux-x86_64 -sk ./fidl/carinfo.fidl -d ./src-gen-carinfo/core /home/seame02/generator/someip-generator/commonapi-someip-generator-linux-x86_64 ./fidl/carinfo.fdepl -d ./src-gen-carinfo/someip - -################## NOTE ################## -# This needs to be run before running Build.sh -# Unfornauteley, the generator does not run on the target system (Raspberry Pi). -# Therefore, the teams laptop is used. -# Paths on Genenrator needs to be modified regarding the used machine. - -################# PERMISSION SETTINGS ################# -# cd .. -# chmod 755 /car_control -# cd car_control - -################# Python Setup ################# - -# Install python dependencies globally - not recommended -# pip install piracer-py - +``` # Car Control ## Table of Contents diff --git a/CMakeLists.txt b/car_control/CMakeLists.txt similarity index 83% rename from CMakeLists.txt rename to car_control/CMakeLists.txt index e91bb3e..c9d340f 100644 --- a/CMakeLists.txt +++ b/car_control/CMakeLists.txt @@ -5,15 +5,12 @@ project(${PROJ_NAME}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}-pthread -std=c++11 -fsanitize=thread -g ") ### PACKAGES ### -# python find_package(Python3 COMPONENTS Development) find_package(Boost REQUIRED COMPONENTS python3) -## common api find_package(CommonAPI REQUIRED) find_package(CommonAPI-SomeIP REQUIRED) ### VARIABLES ### -# set(PRJ_SRC_GEN_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src-gen-carcontrol) set(PRJ_SRC_VAR src) set(PRJ_SRC_GEN_VAR src-gen) set(PRJ_SRC_GEN_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${PRJ_SRC_GEN_VAR}) @@ -48,8 +45,6 @@ add_executable(CarControlService ${PRJ_SRC_VAR}/PiRacer.cpp ${PRJ_SRC_VAR}/CarControlService.cpp ${PRJ_SRC_VAR}/CarControlStubImpl.cpp - # src-gen-carcontrol/someip/v0/commonapi/CarControlSomeIPStubAdapter.cpp - # src-gen-carcontrol/someip/v0/commonapi/CarControlSomeIPDeployment.cpp ${SOMEIP_GEN_SRC_DIR}/${COMMONAPI_INTERFACE_VER}/CarControlSomeIPStubAdapter.cpp ${SOMEIP_GEN_SRC_DIR}/${COMMONAPI_INTERFACE_VER}/CarControlSomeIPDeployment.cpp ) @@ -63,8 +58,6 @@ target_link_libraries(CarControlService # Client add_executable(CarControlClient ${PRJ_SRC_VAR}/CarControlClient.cpp - # src-gen-carcontrol/someip/v0/commonapi/CarControlSomeIPProxy.cpp - # src-gen-carcontrol/someip/v0/commonapi/CarControlSomeIPDeployment.cpp ${SOMEIP_GEN_SRC_DIR}/${COMMONAPI_INTERFACE_VER}/CarControlSomeIPProxy.cpp ${SOMEIP_GEN_SRC_DIR}/${COMMONAPI_INTERFACE_VER}/CarControlSomeIPDeployment.cpp ) diff --git a/fidl/carcontrol.fdepl b/car_control/fidl/carcontrol.fdepl similarity index 100% rename from fidl/carcontrol.fdepl rename to car_control/fidl/carcontrol.fdepl diff --git a/fidl/carcontrol.fidl b/car_control/fidl/carcontrol.fidl similarity index 99% rename from fidl/carcontrol.fidl rename to car_control/fidl/carcontrol.fidl index bf64a6f..41cfc18 100644 --- a/fidl/carcontrol.fidl +++ b/car_control/fidl/carcontrol.fidl @@ -14,4 +14,4 @@ interface CarControl { Boolean accepted } } -} +} \ No newline at end of file diff --git a/include/CarControlStubImpl.hpp b/car_control/include/CarControlStubImpl.hpp similarity index 100% rename from include/CarControlStubImpl.hpp rename to car_control/include/CarControlStubImpl.hpp diff --git a/include/GamePad.hpp b/car_control/include/GamePad.hpp similarity index 100% rename from include/GamePad.hpp rename to car_control/include/GamePad.hpp diff --git a/include/PiRacer.hpp b/car_control/include/PiRacer.hpp similarity index 100% rename from include/PiRacer.hpp rename to car_control/include/PiRacer.hpp diff --git a/piracer/gamepads.py b/car_control/piracer/gamepads.py similarity index 100% rename from piracer/gamepads.py rename to car_control/piracer/gamepads.py diff --git a/piracer/vehicles.py b/car_control/piracer/vehicles.py similarity index 100% rename from piracer/vehicles.py rename to car_control/piracer/vehicles.py diff --git a/Build.sh b/car_control/scripts/Build.sh similarity index 98% rename from Build.sh rename to car_control/scripts/Build.sh index 944245a..b4f5fa4 100755 --- a/Build.sh +++ b/car_control/scripts/Build.sh @@ -1,4 +1,5 @@ ################## build ################## +cd .. #delete "build" folder if it exists if [ -d "build" ]; then rm -rf build diff --git a/Run_Client.sh b/car_control/scripts/Run_Client.sh similarity index 91% rename from Run_Client.sh rename to car_control/scripts/Run_Client.sh index 03b1ab1..98767ba 100755 --- a/Run_Client.sh +++ b/car_control/scripts/Run_Client.sh @@ -1,4 +1,4 @@ # set environment variable - only valid for current terminal session! export COMMONAPI_CONFIG="$PWD"/build/etc -cd build +cd ../build ./CarControlClient \ No newline at end of file diff --git a/Run_Service.sh b/car_control/scripts/Run_Service.sh similarity index 91% rename from Run_Service.sh rename to car_control/scripts/Run_Service.sh index 3808a9f..606b262 100755 --- a/Run_Service.sh +++ b/car_control/scripts/Run_Service.sh @@ -1,4 +1,4 @@ # set environment variable - only valid for current terminal session! export COMMONAPI_CONFIG="$PWD"/build/etc -cd build +cd ../build ./CarControlService \ No newline at end of file diff --git a/src-gen/core/v0/commonapi/CarControl.hpp b/car_control/src-gen/core/v0/commonapi/CarControl.hpp similarity index 100% rename from src-gen/core/v0/commonapi/CarControl.hpp rename to car_control/src-gen/core/v0/commonapi/CarControl.hpp diff --git a/src-gen/core/v0/commonapi/CarControlProxy.hpp b/car_control/src-gen/core/v0/commonapi/CarControlProxy.hpp similarity index 100% rename from src-gen/core/v0/commonapi/CarControlProxy.hpp rename to car_control/src-gen/core/v0/commonapi/CarControlProxy.hpp diff --git a/src-gen/core/v0/commonapi/CarControlProxyBase.hpp b/car_control/src-gen/core/v0/commonapi/CarControlProxyBase.hpp similarity index 100% rename from src-gen/core/v0/commonapi/CarControlProxyBase.hpp rename to car_control/src-gen/core/v0/commonapi/CarControlProxyBase.hpp diff --git a/src-gen/core/v0/commonapi/CarControlStub.hpp b/car_control/src-gen/core/v0/commonapi/CarControlStub.hpp similarity index 100% rename from src-gen/core/v0/commonapi/CarControlStub.hpp rename to car_control/src-gen/core/v0/commonapi/CarControlStub.hpp diff --git a/src-gen/core/v0/commonapi/CarControlStubDefault.hpp b/car_control/src-gen/core/v0/commonapi/CarControlStubDefault.hpp similarity index 100% rename from src-gen/core/v0/commonapi/CarControlStubDefault.hpp rename to car_control/src-gen/core/v0/commonapi/CarControlStubDefault.hpp diff --git a/src-gen/someip/v0/commonapi/CarControlSomeIPDeployment.cpp b/car_control/src-gen/someip/v0/commonapi/CarControlSomeIPDeployment.cpp similarity index 100% rename from src-gen/someip/v0/commonapi/CarControlSomeIPDeployment.cpp rename to car_control/src-gen/someip/v0/commonapi/CarControlSomeIPDeployment.cpp diff --git a/src-gen/someip/v0/commonapi/CarControlSomeIPDeployment.hpp b/car_control/src-gen/someip/v0/commonapi/CarControlSomeIPDeployment.hpp similarity index 100% rename from src-gen/someip/v0/commonapi/CarControlSomeIPDeployment.hpp rename to car_control/src-gen/someip/v0/commonapi/CarControlSomeIPDeployment.hpp diff --git a/src-gen/someip/v0/commonapi/CarControlSomeIPProxy.cpp b/car_control/src-gen/someip/v0/commonapi/CarControlSomeIPProxy.cpp similarity index 100% rename from src-gen/someip/v0/commonapi/CarControlSomeIPProxy.cpp rename to car_control/src-gen/someip/v0/commonapi/CarControlSomeIPProxy.cpp diff --git a/src-gen/someip/v0/commonapi/CarControlSomeIPProxy.hpp b/car_control/src-gen/someip/v0/commonapi/CarControlSomeIPProxy.hpp similarity index 100% rename from src-gen/someip/v0/commonapi/CarControlSomeIPProxy.hpp rename to car_control/src-gen/someip/v0/commonapi/CarControlSomeIPProxy.hpp diff --git a/src-gen/someip/v0/commonapi/CarControlSomeIPStubAdapter.cpp b/car_control/src-gen/someip/v0/commonapi/CarControlSomeIPStubAdapter.cpp similarity index 100% rename from src-gen/someip/v0/commonapi/CarControlSomeIPStubAdapter.cpp rename to car_control/src-gen/someip/v0/commonapi/CarControlSomeIPStubAdapter.cpp diff --git a/src-gen/someip/v0/commonapi/CarControlSomeIPStubAdapter.hpp b/car_control/src-gen/someip/v0/commonapi/CarControlSomeIPStubAdapter.hpp similarity index 100% rename from src-gen/someip/v0/commonapi/CarControlSomeIPStubAdapter.hpp rename to car_control/src-gen/someip/v0/commonapi/CarControlSomeIPStubAdapter.hpp diff --git a/src/CarControlClient.cpp b/car_control/src/CarControlClient.cpp similarity index 100% rename from src/CarControlClient.cpp rename to car_control/src/CarControlClient.cpp diff --git a/src/CarControlService.cpp b/car_control/src/CarControlService.cpp similarity index 100% rename from src/CarControlService.cpp rename to car_control/src/CarControlService.cpp diff --git a/src/CarControlStubImpl.cpp b/car_control/src/CarControlStubImpl.cpp similarity index 100% rename from src/CarControlStubImpl.cpp rename to car_control/src/CarControlStubImpl.cpp diff --git a/src/GamePad.cpp b/car_control/src/GamePad.cpp similarity index 100% rename from src/GamePad.cpp rename to car_control/src/GamePad.cpp diff --git a/src/PiRacer.cpp b/car_control/src/PiRacer.cpp similarity index 100% rename from src/PiRacer.cpp rename to car_control/src/PiRacer.cpp