Skip to content

Commit

Permalink
Merge branch 'Lagavulin9:car_control' into car_control
Browse files Browse the repository at this point in the history
  • Loading branch information
kianwasabi authored Nov 17, 2023
2 parents c5bcd04 + 8a54f41 commit 06a03bb
Show file tree
Hide file tree
Showing 29 changed files with 67 additions and 84 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/codegenerator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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: |
Expand All @@ -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
121 changes: 55 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# **DES Project - Car Control**
</br>


# Index
#### [Introduction](#introduction-1)
## [Introduction](#introduction-1)
</br>

# HOW TO USE
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 0 additions & 7 deletions CMakeLists.txt → car_control/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down Expand Up @@ -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
)
Expand All @@ -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
)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion fidl/carcontrol.fidl → car_control/fidl/carcontrol.fidl
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ interface CarControl {
Boolean accepted
}
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions Build.sh → car_control/scripts/Build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
################## build ##################
cd ..
#delete "build" folder if it exists
if [ -d "build" ]; then
rm -rf build
Expand Down
2 changes: 1 addition & 1 deletion Run_Client.sh → car_control/scripts/Run_Client.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# set environment variable - only valid for current terminal session!
export COMMONAPI_CONFIG="$PWD"/build/etc
cd build
cd ../build
./CarControlClient
2 changes: 1 addition & 1 deletion Run_Service.sh → car_control/scripts/Run_Service.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# set environment variable - only valid for current terminal session!
export COMMONAPI_CONFIG="$PWD"/build/etc
cd build
cd ../build
./CarControlService
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 06a03bb

Please sign in to comment.