|
1 | 1 | # Tuning localization |
2 | 2 |
|
3 | 3 | ## Introduction |
| 4 | + |
| 5 | +In this section, |
| 6 | +our focus will be on refining localization accuracy within the YTU Campus environment through updates to localization parameters and methods. |
| 7 | +Our approach entails using NDT as the pose input source, |
| 8 | +and the Gyro Odometer as the twist input source. |
| 9 | +These adjustments play a pivotal role |
| 10 | +in achieving a heightened level of precision and reliability in our localization processes, |
| 11 | +ensuring optimal performance in the specific conditions of the YTU campus. |
| 12 | + |
| 13 | +## NDT parameter tuning |
| 14 | + |
| 15 | +### Crop-box filter for localization input |
| 16 | + |
| 17 | +- In our campus environment, certain areas can be challenging for NDT localization, |
| 18 | + particularly those near cliffs or wooded areas that are far from buildings. |
| 19 | + |
| 20 | +<figure markdown> |
| 21 | + { align=center } |
| 22 | + <figcaption> |
| 23 | + Yıldız Technical University (YTU) campus challenging areas for NDT localization. |
| 24 | + </figcaption> |
| 25 | +</figure> |
| 26 | + |
| 27 | +- In these areas, |
| 28 | + the default NDT range |
| 29 | + (which involves cropping the NDT input point cloud at the localization utility point cloud pipeline) |
| 30 | + may prove insufficient for aligning point clouds. |
| 31 | + The default NDT input point cloud parameters are shown below: |
| 32 | + |
| 33 | +!!! 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." |
| 34 | + |
| 35 | + ```yaml |
| 36 | + /**: |
| 37 | + ros__parameters: |
| 38 | + input_frame: "base_link" |
| 39 | + output_frame: "base_link" |
| 40 | + min_x: -60.0 |
| 41 | + max_x: 60.0 |
| 42 | + min_y: -60.0 |
| 43 | + max_y: 60.0 |
| 44 | + min_z: -30.0 |
| 45 | + max_z: 50.0 |
| 46 | + negative: False |
| 47 | + ``` |
| 48 | + |
| 49 | +- The green points (topic name: `/localization/pose_estimator/points_aligned`) |
| 50 | + represent the NDT localization aligned points on the map in the image below. |
| 51 | + The default range is 60 meters, meaning points beyond this distance cannot be utilized. |
| 52 | + |
| 53 | +<figure markdown> |
| 54 | + { align=center } |
| 55 | + <figcaption> |
| 56 | + NDT aligned points within a 60-meter crop box range |
| 57 | + </figcaption> |
| 58 | +</figure> |
| 59 | + |
| 60 | +- If we wish to increase our NDT input point cloud range, |
| 61 | + we can make the following changes in the `crop_box_filter_measurement_range.param.yaml` file. |
| 62 | + However, |
| 63 | + please bear in mind that since this alteration enlarges the size of the NDT input point cloud, |
| 64 | + it will require additional resources on your processor. |
| 65 | + |
| 66 | + ```diff |
| 67 | + /**: |
| 68 | + ros__parameters: |
| 69 | + input_frame: "base_link" |
| 70 | + output_frame: "base_link" |
| 71 | + - min_x: -60.0 |
| 72 | + + min_x: -150.0 |
| 73 | + - max_x: 60.0 |
| 74 | + + max_x: 150.0 |
| 75 | + - min_y: -60.0 |
| 76 | + + min_y: -150.0 |
| 77 | + - max_y: 60.0 |
| 78 | + + max_y: 150.0 |
| 79 | + min_z: -30.0 |
| 80 | + max_z: 50.0 |
| 81 | + negative: False |
| 82 | + ``` |
| 83 | + |
| 84 | +<figure markdown> |
| 85 | + { align=center } |
| 86 | + <figcaption> |
| 87 | + NDT aligned points within a 150-meter crop box range |
| 88 | + </figcaption> |
| 89 | +</figure> |
| 90 | + |
| 91 | +### Voxel-grid filter for localization input |
| 92 | + |
| 93 | +- Voxel Grid filtering is a technique used in point cloud pre-processing |
| 94 | + to reduce the density of 3D point cloud data while preserving its overall structure. |
| 95 | + This is especially useful in scenarios |
| 96 | + where high-resolution point clouds are computationally expensive |
| 97 | + to process or unnecessary for the task at hand. |
| 98 | + The default voxel size for all three axes in Autoware is 3.0. |
| 99 | + If you have additional computational resources, |
| 100 | + reducing the voxel size can enhance localization accuracy. |
| 101 | + However, please be aware that this will demand more computational power. |
| 102 | + |
| 103 | +!!! 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." |
| 104 | + |
| 105 | + ```yaml |
| 106 | + /**: |
| 107 | + ros__parameters: |
| 108 | + voxel_size_x: 3.0 |
| 109 | + voxel_size_y: 3.0 |
| 110 | + voxel_size_z: 3.0 |
| 111 | + ``` |
| 112 | + |
| 113 | +- The default voxel size for downsampling is 3.0, |
| 114 | + and the resulting aligned points will resemble the image below. |
| 115 | + |
| 116 | +<figure markdown> |
| 117 | + { align=center } |
| 118 | + <figcaption> |
| 119 | + Voxel size 3.0 aligned points (more sparse) |
| 120 | + </figcaption> |
| 121 | +</figure> |
| 122 | + |
| 123 | +- We have sufficient computational power available on our tutorial vehicle, |
| 124 | + so we will reduce the voxel size to improve localization accuracy. |
| 125 | + Feel free to experiment with tuning the voxel size for your own computer setup. |
| 126 | + |
| 127 | + ```diff |
| 128 | + |
| 129 | + /**: |
| 130 | + ros__parameters: |
| 131 | + - voxel_size_x: 3.0 |
| 132 | + + voxel_size_x: 1.0 |
| 133 | + - voxel_size_y: 3.0 |
| 134 | + + voxel_size_y: 1.0 |
| 135 | + - voxel_size_z: 3.0 |
| 136 | + + voxel_size_z: 1.0 |
| 137 | + ``` |
| 138 | + |
| 139 | +<figure markdown> |
| 140 | + { align=center } |
| 141 | + <figcaption> |
| 142 | + Voxel size 1.0 aligned points (more dense but it requires computational power) |
| 143 | + </figcaption> |
| 144 | +</figure> |
0 commit comments