Skip to content

Commit 4655801

Browse files
author
berndgassmann
authored
Version 3.0.0: Major naming updates
Updating the variable naming of the generated datatypes from CamelCase to under_score_case and some other naming conventions. These are interface braking changes, therefore updating to 3.0.0 Providing basic renaming script that covers for many of the changes. Building: - support gcc-13 and Ubuntu 24.04 and Python versions 3.10-3.13 - support newer spdlog: adding formatters for datatype logging - remove spdlog submodule to make use of system delivered version - Harmonize CXX standard to 17 - update BUILDING.md on how to work with python venv (enforced with Ubunut 24.04) - fix python binding build and test Generated DataTypes: introduced more safe datatype operations by restricting their values to the limits after the operations allow automatic conversion of datatypes to their basetypes with "operator double()" if explicit type conversion is disabled added ad::geometry namespace and library added some ad::physics operations ad_map_access: - extended and hardened route/routing and predictions operations - added support for qgis correction functions - Added route::planning::predictRoutes* overloads which already provide the object yaw via the object data to get rid of extra calculation efforts - Fix getLaneENUHeading(match::MapMatchedPosition): set correct geo reference, otherwise returned heading is wrong - Add Heading constants - Add allowedObjectDistanceToLane to getMapMatchedBoundingBox() - Add ad::map::geometry namespace with polygon operations and extraction of occluded regions - Allow getLateralAlignementEdge() for physics::RatioValue - Fix ad::map::route::findWaypoint( distance == 0., route) - Added match:getENUBorder(LaneOccupiedRegion) function - Added point::getUnion(BoundingSphere, BoundingSphere) for use in python - Allow shortenRouteToDistance to cut intersections on request ad_map_access_qgis: - add polygon operations - remove unused partition manager - add lane correction abilities - add lane contact correction abilities - add traffic light layer - add ClickedPoint debug output and support altitude unknown matching - Support default intersection contact creation on adm load - Add support for exporting adm files
1 parent 4dd22d4 commit 4655801

File tree

923 files changed

+39356
-19487
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

923 files changed

+39356
-19487
lines changed

.github/workflows/build_test.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,26 @@ jobs:
2929
EXTRA_PACKAGES: clang-14
3030
CC: /usr/bin/clang-14
3131
CXX: /usr/bin/clang++-14
32-
PYTHON_BINDING_VERSION: "3.10"
32+
PYTHON_BINDING_VERSION: "3.11"
33+
- os: ubuntu-24.04
34+
compiler: gcc13
35+
EXTRA_PACKAGES: ""
36+
CC: ""
37+
CXX: ""
38+
PYTHON_BINDING_VERSION: "3.12"
39+
- os: ubuntu-24.04
40+
compiler: clang18
41+
EXTRA_PACKAGES: clang-18
42+
CC: /usr/bin/clang-18
43+
CXX: /usr/bin/clang++-18
44+
PYTHON_BINDING_VERSION: "3.13"
3345

3446
name: ${{ matrix.os }}, ${{ matrix.compiler }}, python-${{ matrix.PYTHON_BINDING_VERSION }}
3547
runs-on: ${{ matrix.os }}
3648
env:
3749
PYTHON_BINDING_VERSION: ${{ matrix.PYTHON_BINDING_VERSION }}
3850
EXTRA_PACKAGES: ${{ matrix.EXTRA_PACKAGES }}
51+
PYTHONNOUSERSITE: 1
3952

4053
steps:
4154
- name: Harden Runner
@@ -57,4 +70,4 @@ jobs:
5770
run: |
5871
sudo apt-get install ${EXTRA_PACKAGES}
5972
rm -rf log build install
60-
eval CC=${CC} CXX=${CXX} ${BUILDCMD}
73+
source map-build-venv/bin/activate && eval CC=${CC} CXX=${CXX} ${BUILDCMD}

