Thinklab-SJTU / Bench2Drive

[NeurIPS 2024 Datasets and Benchmarks Track] Closed-Loop E2E-AD Benchmark Enhanced by World Model RL Expert
Other
1.3k stars 85 forks source link

开源数据集中每个json之间的时间间隔? #88

Closed array-svg closed 2 months ago

array-svg commented 2 months ago

由于我们的车辆模型和传感器配置的改变,所以希望对您开源出来的数据集进行再生成。我们读取您这边开源数据集中json的数据集的控制量,搭配我们给定的新的车辆模型的传感器配置生成新的图片和其他传感器数据。但是遇到的问题是,按照给定的data_collect的频率 10hz, 然后读取给定的json控制量去控车,发现并没有完美复现数据集开源的结果。所以想问问您这边开源出来的数据集每个json之间的时间间隔

jiaxiaosong1002 commented 2 months ago

@array-svg 10Hz.

array-svg commented 2 months ago

您好,使用Bench2Drive full dataset中的ParkingCutIn_Town12_Route1711_Weather15中的数据集,将数据集中的对应的json文件按顺序排列后,读出其中的x, y 值,然后使用python脚本绘制。发现他的轨迹是震荡的,这是为什么?这似乎和数据集中的图片是对应不上的?

https://github.com/user-attachments/assets/4c17e2d8-95dc-4dd1-99fe-7b5f1901ddd8

这是我们按顺序绘制json的结果 这是前5个点的结果 99836043-ee82-4ef5-9a41-0573a864ada4 这是前10个点的结果 DlteCtLgq5 这是前20个点的结果 tWk8TLleoP 这是所有点的结果 BIpTnnQzPe 这似乎和图片数据集上的结果对应不上

array-svg commented 2 months ago

from pathlib import Path

def list_files_in_directory(directory_path): return [str(file) for file in Path(directory_path).rglob('*') if file.is_file()]

directory_path = '/home/xxxi01/Downloads/route/ParkingCutIn_Town12_Route1711_Weather15/anno/' files = list_files_in_directory(directory_path)

import os, re def extract_number(file_path): filename = os.path.basename(file_path) match = re.search(r'\d+', filename) # 查找文件名中的数字 return int(match.group()) if match else -1 # 没有找到数字则返回 -1

files = sorted(files, key=extract_number)

x = [] y = [] for file in files: import gzip import json with gzip.open(file, 'rt', encoding='utf-8') as gz_file: data = json.load(gz_file) x.append(data['x']) y.append(data['y']) print("file: ", file) print("x: ", data['x']) print("y: ", data['y'])

print("len(x): ", len(x)) print("len(y): ", len(y)) import matplotlib.pyplot as plt

before = -1 plt.scatter(x[:before], y[:before], marker='o', linestyle='-', color='b') # 画线

plt.title('Line Plot of x vs y') # 图表标题 plt.xlabel('x') # x 轴标签 plt.ylabel('y') # y 轴标签

plt.grid(True)

plt.show()

这是我使用的绘图脚本

jiaxiaosong1002 commented 2 months ago

@array-svg The movement is around 1 meter, which means the vehicle is almost static. Note that CARLA IMU sensor intentionally adds noise to challenge the robustness of users. You may use the GT location which is noiseless.

array-svg commented 2 months ago

好的感谢!已解决!