Skip to content

Commit

Permalink
init tuning localization page
Browse files Browse the repository at this point in the history
Signed-off-by: ismetatabay <ismet@leodrive.ai>
  • Loading branch information
ismetatabay committed Oct 26, 2023
1 parent 383def4 commit d086011
Show file tree
Hide file tree
Showing 8 changed files with 144 additions and 3 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ general information about the YTU Davutpaşa Campus:
<figure markdown>
![ytu-campus-environment](images/ytu-campus.png){ align=center }
<figcaption>
Yıldız Technical University (YTU) campus map.
Yıldız Technical University (YTU) campus map.

Check warning on line 39 in docs/how-to-guides/integrating-autoware/tuning-parameters-and-performance/tuning-parameters/index.md

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (Yıldız)
</figcaption>
</figure>

Expand All @@ -54,7 +54,7 @@ we have converted the output map into MGRS format.
<figure markdown>
![ytu-campus-pcd-map](images/ytu-campus-pcd-map.png){ align=center }
<figcaption>
Yıldız Technical University (YTU) campus pointcloud map.
Yıldız Technical University (YTU) campus pointcloud map.
</figcaption>
</figure>

Expand All @@ -67,6 +67,6 @@ information on the Lanelet2 map creation process, please refer to the [`Creating
<figure markdown>
![ytu-campus-lanelet2-map](images/ytu-campus-lanelet2-map.png){ align=center }
<figcaption>
Yıldız Technical University (YTU) campus lanelet2 map.
Yıldız Technical University (YTU) campus lanelet2 map.
</figcaption>
</figure>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,3 +1,144 @@
# Tuning localization

## Introduction

In this section,
our focus will be on refining localization accuracy within the YTU Campus environment through updates to localization parameters and methods.
Our approach entails using NDT as the pose input source,
and the Gyro Odometer as the twist input source.
These adjustments play a pivotal role
in achieving a heightened level of precision and reliability in our localization processes,
ensuring optimal performance in the specific conditions of the YTU campus.

## NDT parameter tuning

### Crop-box filter for localization input

- In our campus environment, certain areas can be challenging for NDT localization,
particularly those near cliffs or wooded areas that are far from buildings.

<figure markdown>
![ytu-campus-pcd-range](images/pcd-range-cloud-compare.png){ align=center }
<figcaption>
Yıldız Technical University (YTU) campus challenging areas for NDT localization.
</figcaption>
</figure>

- In these areas,
the default NDT range
(which involves cropping the NDT input point cloud at the localization utility point cloud pipeline)
may prove insufficient for aligning point clouds.
The default NDT input point cloud parameters are shown below:

!!! note " The default [crop_box_filter_measurement_range.param.yaml](https://github.com/autowarefoundation/autoware_launch/blob/main/autoware_launch/config/localization/crop_box_filter_measurement_range.param.yaml) file for localization util."

```yaml
/**:
ros__parameters:
input_frame: "base_link"
output_frame: "base_link"
min_x: -60.0
max_x: 60.0
min_y: -60.0
max_y: 60.0
min_z: -30.0
max_z: 50.0
negative: False
```

- The green points (topic name: `/localization/pose_estimator/points_aligned`)
represent the NDT localization aligned points on the map in the image below.
The default range is 60 meters, meaning points beyond this distance cannot be utilized.

<figure markdown>
![ytu-campus-pcd-range](images/ndt-range-60m.png){ align=center }
<figcaption>
NDT aligned points within a 60-meter crop box range
</figcaption>
</figure>

- If we wish to increase our NDT input point cloud range,
we can make the following changes in the `crop_box_filter_measurement_range.param.yaml` file.
However,
please bear in mind that since this alteration enlarges the size of the NDT input point cloud,
it will require additional resources on your processor.

```diff
/**:
ros__parameters:
input_frame: "base_link"
output_frame: "base_link"
- min_x: -60.0
+ min_x: -150.0
- max_x: 60.0
+ max_x: 150.0
- min_y: -60.0
+ min_y: -150.0
- max_y: 60.0
+ max_y: 150.0
min_z: -30.0
max_z: 50.0
negative: False
```

<figure markdown>
![ytu-campus-pcd-range](images/ndt-range-150m.png){ align=center }
<figcaption>
NDT aligned points within a 150-meter crop box range
</figcaption>
</figure>

### Voxel-grid filter for localization input

- Voxel Grid filtering is a technique used in point cloud pre-processing
to reduce the density of 3D point cloud data while preserving its overall structure.
This is especially useful in scenarios
where high-resolution point clouds are computationally expensive
to process or unnecessary for the task at hand.
The default voxel size for all three axes in Autoware is 3.0.
If you have additional computational resources,
reducing the voxel size can enhance localization accuracy.
However, please be aware that this will demand more computational power.

!!! note " The default [voxel_grid_filter.param.yaml](https://github.com/autowarefoundation/autoware_launch/blob/main/autoware_launch/config/localization/voxel_grid_filter.param.yaml) file for localization util."

```yaml
/**:
ros__parameters:
voxel_size_x: 3.0
voxel_size_y: 3.0
voxel_size_z: 3.0
```

- The default voxel size for downsampling is 3.0,
and the resulting aligned points will resemble the image below.

<figure markdown>
![voxel-size-1.0](images/voxel-size-3.0.png){ align=center }
<figcaption>
Voxel size 3.0 aligned points (more sparse)
</figcaption>
</figure>

- We have sufficient computational power available on our tutorial vehicle,
so we will reduce the voxel size to improve localization accuracy.
Feel free to experiment with tuning the voxel size for your own computer setup.

```diff

/**:
ros__parameters:
- voxel_size_x: 3.0
+ voxel_size_x: 1.0
- voxel_size_y: 3.0
+ voxel_size_y: 1.0
- voxel_size_z: 3.0
+ voxel_size_z: 1.0
```

<figure markdown>
![voxel-size-1.0](images/voxel-size-1.0.png){ align=center }
<figcaption>
Voxel size 1.0 aligned points (more dense but it requires computational power)
</figcaption>
</figure>

0 comments on commit d086011

Please sign in to comment.