.github/workflows/check_documentation.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
3737
- name: Build Documentation and Test
3838
run: |
39+
source map-build-venv/bin/activate
3940
GTEST_OUTPUT="xml:test_results"
4041
colcon build --event-handlers console_direct+ --executor sequential --packages-up-to ad_map_access ad_physics --cmake-args -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DBUILD_COVERAGE=ON -DBUILD_APIDOC=ON
4142
colcon test --event-handlers console_direct+ --packages-select ad_map_access ad_physics

.github/workflows/code_format_check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Check Code Formatting for AD-Map Library
1+
name: Check Code Formatting for carla-map libraries
22

33
on:
44
push:
@@ -11,7 +11,7 @@ permissions:
1111

1212
jobs:
1313
check_cpp:
14-
14+
1515
name: Check Code Formatting
1616

1717
runs-on: ubuntu-22.04

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494

9595
- name: Build
9696
run: |
97-
colcon build --event-handlers console_direct+ --executor sequential --packages-up-to ad_map_access --cmake-args -DBUILD_HARDENING=ON -DBUILD_TESTING=ON -DBUILD_PYTHON_BINDING=ON
97+
source map-build-venv/bin/activate && colcon build --event-handlers console_direct+ --executor sequential --packages-up-to ad_map_access --cmake-args -DBUILD_HARDENING=ON -DBUILD_TESTING=ON -DBUILD_PYTHON_BINDING=ON
9898
9999
- name: Perform CodeQL Analysis
100100
uses: github/codeql-action/analyze@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
Lines changed: 71 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,89 @@
11
#!/bin/bash
22

