Skip to content

Commit 68ee545

Browse files
feat: add localization evaluation (#611)
* feat: add localization evaluation Signed-off-by: Melike Tanrıkulu <melike@leodrive.ai>
1 parent 934644b commit 68ee545

4 files changed

Lines changed: 283 additions & 9 deletions

File tree

docs/tutorials/.pages

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ nav:
22
- index.md
33
- ad-hoc-simulation
44
- scenario-simulation
5+
- components_evaluation
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Localization Evaluation
2+
3+
!!! warning
4+
5+
Under Construction
Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
### Introduction
2+
3+
#### Related Links
4+
5+
Data Collection Documentation --> <https://autowarefoundation.github.io/autoware-documentation/main/datasets/#istanbul-open-dataset>
6+
7+
#### Purpose
8+
9+
The purpose of this test is to see the performance of the current NDT based default autoware localization system in an urban environment and evaluate its results. Our expectation is to see the deficiencies of the localization and understand which situations we need to improve.
10+
11+
#### Test Environment
12+
13+
The test data was collected in Istanbul. It also includes some scenarios that may be challenging for localization, such as tunnels and bridges. You can find the entire route marked in the image below.
14+
![ist_dataset_route_3_resized](https://github.com/user-attachments/assets/e04c77b4-5192-4faf-839c-12429138708f)
15+
16+
#### Test Dataset & Map
17+
18+
Test and Mapping datasets are same and the dataset contains data from the portable mapping kit used for general mapping purposes.
19+
20+
The data contains data from the following sensors:
21+
22+
- 1 x Applanix POS LVX GNSS/INS System
23+
- 1 x Hesai Pandar XT32 LiDAR
24+
25+
You can find the data collected for testing and mapping in this [Documentation](https://autowarefoundation.github.io/autoware-documentation/main/datasets/#istanbul-open-dataset).
26+
27+
> <span style="color:green">**NOTE !**</span> </br>
28+
> Since there was no velocity source coming from the vehicle during all these tests, the twist message coming from GNSS/INS was given to ekf_localizer as the linear&angular velocity source. </br>
29+
> In order to understand whether this increases the error in cases where the GNSS/INS error increases in the tunnel and how it affects the system, localization in the tunnel was tested by giving only the pose from the NDT, without giving this velocity to ekf_localizer. </br>
30+
> The video of this test is [here](https://www.youtube.com/watch?v=ajgedIwwuaM). </br>
31+
> As seen in the video, when velocity is not given, localization in the tunnel deteriorates more quickly.
32+
> It is also predicted that if the IMU Twist message combined (/localization/twist_estimator/twist_with_covariance) with the linear velocity from the vehicle is given instead of the GNSS/INS Twist message, the performance in the tunnel will increase. However, this test cannot be done with the current data.
33+
34+
#### Expected Tests
35+
36+
1.) Firstly, it is aimed to detect the points where the localization is completely broken and to roughly control the localization.
37+
38+
2.) By extracting the metrics, it is aimed to see concretely how much the localization error has increased and what the level of performance is.
39+
40+
### How to Reproduce Tests
41+
42+
#### Test With Raw Data
43+
44+
If you test with raw data, you need to follow these `Test With Raw Data` instructions. Since you need to repeat all preprocessing operations on the input data in this test, you need to test by switching to the test branches in the sensor kit and individual params repos. You can perform these steps by following the instructions below.
45+
46+
##### Installation
47+
48+
1.) Download and unpack a test map files.
49+
50+
- You can also download [the map](https://drive.google.com/file/d/1WPWmFCjV7eQee4kyBpmGNlX7awerCPxc/view?usp=drive_link) manually.
51+
52+
```bash
53+
mkdir ~/autoware_ista_map
54+
gdown --id 1WPWmFCjV7eQee4kyBpmGNlX7awerCPxc -O ~/autoware_ista_map/
55+
```
56+
57+
> <span style="color:green">**NOTE !**</span></br>
58+
> You also need to add `lanelet2_map.osm` file to autoware_ista_map folder. Since no lanelet file is created for this map at the
59+
> moment, you can run any `lanelet2_map.osm` file by placing it in this folder.
60+
61+
2.) Download the test rosbag files.
62+
63+
- You can also download [the rosbag file](https://drive.google.com/drive/folders/1BMPcUhjq_BCLi521X88WpujoOiEi3_CJ?usp=drive_link) manually.
64+
65+
```bash
66+
mkdir ~/autoware_ista_data
67+
gdown --id 1uta5Xr_ftV4jERxPNVqooDvWerK0dn89 -O ~/autoware_ista_data/
68+
```
69+
70+
##### Prepare Autoware to Test
71+
72+
1.) Checkout autoware_launch:
73+
74+
```bash
75+
cd ~/autoware/src/launcher/autoware_launch/
76+
git remote add autoware_launch https://github.com/meliketanrikulu/autoware_launch.git
77+
git remote update
78+
git checkout evaluate_localization_issue_7652
79+
```
80+
81+
2.) Checkout individual_params:
82+
83+
```bash
84+
cd ~/autoware/src/param/autoware_individual_params/
85+
git remote add autoware_individual_params https://github.com/meliketanrikulu/autoware_individual_params.git
86+
git remote update
87+
git checkout evaluate_localization_issue_7652
88+
```
89+
90+
3.) Checkout sample_sensor_kit_launch:
91+
92+
```bash
93+
cd ~/autoware/src/sensor_kit/sample_sensor_kit_launch/
94+
git remote add sample_sensor_kit_launch https://github.com/meliketanrikulu/sample_sensor_kit_launch.git
95+
git remote update
96+
git checkout evaluate_localization_issue_7652
97+
```
98+
99+
4.) Compile updated packages:
100+
101+
```bash
102+
cd ~/autoware
103+
colcon build --symlink-install --packages-select sample_sensor_kit_launch autoware_individual_params autoware_launch common_sensor_launch
104+
```
105+
106+
##### Launch Autoware
107+
108+
```bash
109+
source ~/autoware/install/setup.bash
110+
ros2 launch autoware_launch logging_simulator.launch.xml map_path:=~/autoware_ista_map/ vehicle_model:=sample_vehicle sensor_model:=sample_sensor_kit
111+
```
112+
113+
##### Run Rosbag
114+
115+
```bash
116+
source ~/autoware/install/setup.bash
117+
ros2 bag play ~/autoware_ista_data/rosbag2_2024_09_11-17_53_54_0.db3
118+
```
119+
120+
#### Localization Test Only
121+
122+
If you only want to see the localization performance, follow the `Localization Test Only` instructions. For those who only want to perform localization tests, a second test bag file and a separate launch file have been created for this test. You can perform this test by following the instructions below.
123+
124+
##### Installation
125+
126+
1.) Download and unpack a test map files.
127+
128+
- You can also download [the map](https://drive.google.com/file/d/1WPWmFCjV7eQee4kyBpmGNlX7awerCPxc/view?usp=drive_link) manually.
129+
130+
```bash
131+
mkdir ~/autoware_ista_map
132+
gdown --id 1WPWmFCjV7eQee4kyBpmGNlX7awerCPxc -O ~/autoware_ista_map/
133+
```
134+
135+
> <span style="color:green">**NOTE !**</span></br>
136+
> You also need to add `lanelet2_map.osm` file to autoware_ista_map folder. Since no lanelet file is created for this map at the
137+
> moment, you can run any `lanelet2_map.osm` file by placing it in this folder.
138+
139+
2.) Download the test rosbag files.
140+
141+
- You can also download [the localization rosbag file](https://drive.google.com/file/d/1yEB5j74gPLLbkkf87cuCxUgHXTkgSZbn/view?usp=sharing) manually.
142+
143+
```bash
144+
mkdir ~/autoware_ista_data
145+
gdown --id 1yEB5j74gPLLbkkf87cuCxUgHXTkgSZbn -O ~/autoware_ista_data/
146+
```
147+
148+
##### Prepare Autoware to Test
149+
150+
1.) Checkout autoware_launch:
151+
152+
```bash
153+
cd ~/autoware/src/launcher/autoware_launch/
154+
git remote add autoware_launch https://github.com/meliketanrikulu/autoware_launch.git
155+
git remote update
156+
git checkout evaluate_localization_issue_7652
157+
```
158+
159+
2.) Compile updated packages:
160+
161+
```bash
162+
cd ~/autoware
163+
colcon build --symlink-install --packages-select autoware_launch
164+
```
165+
166+
##### Launch Autoware
167+
168+
```bash
169+
source ~/autoware/install/setup.bash
170+
ros2 launch autoware_launch urban_environment_localization_test.launch.xml map_path:=~/autoware_ista_map/
171+
```
172+
173+
##### Run Rosbag
174+
175+
```bash
176+
source ~/autoware/install/setup.bash
177+
ros2 bag play ~/autoware_ista_data/rosbag2_2024_09_12-14_59_58_0.db3
178+
```
179+
180+
### Test Results
181+
182+
#### Test 1: Simple Test of Localization
183+
184+
Simply put, how localization works in an urban environment was tested and the results were recorded on video.
185+
Here is the [test video](https://youtu.be/Bk4Oyk6FOg0?t=6).
186+
[<img src="https://github.com/user-attachments/assets/e0f7edbf-0596-4806-8dcd-b4156584e4c0" width="60%">](https://youtu.be/Bk4Oyk6FOg0?t=6")
187+
188+
We can see from video that there is a localization error in the longitudinal axis along the Eurasia tunnel. As expected, NDT based localization does not work properly here. However, since the NDT score cannot detect the distortion here, localization is not completely broken until the end of the tunnel. Localization is completely broken at the exit of the tunnel. I re-initialized the localization after vehicle exit the tunnel.
189+
190+
From this point on, we move on to the bridge scenario. This is one of the bridges connecting the Bosphorus and was the longest bridge on our route. Here too, we thought that NDT-based localization might be disrupted. However, I did not observe any disruption.
191+
192+
After this part there is another tunnel(Kagithane - Bomonti) and localization behaves similar to Eurasia tunnel. However, at the exit of this tunnel, it recovers localization on its own without the need for re-initialization.
193+
194+
##### Test 1 Summary
195+
196+
In summary, the places where there was visible deterioration with our test route were the tunnels. This was already an expected situation. Apart from this, we anticipated that we could have problems on the bridges, but I could not observe any deterioration in the localization on the bridges. Of course, it is useful to remind you at this point that these tests were conducted with a single data.
197+
198+
#### Test 2: Comparing Results with Ground Truth
199+
200+
1.) How NDT score changed ?
201+
202+
Along the route, only in a small section of the longest tunnel, the Eurasia Tunnel, did the NDT score remain below the expected values. However, there is a visible deterioration in localization in both tunnels on the route. As a result of this test, we saw that we cannot test the problems with the NDT score. You can see how the NDT score changes along the route in the image below. While looking at the visual, let's remember that the NDT score threshold is accepted as 2.3.
203+
204+
![ndt_nvtl drawio](https://github.com/user-attachments/assets/d2fcd062-856b-4dce-bd4a-8a1f49b835f4)
205+
206+
NDT Score (Nearest Voxel Transformation Likelihood) Threshold = 2.3
207+
208+
2.) Compare with Ground Truth
209+
210+
Ground Truth : In these tests, the post-processed GNSS / INS data was used as ground truth. Since the error of this ground truth data also decreases in the tunnel environment, it is necessary to evaluate these regions by taking into account the Ground Truth error.
211+
212+
During these tests, I compared the NDT and EKF exposures with Ground Truth and presented the results. I am sharing the test results below as png. However, if you want to examine this data in more detail, I have created an executable file for you to visualize and take a closer look at. You can access this executable file from [here](https://drive.google.com/drive/folders/145QXl6wfV7IB9NS-PzFQtsNnxnAn6a9o?usp=sharing). Currently there is only a version that works on Ubuntu at this link, but I plan to add it for Windows as well.
213+
You need to follow these steps:
214+
215+
```bash
216+
cd /your/path/show_evaluation_ubuntu
217+
./pose_main
218+
```
219+
220+
You can also update configurations with changing /configs/evaluation_pose.yaml
221+
222+
2d Trajectory :
223+
![2D_Trajectory drawio](https://github.com/user-attachments/assets/4eebd34f-dc87-4a2d-a4f9-07f068a7d8d7)
224+
225+
2D Error :
226+
![2d_error](https://github.com/user-attachments/assets/01f1a5a0-6fbd-4ae2-aa86-4ce7b5cdf141)
227+
228+
3D Trajectory:
229+
![3d_trajectory](https://github.com/user-attachments/assets/310b5d5f-430b-4f7a-b4fd-93063fc2ea8b)
230+
231+
3D Error:
232+
![3d_error](https://github.com/user-attachments/assets/6ab4a1cf-ad69-4847-8747-26efb3e9ce8e)
233+
234+
Lateral Error:
235+
236+
![lateral_error](https://github.com/user-attachments/assets/50ffba9e-b1c2-4407-90bc-002886540f9a)
237+
238+
Longitudinal Error:
239+
![longitudinal_error](https://github.com/user-attachments/assets/617ca024-7c29-4556-bb62-c1e54b19fd38)
240+
241+
Roll-Pitch-Yaw:
242+
![rpy](https://github.com/user-attachments/assets/68eef655-189a-4552-a99c-ab89df2136af)
243+
244+
Roll-Pitch-Yaw Error:
245+
![rpy_error](https://github.com/user-attachments/assets/071cd440-d64a-49a8-bf0a-86278e174048)
246+
247+
X-Y-Z:
248+
![xyz](https://github.com/user-attachments/assets/6d946f18-98f7-4297-bb1b-fad936fd1328)
249+
250+
X-Y-Z Error:
251+
252+
![xyz_error](https://github.com/user-attachments/assets/612559cc-a973-4096-9a76-3e27d87539fd)

docs/tutorials/index.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
1-
# Simulation tutorials
1+
# Tutorials
2+
3+
## Simulation tutorials
24

35
Simulations provide a way of verifying Autoware's functionality before field testing with an actual vehicle.
46
There are three main types of simulation that can be run ad hoc or via a scenario runner.
57

6-
## Simulation methods
8+
### Simulation methods
79

8-
### Ad hoc simulation
10+
#### Ad hoc simulation
911

1012
Ad hoc simulation is a flexible method for running basic simulations on your local machine, and is the recommended method for anyone new to Autoware.
1113

12-
### Scenario simulation
14+
#### Scenario simulation
1315

1416
Scenario simulation uses a scenario runner to run more complex simulations based on predefined scenarios.
1517
It is often run automatically for continuous integration purposes, but can also be run on a local machine.
1618

17-
## Simulation types
19+
### Simulation types
1820

19-
### Planning simulation
21+
#### Planning simulation
2022

2123
Planning simulation uses simple dummy data to test the Planning and Control components - specifically path generation, path following and obstacle avoidance. It verifies that a vehicle can reach a goal destination while avoiding pedestrians and surrounding cars, and is another method for verifying the validity of Lanelet2 maps. It also allows for testing of traffic light handling.
2224

23-
#### How does planning simulation work?
25+
##### How does planning simulation work?
2426

2527
1. Generate a path to the goal destination
2628
2. Control the car along the generated path
2729
3. Detect and avoid any humans or other vehicles on the way to the goal destination
2830

29-
### Rosbag replay simulation
31+
#### Rosbag replay simulation
3032

3133
Rosbag replay simulation uses prerecorded rosbag data to test the following aspects of the Localization and Perception components:
3234

@@ -35,6 +37,20 @@ Rosbag replay simulation uses prerecorded rosbag data to test the following aspe
3537

3638
By repeatedly playing back the data, this simulation type can also be used for endurance testing.
3739

38-
### Digital twin simulation
40+
#### Digital twin simulation
3941

4042
Digital twin simulation is a simulation type that is able to produce realistic data and simulate almost the entire system. It is also commonly referred to as end-to-end simulation.
43+
44+
## Evaluation Tutorials
45+
46+
### Components Evaluation
47+
48+
Components evaluation tutorials provide a way to evaluate the performance of Autoware's components in a controlled environment.
49+
50+
#### Localization Evaluation
51+
52+
The Localization Evaluation tutorial provides a way to evaluate the performance of the Localization component.
53+
54+
##### Urban Environment Evaluation
55+
56+
The Urban Environment Evaluation tutorial provides a way to evaluate the performance of the Localization component in urban environment. It uses the [Istanbul Open Dataset](https://autowarefoundation.github.io/autoware-documentation/main/datasets/#istanbul-open-dataset) for testing. Test data, map, test steps are included. Test results are also shared.

0 commit comments

Comments
 (0)