-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(autoware_lanelet2_utility): add kind
Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
- Loading branch information
Showing
24 changed files
with
8,264 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
project(autoware_lanelet2_utility) | ||
|
||
find_package(autoware_cmake REQUIRED) | ||
autoware_package() | ||
|
||
ament_auto_add_library(${PROJECT_NAME} SHARED | ||
src/kind.cpp | ||
) | ||
|
||
if(BUILD_TESTING) | ||
find_package(ament_cmake_ros REQUIRED) | ||
ament_auto_find_test_dependencies() | ||
|
||
file(GLOB_RECURSE test_files test/*.cpp) | ||
|
||
foreach (test_file IN LISTS test_files) | ||
get_filename_component(test_file_name ${test_file} NAME) | ||
ament_auto_add_gtest(${test_file_name}_${PROJECT_NAME} ${test_file}) | ||
target_link_libraries(${test_file_name}_${PROJECT_NAME} | ||
${PROJECT_NAME} | ||
) | ||
endforeach() | ||
endif() | ||
|
||
ament_auto_package(INSTALL_TO_SHARE | ||
sample_map | ||
) | ||
|
||
install(PROGRAMS | ||
scripts/lanelet_anonymization_local.py | ||
DESTINATION lib/${PROJECT_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# autoware_lanelet2_utility | ||
|
||
## Nomenclature | ||
|
||
This package aims to strictly define the meaning of several words To disambiguate the documentation and API's scope. In the table below, `codespace` words are given specific meanings when used in API and API description. _italic_ words are emphasized to indicate that it refers to social common sense which often comes with ambiguity. To help clarify the meaning, illustration is provided. "Lanelet" refers to the entity of a`lanelet::Lanelet` object in order to distinguish with the word "lane" used in social customs. `A` and `B` stands for Lanelets objects. | ||
|
||
| Word | Meaning | Illustration | | ||
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `driving` | The vehicle position belongs to the designated Lanelet. | In each map, green Lanelet are the `driving` lanes of the vehicle. <br>  | | ||
| `boundary`,<br>`entry`,<br>`exit` | The `boundary` of a Lanelet refers to the left or right Linestring. |  | | ||
| `adjacent` | If A is `adjacent` to B, A and B share a common `boundary` with same direction either on the left or right side. | In each map, orange Lanelet is `adjacent` to green Lanelet. <br>  | | ||
| `same_direction` | Lanelet A and Lanelet B are `same_direction` if A and B are directly or indirectly `adjacent` to each other. | In each map, orange Lanelets are `same_dirction` as green Lanelet. <br>  | | ||
| `bundle` | A `bundle` refers to a transitive closure set of Lanelets which are `same_direction` to each other. | The enclosed sets of Lanelets are `bundle`s. <br>  | | ||
| `opposite` | If A is `opposite` to B, A and B share a common `boundary` with opposite direction. | In the first map, green Lanelet and orange Lanelet are `opposite` to each other. <br> In the second map, two red Lanelets are not `opposite` relation because they do not share a common LineString. <br>  | | ||
| `opposite_direction` | If A and B are `opposite_direction`, the bundle of A and B are directly `opposite` to each other. | In the each map, green Lanelet and orange Lanelet are `opposite_direction` becauase their `bundle`s(enclosed in dotted line) are `opposite` relation. <br>  | | ||
| `connected` | A is `connected` to(from) B if and only if the `exit`(`entry`) of A is identical to the `entry`(`exit`) of B. | A is connected to B, and B is connected from A. <br>  | | ||
| `following` | The `following` Lanelets of A is the list of Lanelets to which A is `connected`. | In each map, orange Lanelets are the `following` of green Lanelet. <br>  | | ||
| `previous` | The `previous` Lanelets of A is the list of Lanelets from which A is `connected`. | In each map, orange Lanelets are the `previous` of green Lanelet. <br>  | | ||
| `conflicting` | A is `conflicting` with B if A and B are geometrically intersecting. | | | ||
| `merging` | A is said to be `merging` Lanelet of B if and only if A is `conflicting` with B and both A and B are connected to a common Lanelet. | In each map, one of the orange Lanelet is a `mergin` Lanelet of the other orange Lanelet. <br>  | | ||
| `sibling` | The designated Lanelets are refered to as `sibling` if all of them are `connected` from a common Lanelet. | In each map, orange Lanelets are `sibling`s. <br>  | | ||
| `oncoming` | TBD | TBD | | ||
| `upcoming` | TBD | TBD | | ||
| `sequence` | `sequence` is a list of Lanelets whose each element is `connected from` or `adjacent to` the previous element. |  | | ||
|
||
## API description | ||
|
||
## How to craft test map | ||
|
||
On the VMB, create the map in local projector(or convert it to local projector from MGRS projector) and save the file as `<input_map.osm>`. Next, select the point to use as (0.0, 0.0) and pass its `<ID>` and run | ||
|
||
```bash | ||
ros2 run autoware_lanelet2_utility lanelet_anonymization_local.py <inpput_map.osm> <output_map.osm> <ID> | ||
``` | ||
|
||
Then the coordinate of the specified point is (0, 0) on the loaded map |
67 changes: 67 additions & 0 deletions
67
common/autoware_lanelet2_utility/include/autoware_lanelet2_utility/kind.hpp
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,67 @@ | ||
// Copyright 2025 TIER IV, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef AUTOWARE_LANELET2_UTILITY__KIND_HPP_ | ||
#define AUTOWARE_LANELET2_UTILITY__KIND_HPP_ | ||
|
||
#include <lanelet2_core/Forward.h> | ||
|
||
namespace autoware::lanelet2_utility | ||
{ | ||
|
||
inline namespace kind | ||
{ | ||
static constexpr const char * k_road_lane_type = "road"; | ||
static constexpr const char * k_shoulder_lane_type = "road_shoulder"; | ||
static constexpr const char * k_bicycle_lane_type = "bicycle_lane"; | ||
|
||
/* | ||
* TODO(soblin): distinguish road lane type | ||
class RoadLane : public lanelet::ConstLanelet | ||
{ | ||
}; | ||
class RoadShoulderLane : public lanelet::ConstLanelet | ||
{ | ||
}; | ||
class BicycleLane : public lanelet::ConstLanelet | ||
{ | ||
}; | ||
*/ | ||
|
||
/** | ||
* @brief check if the given lanelet type has "road" subtype | ||
* @param [in] lanelet input lanelet | ||
* @return if the lanelet is road or not | ||
*/ | ||
bool is_road_lane(const lanelet::ConstLanelet & lanelet); | ||
|
||
/** | ||
* @brief check if the given lanelet type has "road_shoulder" subtype | ||
* @param [in] lanelet input lanelet | ||
* @return if the lanelet is road_shoulder or not | ||
*/ | ||
bool is_shoulder_lane(const lanelet::ConstLanelet & lanelet); | ||
|
||
/** | ||
* @brief check if the given lanelet type has "bicycle_lane" subtype | ||
* @param [in] lanelet input lanelet | ||
* @return if the lanelet is bicicye_lane or not | ||
*/ | ||
bool is_bicycle_lane(const lanelet::ConstLanelet & lanelet); | ||
} // namespace kind | ||
|
||
} // namespace autoware::lanelet2_utility | ||
#endif // AUTOWARE_LANELET2_UTILITY__KIND_HPP_ |
Oops, something went wrong.