3-
sudo apt-get update
4-
sudo apt-get install -y lsb-core
5-
sudo apt-get install -y --no-install-recommends build-essential castxml cmake libgtest-dev liblapacke-dev libopenblas-dev libpugixml-dev sqlite3
3+
install_boost() {
4+
if ((IS_DEFAULT_PYTHON_VERSION)); then
5+
echo "!!!!!!! The default python version $(which python${PYTHON_BINDING_VERSION}): install system boost !!!!!!!"
6+
sudo apt-get install -y --no-install-recommends libboost-all-dev
7+
else
8+
echo "!!!!!!! Not the default python version $(which python${PYTHON_BINDING_VERSION}): compile boost 1.83 !!!!!!!"
9+
pushd dependencies
610

7-
IS_PYTHON_3_10=0
8-
echo "!!!!!!! Python version: ${PYTHON_BINDING_VERSION} !!!!!!!"
9-
if [ "${PYTHON_BINDING_VERSION}" == "3.10" ]; then
10-
echo "!!!!!!! Python version is 3.10 detected !!!!!!!"
11-
IS_PYTHON_3_10=1
12-
fi
11+
BOOST_VERSION=1.83.0
12+
BOOST_PACKAGE_BASENAME=boost_${BOOST_VERSION//./_}
13+
wget "https://archives.boost.io/release/${BOOST_VERSION}/source/${BOOST_PACKAGE_BASENAME}.tar.gz"
14+
15+
tar -xzf ${BOOST_PACKAGE_BASENAME}.tar.gz
16+
pushd ${BOOST_PACKAGE_BASENAME}
17+
18+
py3=`which python${PYTHON_BINDING_VERSION}`
19+
py3_root=`${py3} -c "import sys; print(sys.prefix)"`
20+
pyv=`$py3 -c "import sys;x='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));sys.stdout.write(x)";`
21+
22+
./bootstrap.sh \
23+
--prefix="/usr" \
24+
--with-libraries=python,filesystem,system,program_options \
25+
--with-python=${py3} --with-python-version=${pyv} --with-python-root=${py3_root}
26+
if (( $? )); then
27+
echo "!!!!!!! boost bootstrap failed !!!!!!!"
28+
cat bootstrap.log
29+
fi
1330

31+
# the python headers were installed via system and not by the virtual environment
32+
./b2 --prefix="/usr" cxxflags="-fPIC -I/usr/include/python${PYTHON_BINDING_VERSION}" -j 10 stage release
33+
sudo ./b2 --prefix="/usr" cxxflags="-fPIC -I/usr/include/python${PYTHON_BINDING_VERSION}" -j 10 install
34+
35+
# ensure our colcon build process ignores boost sources
36+
touch COLCON_IGNORE
37+
38+
popd
39+
fi
40+
}
41+
42+
IS_DEFAULT_PYTHON_VERSION=1
1443
if [ `lsb_release -a | grep Release | grep "22.04" | wc -l` == 1 ]; then
1544
if [ "${PYTHON_BINDING_VERSION}" == "" ]; then
1645
echo "!!!!!!! Setting default python version for Ubuntu22.04 !!!!!!!"
17-
IS_PYTHON_3_10=1
1846
PYTHON_BINDING_VERSION="3.10"
47+
elif [ "${PYTHON_BINDING_VERSION}" != "3.10" ]; then
48+
IS_DEFAULT_PYTHON_VERSION=0
1949
fi
2050
fi
2151

22-
sudo apt-get install -y --no-install-recommends libboost-all-dev
52+
if [ `lsb_release -a | grep Release | grep "24.04" | wc -l` == 1 ]; then
53+
if [ "${PYTHON_BINDING_VERSION}" == "" ]; then
54+
echo "!!!!!!! Setting default python version for Ubuntu24.04 !!!!!!!"
55+
PYTHON_BINDING_VERSION="3.12"
56+
elif [ "${PYTHON_BINDING_VERSION}" != "3.12" ]; then
57+
IS_DEFAULT_PYTHON_VERSION=0
58+
fi
59+
fi
60+
61+
echo "!!!!!!! Python version: ${PYTHON_BINDING_VERSION} !!!!!!!"
62+
63+
if ((! IS_DEFAULT_PYTHON_VERSION)); then
64+
sudo add-apt-repository ppa:deadsnakes/ppa
65+
fi
66+
67+
sudo apt-get update
68+
69+
sudo apt-get install -y lsb-core
70+
sudo apt-get install -y --no-install-recommends build-essential castxml cmake sqlite3 libgtest-dev libpugixml-dev libgtest-dev liblapacke-dev libspdlog-dev
2371

24-
sudo apt-get install -y --no-install-recommends python${PYTHON_BINDING_VERSION}-dev libpython${PYTHON_BINDING_VERSION}-dev
25-
curl -sS https://bootstrap.pypa.io/get-pip.py | sudo python${PYTHON_BINDING_VERSION}
72+
73+
74+
sudo apt-get install -y --no-install-recommends python${PYTHON_BINDING_VERSION}-dev python${PYTHON_BINDING_VERSION}-venv libpython${PYTHON_BINDING_VERSION}-dev
2675

2776
if [[ "${BUILD_DOCU}x" != "x" ]]; then
2877
sudo apt-get install doxygen graphviz lcov
2978
fi
3079

3180
sudo apt remove python3-pygments
32-
sudo python${PYTHON_BINDING_VERSION} -m pip install -r .github/workflows/requirements.txt
81+
82+
echo "creating virtual python${PYTHON_BINDING_VERSION} environment at $PWD/map-build-venv"
83+
export PYTHONNOUSERSITE=1
84+
python${PYTHON_BINDING_VERSION} -m venv map-build-venv
85+
source map-build-venv/bin/activate && \
86+
echo "activating virtual environment at $(which python${PYTHON_BINDING_VERSION})" && \
87+
curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_BINDING_VERSION} && \
88+
python${PYTHON_BINDING_VERSION} -m pip install -r .github/workflows/requirements.txt && \
89+
install_boost

.github/workflows/release_qgis_plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
- name: Build Libraries
3131
run: |
32-
colcon build --event-handlers console_direct+ --executor sequential --metas colcon_python.meta --packages-up-to ad_map_access_qgis
32+
source map-build-venv/bin/activate && colcon build --event-handlers console_direct+ --executor sequential --metas colcon_python.meta --packages-up-to ad_map_access_qgis
3333
3434
- name: Build Package
3535
run: |

