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.
for experiment/20240627_lidar_marker_lolicazer
Signed-off-by: Motsu-san <[email protected]>
- Loading branch information
1 parent
d54286f
commit 76b8fd8
Showing
16 changed files
with
1,452 additions
and
1 deletion.
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
43 changes: 43 additions & 0 deletions
43
...h/tier4_localization_launch/launch/pose_twist_estimator/lidar_marker_localizer.launch.xml
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,43 @@ | ||
<?xml version="1.0"?> | ||
<launch> | ||
<!-- input pointcloud topic/container --> | ||
<arg name="input_pointcloud"/> | ||
<arg name="lidar_container_name"/> | ||
|
||
<!-- whether use intra-process --> | ||
<arg name="use_intra_process" default="true" description="use ROS 2 component container communication"/> | ||
|
||
<group> | ||
<push-ros-namespace namespace="lidar_marker_localizer"/> | ||
|
||
<!-- pointcloud preprocess --> | ||
<group> | ||
<push-ros-namespace namespace="pointcloud_preprocessor"/> | ||
<load_composable_node target="$(var lidar_container_name)"> | ||
<composable_node pkg="pointcloud_preprocessor" plugin="pointcloud_preprocessor::CropBoxFilterComponent" name="crop_box_filter_measurement_range"> | ||
<remap from="input" to="$(var input_pointcloud)"/> | ||
<remap from="output" to="measurement_range/pointcloud_ex"/> | ||
<param from="$(var lidar_marker_localizer/pointcloud_preprocessor/crop_box_filter_measurement_range_param_path)"/> | ||
<extra_arg name="use_intra_process_comms" value="$(var use_intra_process)"/> | ||
</composable_node> | ||
|
||
<composable_node pkg="pointcloud_preprocessor" plugin="pointcloud_preprocessor::PassThroughFilterUInt16Component" name="ring_filter"> | ||
<remap from="input" to="measurement_range/pointcloud_ex"/> | ||
<remap from="output" to="ring_filter/pointcloud_ex"/> | ||
<param from="$(var lidar_marker_localizer/pointcloud_preprocessor/ring_filter_param_path)"/> | ||
<extra_arg name="use_intra_process_comms" value="$(var use_intra_process)"/> | ||
</composable_node> | ||
</load_composable_node> | ||
</group> | ||
|
||
<!-- lidar_marker_localizer --> | ||
<include file="$(find-pkg-share lidar_marker_localizer)/launch/lidar_marker_localizer.launch.xml"> | ||
<arg name="input_lanelet2_map" value="/map/vector_map"/> | ||
<arg name="input_ekf_pose" value="/localization/pose_twist_fusion_filter/biased_pose_with_covariance"/> | ||
<arg name="input_pointcloud" value="pointcloud_preprocessor/ring_filter/pointcloud_ex"/> | ||
<arg name="output_pose_with_covariance" value="/localization/pose_estimator/pose_with_covariance"/> | ||
<arg name="service_trigger_node_srv" value="trigger_node_srv"/> | ||
<arg name="param_file" value="$(var lidar_marker_localizer/lidar_marker_localizer_param_path)"/> | ||
</include> | ||
</group> | ||
</launch> |
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
30 changes: 30 additions & 0 deletions
30
localization/landmark_based_localizer/lidar_marker_localizer/CMakeLists.txt
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,30 @@ | ||
cmake_minimum_required(VERSION 3.14) | ||
project(lidar_marker_localizer) | ||
|
||
# find dependencies | ||
find_package(autoware_cmake REQUIRED) | ||
autoware_package() | ||
|
||
find_package(PCL REQUIRED COMPONENTS common io) | ||
include_directories(${PCL_INCLUDE_DIRS}) | ||
link_directories(${PCL_LIBRARY_DIRS}) | ||
|
||
ament_auto_add_executable(lidar_marker_localizer | ||
src/lidar_marker_localizer.cpp | ||
src/diagnostics/diagnostics_module.cpp | ||
src/main.cpp | ||
) | ||
|
||
target_link_libraries(lidar_marker_localizer | ||
${PCL_LIBRARIES} | ||
) | ||
|
||
if(BUILD_TESTING) | ||
find_package(ament_lint_auto REQUIRED) | ||
ament_lint_auto_find_test_dependencies() | ||
endif() | ||
|
||
ament_auto_package(INSTALL_TO_SHARE | ||
config | ||
launch | ||
) |
113 changes: 113 additions & 0 deletions
113
localization/landmark_based_localizer/lidar_marker_localizer/README.md
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,113 @@ | ||
# LiDAR Marker Localizer | ||
|
||
**LiDARMarkerLocalizer** is a detect-reflector-based localization node . | ||
|
||
## Inputs / Outputs | ||
|
||
### `lidar_marker_localizer` node | ||
|
||
#### Input | ||
|
||
| Name | Type | Description | | ||
| :--------------------- | :---------------------------------------------- | :--------------- | | ||
| `~/input/lanelet2_map` | `autoware_auto_mapping_msgs::msg::HADMapBin` | Data of lanelet2 | | ||
| `~/input/pointcloud` | `sensor_msgs::msg::PointCloud2` | PointCloud | | ||
| `~/input/ekf_pose` | `geometry_msgs::msg::PoseWithCovarianceStamped` | EKF Pose | | ||
|
||
#### Output | ||
|
||
| Name | Type | Description | | ||
| :------------------------------ | :---------------------------------------------- | :----------------------------------------------------------------- | | ||
| `~/output/pose_with_covariance` | `geometry_msgs::msg::PoseWithCovarianceStamped` | Estimated pose | | ||
| `~/debug/pose_with_covariance` | `geometry_msgs::msg::PoseWithCovarianceStamped` | [debug topic] Estimated pose | | ||
| `~/debug/marker_detected` | `geometry_msgs::msg::PoseArray` | [debug topic] Detected marker poses | | ||
| `~/debug/marker_mapped` | `visualization_msgs::msg::MarkerArray` | [debug topic] Loaded landmarks to visualize in Rviz as thin boards | | ||
| `/diagnostics` | `diagnostic_msgs::msg::DiagnosticArray` | Diagnostics outputs | | ||
|
||
## Parameters | ||
|
||
{{ json_to_markdown("localization/landmark_based_localizer/lidar_marker_localizer/schema/lidar_marker_localizer.schema.json") }} | ||
|
||
## How to launch | ||
|
||
When launching Autoware, set `lidar-marker` for `pose_source`. | ||
|
||
```bash | ||
ros2 launch autoware_launch ... \ | ||
pose_source:=lidar-marker \ | ||
... | ||
``` | ||
|
||
## Design | ||
|
||
### Flowchart | ||
|
||
```plantuml | ||
@startuml | ||
group main process | ||
start | ||
if (Receive a map?) then (yes) | ||
else (no) | ||
stop | ||
endif | ||
:Interpolate based on the received ego-vehicle's positions to align with sensor time; | ||
if (Could interpolate?) then (yes) | ||
else (no) | ||
stop | ||
endif | ||
:Detect markers (see "Detection Algorithm"); | ||
:Calculate the distance from the ego-vehicle's positions to the nearest marker's position on the lanelet2 map; | ||
if (Find markers?) then (yes) | ||
else (no) | ||
if (the distance is nearby?) then (yes) | ||
stop | ||
note : Error. It should have been able to detect marker | ||
else (no) | ||
stop | ||
note : Not Error. There are no markers around the ego-vehicle | ||
endif | ||
endif | ||
:Calculate the correction amount from the ego-vehicle's position; | ||
if (Is the found marker's position close to the one on the lanelet2 map?) then (yes) | ||
else (no) | ||
stop | ||
note : Detected something that isn't a marker | ||
endif | ||
:Publish result; | ||
stop | ||
end group | ||
@enduml | ||
``` | ||
|
||
## Detection Algorithm | ||
|
||
![detection_algorithm](./doc_image/detection_algorithm.png) | ||
|
||
1. Split the LiDAR point cloud into rings along the x-axis of the base_link coordinate system at intervals of the `resolution` size. | ||
2. Find the portion of intensity that matches the `intensity_pattern`. | ||
3. Perform steps 1 and 2 for each ring, accumulate the matching indices, and detect portions where the count exceeds the `vote_threshold_for_detect_marker` as markers. | ||
|
||
## Sample Dataset | ||
|
||
- [Sample rosbag and map](https://drive.google.com/file/d/1FuGKbkWrvL_iKmtb45PO9SZl1vAaJFVG/view?usp=sharing) | ||
|
||
This dataset was acquired in National Institute for Land and Infrastructure Management, Full-scale tunnel experiment facility. | ||
The reflectors were installed by [Taisei Corporation](https://www.taisei.co.jp/english/). | ||
|
||
## Collaborators | ||
|
||
- [TIER IV](https://tier4.jp/en/) | ||
- [Taisei Corporation](https://www.taisei.co.jp/english/) | ||
- [Yuri Shimizu](https://github.com/YuriShimizu824) |
39 changes: 39 additions & 0 deletions
39
.../landmark_based_localizer/lidar_marker_localizer/config/lidar_marker_localizer.param.yaml
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,39 @@ | ||
/**: | ||
ros__parameters: | ||
|
||
# marker name | ||
marker_name: "reflector" | ||
|
||
# for marker detection algorithm | ||
resolution: 0.05 | ||
# A sequence of high/low intensity to perform pattern matching. | ||
# 1: high intensity (positive match), 0: not consider, -1: low intensity (negative match) | ||
intensity_pattern: [-1, -1, 0, 1, 1, 1, 1, 1, 0, -1, -1] | ||
match_intensity_difference_threshold: 20 | ||
positive_match_num_threshold: 3 | ||
negative_match_num_threshold: 3 | ||
vote_threshold_for_detect_marker: 20 | ||
marker_height_from_ground: 1.075 | ||
|
||
# for interpolate algorithm | ||
self_pose_timeout_sec: 1.0 | ||
self_pose_distance_tolerance_m: 1.0 | ||
|
||
# for validation | ||
limit_distance_from_self_pose_to_nearest_marker: 2.0 | ||
limit_distance_from_self_pose_to_marker: 2.0 | ||
|
||
# base_covariance | ||
# [TBD] This value is dynamically scaled according to the distance at which markers are detected. | ||
base_covariance: [0.04, 0.0, 0.0, 0.0, 0.0, 0.0, | ||
0.0, 0.04, 0.0, 0.0, 0.0, 0.0, | ||
0.0, 0.0, 0.01, 0.0, 0.0, 0.0, | ||
0.0, 0.0, 0.0, 0.00007569, 0.0, 0.0, | ||
0.0, 0.0, 0.0, 0.0, 0.00007569, 0.0, | ||
0.0, 0.0, 0.0, 0.0, 0.0, 0.00030625] | ||
|
||
# for save log | ||
enable_save_log: false | ||
savefile_directory_path: detected_reflector_intensity | ||
savefile_name: detected_reflector_intensity | ||
save_frame_id: velodyne_top |
Binary file added
BIN
+75.9 KB
...ndmark_based_localizer/lidar_marker_localizer/doc_image/detection_algorithm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions
24
.../landmark_based_localizer/lidar_marker_localizer/launch/lidar_marker_localizer.launch.xml
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,24 @@ | ||
<launch> | ||
<arg name="param_file" default="$(find-pkg-share lidar_marker_localizer)/config/lidar_marker_localizer.param.yaml"/> | ||
|
||
<!-- Topic names --> | ||
<arg name="input_lanelet2_map" default="~/input/lanelet2_map"/> | ||
<arg name="input_ekf_pose" default="~/input/ekf_pose"/> | ||
<arg name="input_pointcloud" default="~/input/pointcloud"/> | ||
|
||
<arg name="output_pose_with_covariance" default="~/output/pose_with_covariance"/> | ||
|
||
<arg name="service_trigger_node_srv" default="~/service/trigger_node_srv"/> | ||
|
||
<node pkg="lidar_marker_localizer" exec="lidar_marker_localizer" name="lidar_marker_localizer" output="log"> | ||
<remap from="~/input/pointcloud_ex" to="$(var input_pointcloud)"/> | ||
<remap from="~/input/ekf_pose" to="$(var input_ekf_pose)"/> | ||
<remap from="~/input/lanelet2_map" to="$(var input_lanelet2_map)"/> | ||
|
||
<remap from="~/output/pose_with_covariance" to="$(var output_pose_with_covariance)"/> | ||
|
||
<remap from="~/service/trigger_node_srv" to="$(var service_trigger_node_srv)"/> | ||
|
||
<param from="$(var param_file)"/> | ||
</node> | ||
</launch> |
41 changes: 41 additions & 0 deletions
41
localization/landmark_based_localizer/lidar_marker_localizer/package.xml
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,41 @@ | ||
<?xml version="1.0"?> | ||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>lidar_marker_localizer</name> | ||
<version>0.0.0</version> | ||
<description>The lidar_marker_localizer package</description> | ||
<maintainer email="[email protected]">Yamato Ando</maintainer> | ||
<maintainer email="[email protected]">Shintaro Sakoda</maintainer> | ||
<license>Apache License 2.0</license> | ||
<author email="[email protected]">Eijiro Takeuchi</author> | ||
<author email="[email protected]">Yamato Ando</author> | ||
<author email="[email protected]">Shintaro Sakoda</author> | ||
|
||
<buildtool_depend>ament_cmake_auto</buildtool_depend> | ||
<buildtool_depend>autoware_cmake</buildtool_depend> | ||
|
||
<depend>autoware_point_types</depend> | ||
<depend>landmark_manager</depend> | ||
<depend>lanelet2_extension</depend> | ||
<depend>localization_util</depend> | ||
<depend>pcl_conversions</depend> | ||
<depend>pcl_msgs</depend> | ||
<depend>pcl_ros</depend> | ||
<depend>rclcpp</depend> | ||
<depend>sensor_msgs</depend> | ||
<depend>std_msgs</depend> | ||
<depend>std_srvs</depend> | ||
<depend>tf2</depend> | ||
<depend>tf2_eigen</depend> | ||
<depend>tf2_geometry_msgs</depend> | ||
<depend>tf2_ros</depend> | ||
<depend>tf2_sensor_msgs</depend> | ||
<depend>tier4_autoware_utils</depend> | ||
|
||
<test_depend>ament_lint_auto</test_depend> | ||
<test_depend>autoware_lint_common</test_depend> | ||
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
</export> | ||
</package> |
Oops, something went wrong.