forked from autowarefoundation/autoware.universe
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'beta/v0.3.16' into backport/pr1434/v0.3.13
- Loading branch information
Showing
257 changed files
with
3,656 additions
and
2,893 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: dispatch-release-note | ||
on: | ||
push: | ||
branches: | ||
- beta/v* | ||
- tier4/main | ||
tags: | ||
- v* | ||
workflow_dispatch: | ||
inputs: | ||
beta-branch-or-tag-name: | ||
description: The name of the beta branch or tag to write release note | ||
type: string | ||
required: true | ||
jobs: | ||
dispatch-release-note: | ||
runs-on: ubuntu-latest | ||
name: release-repository-dispatch | ||
steps: | ||
- name: Set tag name | ||
id: set-tag-name | ||
run: | | ||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | ||
REF_NAME="${{ github.event.inputs.beta-branch-or-tag-name }}" | ||
else | ||
REF_NAME="${{ github.ref_name }}" | ||
fi | ||
echo ::set-output name=ref-name::"$REF_NAME" | ||
echo ::set-output name=tag-name::"${REF_NAME#beta/}" | ||
- name: Generate token | ||
id: generate-token | ||
uses: tibdex/github-app-token@v1 | ||
with: | ||
app_id: ${{ secrets.APP_ID }} | ||
private_key: ${{ secrets.PRIVATE_KEY }} | ||
|
||
- name: Repository dispatch for release note | ||
run: | | ||
curl \ | ||
-X POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: token ${{ steps.generate-token.outputs.token }}" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
"https://api.github.com/repos/tier4/update-release-notes/dispatches" \ | ||
-d '{"event_type":"${{ steps.set-tag-name.outputs.ref-name }}"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(grid_map_utils) | ||
|
||
if(NOT CMAKE_CXX_STANDARD) | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
endif() | ||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
add_compile_options(-Wall -Wextra -Wpedantic) | ||
endif() | ||
|
||
find_package(autoware_cmake REQUIRED) | ||
autoware_package() | ||
find_package(ament_cmake REQUIRED) | ||
|
||
ament_auto_add_library(${PROJECT_NAME} SHARED | ||
DIRECTORY src | ||
) | ||
|
||
target_link_libraries(${PROJECT_NAME}) | ||
|
||
if(BUILD_TESTING) | ||
find_package(ament_lint_auto REQUIRED) | ||
ament_lint_auto_find_test_dependencies() | ||
|
||
ament_add_gtest(test_${PROJECT_NAME} | ||
test/test_polygon_iterator.cpp | ||
) | ||
target_link_libraries(test_${PROJECT_NAME} | ||
${PROJECT_NAME} | ||
) | ||
|
||
find_package(OpenCV REQUIRED) | ||
add_executable(benchmark test/benchmark.cpp) | ||
target_link_libraries(benchmark | ||
${PROJECT_NAME} | ||
${OpenCV_LIBS} | ||
) | ||
endif() | ||
|
||
ament_auto_package() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Grid Map Utils | ||
|
||
## Overview | ||
|
||
This packages contains a re-implementation of the `grid_map::PolygonIterator` used to iterate over | ||
all cells of a grid map contained inside some polygon. | ||
|
||
## Algorithm | ||
|
||
This implementation uses the [scan line algorithm](https://en.wikipedia.org/wiki/Scanline_rendering), | ||
a common algorithm used to draw polygons on a rasterized image. | ||
The main idea of the algorithm adapted to a grid map is as follow: | ||
|
||
- calculate intersections between rows of the grid map and the edges of the polygon edges; | ||
- calculate for each row the column between each pair of intersections; | ||
- the resulting `(row, column)` indexes are inside of the polygon. | ||
|
||
More details on the scan line algorithm can be found in the References. | ||
|
||
## API | ||
|
||
The `grid_map_utils::PolygonIterator` follows the same API as the original [`grid_map::PolygonIterator`](https://docs.ros.org/en/kinetic/api/grid_map_core/html/classgrid__map_1_1PolygonIterator.html). | ||
|
||
## Assumptions | ||
|
||
The behavior of the `grid_map_utils::PolygonIterator` is only guaranteed to match the `grid_map::PolygonIterator` if edges of the polygon do not _exactly_ cross any cell center. | ||
In such a case, whether the crossed cell is considered inside or outside of the polygon can vary due to floating precision error. | ||
|
||
## Performances | ||
|
||
Benchmarking code is implemented in `test/benchmarking.cpp` and is also used to validate that the `grid_map_utils::PolygonIterator` behaves exactly like the `grid_map::PolygonIterator`. | ||
|
||
The following figure shows a comparison of the runtime between the implementation of this package (`grid_map_utils`) and the original implementation (`grid_map`). | ||
The time measured includes the construction of the iterator and the iteration over all indexes and is shown using a logarithmic scale. | ||
Results were obtained varying the side size of a square grid map with `100 <= n <= 1000` (size=`n` means a grid of `n x n` cells), | ||
random polygons with a number of vertices `3 <= m <= 100` and with each parameter `(n,m)` repeated 10 times. | ||
|
||
![Runtime comparison](media/runtime_comparison.png) | ||
|
||
## Future improvements | ||
|
||
There exists variations of the scan line algorithm for multiple polygons. | ||
These can be implemented if we want to iterate over the cells contained in at least one of multiple polygons. | ||
|
||
The current implementation imitate the behavior of the original `grid_map::PolygonIterator` where a cell is selected if its center position is inside the polygon. | ||
This behavior could be changed for example to only return all cells overlapped by the polygon. | ||
|
||
## References | ||
|
||
- <https://en.wikipedia.org/wiki/Scanline_rendering> | ||
- <https://web.cs.ucdavis.edu/~ma/ECS175_S00/Notes/0411_b.pdf> | ||
- <https://www.techfak.uni-bielefeld.de/ags/wbski/lehre/digiSA/WS0607/3DVRCG/Vorlesung/13.RT3DCGVR-vertex-2-fragment.pdf> |
Oops, something went wrong.