.github/workflows/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ pyplusplus==1.8.5
1111
setuptools==80.8.0
1212
six==1.16.0
1313
testresources==2.0.1
14+
typeguard==4.4.4
1415
unittest-xml-reporting==3.2.0
1516

.github/workflows/wheels.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Wheels
2+
3+
on:
4+
release:
5+
types: [published]
6+
push:
7+
branches: master
8+
pull_request:
9+
branches: master
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
wheels:
16+
strategy:
17+
matrix:
18+
include:
19+
- os: ubuntu-22.04
20+
PYTHON_BINDING_VERSION: "3.10"
21+
- os: ubuntu-22.04
22+
PYTHON_BINDING_VERSION: "3.11"
23+
- os: ubuntu-22.04
24+
PYTHON_BINDING_VERSION: "3.12"
25+
- os: ubuntu-22.04
26+
PYTHON_BINDING_VERSION: "3.13"
27+
28+
name: ${{ matrix.os }}, python-${{ matrix.PYTHON_BINDING_VERSION }}
29+
runs-on: ${{ matrix.os }}
30+
env:
31+
WHEEL_PLATFORM: manylinux_2_35_x86_64
32+
PYTHON_BINDING_VERSION: ${{ matrix.PYTHON_BINDING_VERSION }}
33+
PYTHONNOUSERSITE: 1
34+
steps:
35+
- name: Harden Runner
36+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
37+
with:
38+
egress-policy: audit
39+
40+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
41+
with:
42+
fetch-depth: 1
43+
submodules: recursive
44+
45+
- name: Install Dependencies
46+
run: |
47+
bash .github/workflows/install_dependencies.sh
48+
source map-build-venv/bin/activate && python${PYTHON_BINDING_VERSION} -m pip install auditwheel && python${PYTHON_BINDING_VERSION} -m pip install --upgrade patchelf>=0.14
49+
50+
- name: Build wheels
51+
shell: bash
52+
run: |
53+
source map-build-venv/bin/activate && colcon build --packages-select PROJ4 --event-handlers console_direct+ --cmake-args -DCMAKE_POSITION_INDEPENDENT_CODE=ON
54+
source install/setup.bash
55+
source map-build-venv/bin/activate && colcon build --packages-up-to ad_map_access --event-handlers console_direct+ --cmake-args -DPYTHON_BINDING_VERSION=${PYTHON_BINDING_VERSION} --metas colcon_python.meta
56+
57+
- name: Repair wheels
58+
shell: bash
59+
run: |
60+
source install/setup.bash
61+
for whl in install/ad_physics/dist/*.whl; do
62+
source map-build-venv/bin/activate && auditwheel repair $whl --plat ${WHEEL_PLATFORM} --wheel-dir wheelhouse
63+
done
64+
for whl in install/ad_map_access/dist/*.whl; do
65+
source map-build-venv/bin/activate && auditwheel repair $whl --plat ${WHEEL_PLATFORM} --wheel-dir wheelhouse
66+
done
67+
68+
- name: Publish wheels to PyPI
69+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # release/v1
70+
if: ${{ github.event_name == 'release'}}
71+
with:
72+
user: __token__
73+
password: ${{ secrets.PYPI_API_TOKEN }}
74+
packages_dir: wheelhouse/

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
/log/
44
__pycache__/
55
*\.pyc
6+
ad_map_access/tests/test_files/Town01.adm.txt
7+
map-build-venv/

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[submodule "dependencies/spdlog"]
2-
path = dependencies/spdlog
3-
url = https://github.com/gabime/spdlog.git
41
[submodule "dependencies/odrSpiral"]
52
path = dependencies/odrSpiral
63
url = https://github.com/DLR-TS/odrSpiral

0 commit comments

Comments
 (0)