Skip to content

Commit

Permalink
update vehicle adaptor
Browse files Browse the repository at this point in the history
  • Loading branch information
masayukiaino committed Dec 31, 2024
1 parent fe85e3c commit 3c94a64
Show file tree
Hide file tree
Showing 208 changed files with 6,432 additions and 7,780 deletions.
1 change: 0 additions & 1 deletion vehicle/autoware_raw_vehicle_cmd_converter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ ament_auto_add_library(vehicle_adaptor SHARED
src/vehicle_adaptor/autoware_vehicle_adaptor/autoware_vehicle_adaptor/src/inputs_prediction.cpp
src/vehicle_adaptor/autoware_vehicle_adaptor/autoware_vehicle_adaptor/src/nominal_dynamics.cpp
src/vehicle_adaptor/autoware_vehicle_adaptor/autoware_vehicle_adaptor/src/transform_vehicle_adaptor_model.cpp
src/vehicle_adaptor/autoware_vehicle_adaptor/autoware_vehicle_adaptor/src/linear_regression_compensator.cpp
src/vehicle_adaptor/autoware_vehicle_adaptor/autoware_vehicle_adaptor/src/inputs_ref_smoother.cpp
src/vehicle_adaptor/autoware_vehicle_adaptor/autoware_vehicle_adaptor/src/vehicle_adaptor_utils.cpp
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: setup environment
description: setup environment for CI and install dependencies

runs:
using: "composite"
steps:
- name: checkout
uses: actions/checkout@v4

- name: install dependencies
run: >
sudo apt-get -qq update &&
sudo apt-get -qq install -y
software-properties-common &&
sudo add-apt-repository ppa:deadsnakes/ppa &&
sudo apt-get -qq update &&
sudo apt-get -qq install -y
cmake
jq
gcc
libyaml-cpp-dev
python3.10
python3.10-venv
python3-pip
python3-pybind11
shell: bash

- name: install eigen 3.4.0
run: |
sudo bash .github/scripts/install_eigen.sh
shell: bash

- name: installation of this repository
run: sudo pip3 install .
shell: bash

- name: install pip packages
run: pip3 install -r requirements.txt
shell: bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/bash

function log()
{
echo "::${1}::${*:2}"
}

function warning()
{
log warning "${*}"
}

function debug()
{
log debug "${*}"
}

version="3.4.0"
project_id=15462818
gitlab="https://gitlab.com/api/v4/projects"

releases=$(curl -s "${gitlab}/${project_id}/releases" | jq -cr '.[].tag_name')
latest=$(echo "${releases}" | head -n 1)

if [[ "${version}" == "latest" ]]
then
version=${latest}
debug "Found ${version} latest release"
elif ! grep -q "${version}" <<< "${releases}"
then
warning "Not found ${version} release"
version=${latest}
fi

debug "Installing ${version} release..."

release_source=$(curl -s "${gitlab}/${project_id}/releases/${version}" | jq -rc '.assets.sources[] | select( .format == "tar.gz" ).url')

if ! command -v wget &> /dev/null
then
curl -L "${release_source}" | tar -xvz > /dev/null
else
wget -qO- "${release_source}" | tar -xvz > /dev/null
fi

eigen_install_dir="/usr"
eigen_dir="eigen-${version}"

cmake -E make_directory build
cmake "${eigen_dir}" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${eigen_install_dir}" -DEIGEN_BUILD_PKGCONFIG=ON
cmake --install . --config Release

cmake_module_path="${eigen_install_dir}/share/eigen3/cmake"
pkg_config_path="${eigen_install_dir}/share/pkgconfig"

# shellcheck disable=SC2046
cp $(ls -d "${eigen_dir}"/cmake/*.cmake) "${cmake_module_path}"

{
echo "Eigen3_DIR=${cmake_module_path}"
echo "Eigen3_Dir=${cmake_module_path}"
echo "PKG_CONFIG_PATH=${pkg_config_path}"
} >> "${GITHUB_ENV}"


debug "Successfully setup Eigen3 of ${version} version"
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# see: https://github.com/rami3l/plfl/blob/master/.github/workflows/ci.yml
name: CI

# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:

jobs:
build_test:
runs-on: self-hosted
steps:
- name: checkout
uses: actions/checkout@v4

- name: setup and install dependencies
uses: ./.github/actions/setup

- name: test for building `vehicle_adaptor_compensator.cpp`
run: python3 build_test.py

- name: test for building `actuation_map_2d.cpp`
run: python3 build_actuation_map_2d_test.py

run_simulator:
runs-on: self-hosted
needs: build_test
steps:
- name: checkout
uses: actions/checkout@v4

- name: setup and install dependencies
uses: ./.github/actions/setup

- name: test for python simulator
run: |
cd autoware_vehicle_adaptor/python_simulator
python3 run_vehicle_adaptor.py
cd ../..
- name: test for calibration simulator
run: |
cd autoware_vehicle_adaptor/python_simulator
python3 run_accel_brake_map_calibrator.py
cd ../..
- name: Get current date and time
env:
TZ: "Asia/Tokyo"
id: date
run: echo "date=$(date +'%Y-%m-%d-%H-%M')" >> $GITHUB_OUTPUT

- name: upload log to artifact
uses: actions/upload-artifact@v4
with:
name: "${{ steps.date.outputs.date }}-log-data"
path: "autoware_vehicle_adaptor/python_simulator/log_data/"
# artifact は一週間だけ保持
retention-days: 7
if-no-files-found: warn
Loading

0 comments on commit 3c94a64

Please sign in to comment.