-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
09585ff
commit 7e4f5a1
Showing
16 changed files
with
453 additions
and
524 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 |
---|---|---|
|
@@ -27,6 +27,7 @@ | |
"nums", | ||
"pydantic", | ||
"Kotaro", | ||
"Uetake" | ||
"Uetake", | ||
"conlist" | ||
] | ||
} |
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 |
---|---|---|
|
@@ -8,21 +8,6 @@ autoware_package() | |
set(ROS_REQUIREMENTS "${CMAKE_CURRENT_SOURCE_DIR}/../requirements.txt") | ||
execute_process(COMMAND bash -c "python3 -m pip install -r ${ROS_REQUIREMENTS}") | ||
|
||
ament_auto_add_library(obstacle_segmentation_evaluator_component SHARED | ||
src/obstacle_segmentation_evaluator_component.cpp | ||
) | ||
# Workaround for [email protected] | ||
if(TARGET lanelet2_core::lanelet2_core) | ||
get_target_property(lanelet2_core_INCLUDE_DIRECTORIES lanelet2_core::lanelet2_core INTERFACE_INCLUDE_DIRECTORIES) | ||
include_directories(SYSTEM | ||
${lanelet2_core_INCLUDE_DIRECTORIES} | ||
) | ||
endif() | ||
rclcpp_components_register_node(obstacle_segmentation_evaluator_component | ||
PLUGIN "driving_log_replayer::ObstacleSegmentationEvaluatorComponent" | ||
EXECUTABLE obstacle_segmentation_evaluator_node | ||
) | ||
|
||
if(BUILD_TESTING) | ||
find_package(ament_lint_auto REQUIRED) | ||
ament_lint_auto_find_test_dependencies() | ||
|
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
36 changes: 36 additions & 0 deletions
36
driving_log_replayer/driving_log_replayer/lanelet2_util.py
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 @@ | ||
# Copyright (c) 2024 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. | ||
|
||
from typing import Any | ||
|
||
import lanelet2 | ||
from lanelet2.core import Lanelet | ||
from lanelet2_extension_python.projection import MGRSProjector | ||
from lanelet2_extension_python.utility import query | ||
from shapely.geometry import Polygon | ||
|
||
|
||
def road_lanelets_from_file(map_path: str) -> Any: | ||
projection = MGRSProjector(lanelet2.io.Origin(0.0, 0.0)) | ||
lanelet_map = lanelet2.io.load(map_path, projection) | ||
all_lanelets = query.laneletLayer(lanelet_map) | ||
# return type lanelet2_extension_python._lanelet2_extension_python_boost_python_utility.lanelet::ConstLanelets | ||
return query.roadLanelets(all_lanelets) | ||
|
||
|
||
def to_shapely_polygon(lanelet: Lanelet) -> Polygon: | ||
points: list[float, float] = [] | ||
for p_2d in lanelet.polygon2d(): | ||
points.append([p_2d.x, p_2d.y]) | ||
return Polygon(points) |
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
Oops, something went wrong.