Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

feat: move lanelet2_extension from autoware.universe #90

Merged
merged 36 commits into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
d355b2e
feat: add map packages (#8)
taikitanaka3 Dec 2, 2021
65fcdf2
fix: fix isInLanelet (#770) (#151)
wep21 Dec 9, 2021
d9a8f08
fix: fix angle diff calculation of mission_planner (#772) (#152)
wep21 Dec 13, 2021
16cb23f
fix(lanelet2_extension): add guard for inner product (#256)
kyoichi-sugahara Jan 18, 2022
69125be
fix(lanelet2_extension): fix getAngleDifference (#264)
taikitanaka3 Jan 20, 2022
4dafc05
feat(lanelet2_extension,map_loader): add guard_rail wall fence as lan…
taikitanaka3 Mar 5, 2022
084b3cb
fix(tier4_autoware_utils): modify build error in rolling (#720)
wep21 Apr 21, 2022
50e7c07
style: fix format of package.xml (#844)
kenji-miyake May 3, 2022
f45520e
chore: remove bad chars (#845)
kenji-miyake May 4, 2022
80389fc
refactor: use autoware cmake (#849)
kenji-miyake May 5, 2022
a12c599
refactor: simplify Rolling support (#854)
kenji-miyake May 5, 2022
a1ad65d
chore: upgrade cmake_minimum_required to 3.14 (#856)
kenji-miyake May 5, 2022
ebce3b1
feat: isolate gtests in all packages (#693)
maxime-clem May 9, 2022
553483b
feat(behavior_path_planner): weakened noise filtering of drivable are…
takayuki5168 May 17, 2022
1d11eaa
feat: visualize lane boundaries (#923)
h-ohta May 19, 2022
02829bf
feat(map_loader): visualize center line by points (#931)
h-ohta May 20, 2022
7262941
fix(lanelet2_extension): fix low FPS when visualizing center_line_arr…
h-ohta Jun 5, 2022
dd61e88
fix(lanelet2_extension): remove unnecessary error message (#1043)
takayuki5168 Jun 7, 2022
0038534
feat(intersection): add conflicting area with margin debug (#1021)
1222-takeshi Jun 9, 2022
8b86154
fix: is_in_parking_lot check method (#992)
NorahXiong Jun 14, 2022
b5649c2
fix(behavior_velocity_planner): use only forward path for launching m…
kosuke55 Jun 15, 2022
a168ed3
feat(lanelet2_extension): add route checker (#1149)
shmpwk Jun 23, 2022
2dab5c3
docs(lanelet2_extention): add route cheker and update launching args …
shmpwk Jul 1, 2022
2442675
docs: update README
Jul 5, 2022
1a1efa0
refactor
Aug 1, 2022
76be068
fix Clang-Tidy warnings
Aug 1, 2022
678aa3a
apply diff
Aug 2, 2022
5f9a90a
add NOLINT
Aug 2, 2022
26fd06d
remove autoware_auto_msgs from reverse_depends/build_depends.repos
Aug 2, 2022
a053a0b
remove reverse_depends/map/lanelet2_extension
Aug 2, 2022
ec2ea18
fix typo
kenji-miyake Aug 2, 2022
7be5a9f
use Humble for clang-tidy-differential
Aug 2, 2022
8cc2dfb
fix clang-tidy warnings
Aug 2, 2022
ecfb44b
fix clang-tidy warnings
Aug 2, 2022
d0dda71
fix for cpplint
Aug 3, 2022
f5771f4
apply autowarefoundation/autoware.universe#1506
Aug 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@ CheckOptions:
value: ""
- key: portability-simd-intrinsics.Suggest
value: "0"
- key: readability-function-cognitive-complexity.IgnoreMacros
value: "1"
- key: readability-else-after-return.WarnOnUnfixable
value: "1"
- key: readability-identifier-naming.NamespaceCase
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test-differential.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:

clang-tidy-differential:
runs-on: ubuntu-latest
container: ros:galactic
container: ros:humble
needs: build-and-test-differential
steps:
- name: Check out repository
Expand All @@ -83,7 +83,7 @@ jobs:
if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }}
uses: autowarefoundation/autoware-github-actions/clang-tidy@v1
with:
rosdistro: galactic
rosdistro: humble
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
clang-tidy-config-url: https://raw.githubusercontent.com/autowarefoundation/autoware/main/.clang-tidy
build-depends-repos: build_depends.repos
2 changes: 2 additions & 0 deletions .github/workflows/build-and-test-with-reverse-depends.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ jobs:
- name: Import depends of reverse depends
run: |
yq -i 'del(.repositories.* | select(.url == "https://github.com/autowarefoundation/autoware_common.git"))' reverse_depends/build_depends.repos
yq -i 'del(.repositories.* | select(.url == "https://github.com/tier4/autoware_auto_msgs.git"))' reverse_depends/build_depends.repos
vcs import reverse_depends < reverse_depends/build_depends.repos
rm -rf reverse_depends/map/lanelet2_extension

- name: Build
if: ${{ steps.get-self-packages.outputs.self-packages != '' }}
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# autoware_common

Commonly referenced ROS library packages for [Autoware](https://github.com/autowarefoundation/autoware).

Note that the packages under `tmp/` may introduce breaking changes and is planned to be replaced by re-designed packages in the future.
4 changes: 4 additions & 0 deletions build_depends.repos
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
repositories:
tmp/autoware_auto_msgs:
type: git
url: https://github.com/tier4/autoware_auto_msgs.git
version: tier4/main
80 changes: 80 additions & 0 deletions tmp/lanelet2_extension/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
cmake_minimum_required(VERSION 3.14)
project(lanelet2_extension)

find_package(autoware_cmake REQUIRED)
autoware_package()

find_package(PkgConfig)
find_path(GeographicLib_INCLUDE_DIR GeographicLib/Config.h
PATH_SUFFIXES GeographicLib
)
set(GeographicLib_INCLUDE_DIRS ${GeographicLib_INCLUDE_DIR})

find_library(GeographicLib_LIBRARIES
NAMES Geographic
)

find_library(PUGIXML_LIBRARIES
NAMES pugixml
)

find_path(PUGIXML_INCLUDE_DIRS
NAMES pugixml.hpp
PATH_SUFFIXES pugixml
)

include_directories(
${GeographicLib_INCLUDE_DIRS}
${PUGIXML_INCLUDE_DIRS}
)

add_definitions(${GeographicLib_DEFINITIONS})

ament_auto_add_library(lanelet2_extension_lib SHARED
lib/autoware_osm_parser.cpp
lib/autoware_traffic_light.cpp
lib/detection_area.cpp
lib/no_stopping_area.cpp
lib/message_conversion.cpp
lib/mgrs_projector.cpp
lib/query.cpp
lib/road_marking.cpp
lib/utilities.cpp
lib/virtual_traffic_light.cpp
lib/visualization.cpp
lib/route_checker.cpp
)
target_link_libraries(lanelet2_extension_lib
${GeographicLib_LIBRARIES}
)

ament_auto_add_executable(lanelet2_extension_sample src/sample_code.cpp)
add_dependencies(lanelet2_extension_sample lanelet2_extension_lib)
target_link_libraries(lanelet2_extension_sample
lanelet2_extension_lib
)

ament_auto_add_executable(autoware_lanelet2_validation src/validation.cpp)
add_dependencies(autoware_lanelet2_validation lanelet2_extension_lib)
target_link_libraries(autoware_lanelet2_validation
${catkin_LIBRARIES}
${PUGIXML_LIBRARIES}
lanelet2_extension_lib
)

if(BUILD_TESTING)
ament_add_ros_isolated_gtest(message_conversion-test test/src/test_message_conversion.cpp)
target_link_libraries(message_conversion-test lanelet2_extension_lib)
ament_add_ros_isolated_gtest(projector-test test/src/test_projector.cpp)
target_link_libraries(projector-test lanelet2_extension_lib)
ament_add_ros_isolated_gtest(query-test test/src/test_query.cpp)
target_link_libraries(query-test lanelet2_extension_lib)
ament_add_ros_isolated_gtest(regulatory_elements-test test/src/test_regulatory_elements.cpp)
target_link_libraries(regulatory_elements-test lanelet2_extension_lib)
ament_add_ros_isolated_gtest(utilities-test test/src/test_utilities.cpp)
target_link_libraries(utilities-test lanelet2_extension_lib)
ament_add_ros_isolated_gtest(route-test test/src/test_route_checker.cpp)
target_link_libraries(route-test lanelet2_extension_lib)
endif()

ament_auto_package()
93 changes: 93 additions & 0 deletions tmp/lanelet2_extension/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# lanelet2_extension package

This package contains external library for Lanelet2 and is meant to ease the use of Lanelet2 in Autoware.

## Lanelet Format for Autoware

Autoware uses extended Lanelet2 Format for Autoware, which means you need to add some tags to default OSM file if you want to fully use Lanelet2 maps. For details about custom tags, please refer to this [document](./docs/lanelet2_format_extension.md).

## Code API

### IO

#### Autoware OSM Parser

Autoware Lanelet2 Format uses .osm extension as original Lanelet2.
However, there are some custom tags that is used by the parser.

Currently, this includes:

- overwriting x,y values with `local_x` and `local_y` tags.
- reading `<MapMetaInfo>` tag which contains information about map format version and map version.

The parser is registered as "autoware_osm_handler" as lanelet parser

### Projection

#### MGRS Projector

MGRS projector projects latitude longitude into MGRS Coordinates.

### Regulatory Elements

#### Autoware Traffic Light

Autoware Traffic Light class allows you to retrieve information about traffic lights.
Autoware Traffic Light class contains following members:

- traffic light shape
- light bulbs information of traffic lights
- stopline associated to traffic light

### Utility

#### Message Conversion

This contains functions to convert lanelet map objects into ROS messages.
Currently it contains following conversions:

- lanelet::LaneletMapPtr to/from autoware_auto_mapping_msgs::msg::HADMapBin
- lanelet::Point3d to geometry_msgs::Point
- lanelet::Point2d to geometry_msgs::Point
- lanelet::BasicPoint3d to geometry_msgs::Point

#### Query

This module contains functions to retrieve various information from maps.
e.g. crosswalks, trafficlights, stoplines

#### Utilities

This module contains other useful functions related to Lanelet.
e.g. matching waypoint with lanelets

#### Route Checker

This module contains a function to check the loading route is valid or not.
If it is invalid, puts warning without dying.
The case valid is when the route is created on the same map as the current one.

### Visualization

Visualization contains functions to convert lanelet objects into visualization marker messages.
Currently it contains following conversions:

- lanelet::Lanelet to Triangle Markers
- lanelet::LineString to LineStrip Markers
- TrafficLights to Triangle Markers

## Nodes

### lanelet2_extension_sample

Code for this explains how this lanelet2_extension library is used.
The executable is not meant to do anything.

### autoware_lanelet2_extension

This node checks if an .osm file follows the Autoware version of Lanelet2 format.
You can check by running:

```sh
ros2 run lanelet2_extension autoware_lanelet2_validation --ros-args -p map_file:=<path/to/map.osm>
```
Binary file added tmp/lanelet2_extension/docs/detection_area.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions tmp/lanelet2_extension/docs/extra_lanelet_subtypes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Extra Lanelet Subtypes

## Roadside Lane

The subtypes for this lanelet classify the outer lanes adjacent to the driving lane.Since the list of lanelet subtypes defined in this [link](https://github.com/fzi-forschungszentrum-informatik/Lanelet2/blob/master/lanelet2_core/doc/LaneletAndAreaTagging.md) cannot represent the shoulder lane and pedestrian lane described below, two new subtypes are defined.When parking on the street, it is necessary to distinguish between a shoulder lane which can be used by vehicles, and a pedestrian lane which can be used by pedestrians and bicycles.If you park in a shoulder lane, you can use the entire lane for temporary parking, but if you park in a pedestrian lane, you must leave a space of at least 75cm.

### Road shoulder subtype

- refers: lanelet with subtype attribute. Subtype explains what the type of roadside it represents. If there is an area outside of this roadside lane that is open to traffic, such as a sidewalk or bike lane, select the road_shoulder subtype.

![Road shoulder](road_shoulder.svg)

Sample road shoulder in .osm format is shown below:

```xml
<relation id="120700">
<member type="way" role="left" ref="34577"/>
<member type="way" role="right" ref="120694"/>
<tag k="type" v="lanelet"/>
<tag k="subtype" v="road_shoulder"/>
<tag k="speed_limit" v="10"/>
<tag k="location" v="urban"/>
<tag k="one_way" v="yes"/>
</relation>
```

### Pedestrian lane subtype

- refers: lanelet with subtype attribute. Subtype explains what the type of roadside it represents. If there are no passable areas outside of this roadside lane, select the pedestrian_lane subtype.

![Pedestrian lane](pedestrian_lane.svg)

Sample pedestrian lane in .osm format is shown below:

```xml
<relation id="120700">
<member type="way" role="left" ref="34577"/>
<member type="way" role="right" ref="120694"/>
<tag k="type" v="lanelet"/>
<tag k="subtype" v="pedestrian_lane"/>
<tag k="speed_limit" v="10"/>
<tag k="location" v="urban"/>
<tag k="one_way" v="yes"/>
</relation>
```
63 changes: 63 additions & 0 deletions tmp/lanelet2_extension/docs/extra_regulatory_elements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Extra Regulatory Elements

## Detection Area

This regulatory element specifies region of interest which vehicle must pay attention whenever it is driving along the associated lanelet. When there are any obstacle in the detection area, vehicle must stop at specified stopline.

- refers: refers to detection area polygon. There could be multiple detection areas registered to a single regulatory element.
- ref_line: refers to stop line of the detection area

![Detection area](detection_area.png)

Sample detection area in .osm format is shown below:

```xml
<node id=1 version='1' lat='49.00541994701' lon='8.41565013855'>
<tag k=’ele’ v=’0’/>
</node>
<node id=2 version='1' lat='49.00542091657' lon='8.4156469497'>
<tag k=’ele’ v=’0’/>
</node>
<node id=3 version='1' lat='49.00542180052' lon='8.41564400223'>
<tag k=’ele’ v=’0’/>
</node>
<node id=4 version='1' lat='49.00541994701' lon='8.41564400223'>
<tag k=’ele’ v=’0’/>
</node>
<node id=5 version='1' lat='49.00542180052' lon='8.41564400223'>
<tag k=’ele’ v=’0’/>
</node>
<node id=6 version='1' lat='49.00541994701' lon='8.41564400223'>
<tag k=’ele’ v=’0’/>
</node>
<way id=11 version='1'>
<nd ref=1 />
<nd ref=2 />
<nd ref=3 />
<nd ref=4 />
<nd ref=1 />
<tag k='type' v=’detection_area’ />
<tag k='area' v=’yes’ />
</way>
<way id=12 version="1">
<nd ref=5 />
<nd ref=6 />
<tag k='type' v=stop_line’ />
</way>
<relation id="13">
<tag k="type" v="regulatory_element"/>
<tag k="subtype" v="detection_area"/>
<member type="way" ref="11" role="refers"/>
<member type="way" ref="12" role="ref_line"/>
</relation>
```

## Road Marking

This regulatory element specifies related road markings to a lanelet as shown below.

\* Note that the stopline in the image is for stoplines that are for reference, and normal stoplines should be expressed using TrafficSign regulatory element.

refers: linestring with type attribute. Type explains what road marking it represents (e.g. stopline).

![Road marking](road_mark.png)
Loading