NGSIM数据集 NGSIM: http://ngsim-community.org/
数据一: US 101 - http://gateway.path.berkeley.edu/ngsimdocs/US-101
早上45分钟的数据,每15分钟记录, vehicle trajectory data provide precise location of each vehicle 10HZ
数据二: I-80 -http://gateway.path.berkeley.edu/ngsimdocs/I-80 下午45分钟的数据,每15分钟记录, vehicle trajectory data provide precise location of each vehicle 10HZ
数据特征:
下载数据 以上两个数据的网址都502了,我自己官网下载的是1.5G的csv文件
官网数据描述:
Researchers for the Next Generation Simulation (NGSIM) program collected detailed vehicle trajectory data on southbound US 101 and Lankershim Boulevard in Los Angeles, CA, eastbound I-80 in Emeryville, CA and Peachtree Street in Atlanta, Georgia. Data was collected through a network of synchronized digital video cameras.NGVIDEO, a customized software application developed for the NGSIM program, transcribed the vehicle trajectory data from the video. This vehicle trajectory data provided the precise location of each vehicle within the study area every one-tenth of a second, resulting in detailed lane positions and locations relative to other vehicles. Click the “Show More” button below to find additional contextual data and metadata for this dataset.
翻译:
(NGSIM)计划的研究人员收集了详细的车辆轨迹数据,这些数据分别位于加利福尼亚州洛杉矶的美国101南行和Lankershim大道,加利福尼亚州埃默里维尔的I-80东行以及佐治亚州亚特兰大的桃树街。数据是通过同步数码摄像机网络收集的。为NGSIM程序开发的定制软件应用程序NGVIDEO从视频中记录了车辆的轨迹数据。该车辆轨迹数据每十分之一秒便提供了每辆车在研究区域内的精确位置,从而得出详细的车道位置和相对于其他车辆的位置。单击下面的“Show more”按钮以查找此数据集的其他上下文数据和元数据:
NGSIM读取 ngsim读取与ros可视化
数据 下载地址 ,如图,选择export,然后下载csv格式,大概1.5G左右
pandas读取与使用 import pandas as pdcsv_fname = '../data.txt' data = pd.read_csv(csv_fname) data.sort_values("Frame_ID" ,inplace=True ) obd_data = data[data["Vehicle_ID" ]==354 ] rows = obd_data.shape[0 ] cols = obd_data.shape[1 ] print(data['Frame_ID' ].value_counts()) for row in data.iterrows(): row = row[1 ] frame_id, obs_id, timestamp = row["Frame_ID" ], row['Vehicle_ID' ], row["Global_Time" ]*1e-6
论文一 论文1:Lane-Change Social Behavior Generator for Autonomous Driving Car by Non-parametric Regression in Reproducing Kernel Hilbert Space, by Chiyu Dong, Yihuan Zhangy and John M. Dolanz
换道场景: 输入:本车轨迹,周围车(本车道前后车,目标车道并行车及其前后车)的轨迹
输出:换道行为(换道起点和终点) 连续的值。
起点和终点定义如下:
总结 本文和VIN都是利用监督训练的思路
VIN中是网格化全局输入,动作为离散的8个动作,监督信息为利用优化方法生成的最优轨迹,环境是静态环境,但是可以迁移至新环境中;
本文的输入是==多车的轨迹数据==,输出的是==本车换道起点和终点==,环境对于本车可看成动态场景,但其实是把所有vehicle的轨迹看作一个整体作为输入,这里选择输出为两个点的信息而非轨迹信息或者waypoint信息,可能是因为输出的维度直接影响到核函数矩阵的维度,维度太高或者连续信息的是不是有问题?
有没有什么可以结合的点呢? 完全抛开本文的方法,利用NGSIM的真实数据 整合成VIN需要的数据,训练和测试一次 利用全卷积网络尝试对于变输入维度下的VIN
LC_NGSIM 从NGSIM中提取的变道轨迹
数据集附在此文章下:
Lane-change social behavior generator for autonomous driving car by non-parametric regression in Reproducing Kernel Hilbert Space
另外附了一篇相关论文:Ramp Merging,不用看
源代码: playaround.m 作用:加载变道数据和变道点并进行可视化
展示结果:
playaround.m源码:
clear all close all clc load ../data/lc_data_20s_withpoints lc_len = length (lc_data); for i = 1 : lc_len temp = lc_data{i }; pp = points(i ,:); lat = temp.veh_s.x; lon = temp.veh_s.y; figure (1 );hold off;plot (lon,lat,'b.' );hold on; plot (lon(pp(1 )),lat(pp(1 )),'o' ,'MarkerFaceColor' ,'g' ); plot (lon(pp(2 )),lat(pp(2 )),'o' ,'MarkerFaceColor' ,'r' ); end
TrajPreprocess.m 作用:处理丢失的数据,例如,其中一个周围车辆不存在
然后输出处理过的processed_relative.mat作为已处理数据集
TrajPreprocess.m源码:
clc; clear all; load('..\data\nlc_data_5zones.mat' ) load('..\data\lc_data_20s_withpoints.mat' ) r_lc_data = {}; Label = [points; 600 *ones (length (nlc_data),2 )]; for i = 1 : length (lc_data) trajs = lc_data{i }; origin_x = trajs.veh_s.x(1 ); origin_y = trajs.veh_s.y(1 ); R_trajs.veh_s_x = trajs.veh_s.x(1 :100 ) - origin_x; R_trajs.veh_s_y = trajs.veh_s.y(1 :100 ) - origin_y; Label(i ,1 ) = trajs.veh_s.y(points(i ,1 )) - origin_y; Label(i ,2 ) = trajs.veh_s.y(points(i ,2 )) - origin_y; da = []; if (trajs.veh_r.x(1 ) ~= 10000 ) R_trajs.veh_r_x = trajs.veh_r.x(1 :100 ) - origin_x; R_trajs.veh_r_y = trajs.veh_r.y(1 :100 ) - origin_y; else R_trajs.veh_r_x = 0 *trajs.veh_r.x(1 :100 ); R_trajs.veh_r_y = 0 *trajs.veh_r.y(1 :100 ); end if (trajs.veh_f.x(1 ) ~= 10000 ) R_trajs.veh_f_x = trajs.veh_f.x(1 :100 ) - origin_x; R_trajs.veh_f_y = trajs.veh_f.y(1 :100 ) - origin_y; else R_trajs.veh_f_x = 0 *trajs.veh_f.x(1 :100 ); R_trajs.veh_f_y = 0 *trajs.veh_f.y(1 :100 ); end if (trajs.veh_rt.x(1 ) ~= 10000 ) R_trajs.veh_rt_x = trajs.veh_rt.x(1 :100 ) - origin_x; R_trajs.veh_rt_y = trajs.veh_rt.y(1 :100 ) - origin_y; else R_trajs.veh_rt_x = 0 *trajs.veh_rt.x(1 :100 ); R_trajs.veh_rt_y = 0 *trajs.veh_rt.y(1 :100 ); end if (trajs.veh_ft.x(1 ) ~= 10000 ) R_trajs.veh_ft_x = trajs.veh_ft.x(1 :100 ) - origin_x; R_trajs.veh_ft_y = trajs.veh_ft.y(1 :100 ) - origin_y; else R_trajs.veh_ft_x = 0 *trajs.veh_ft.x(1 :100 ); R_trajs.veh_ft_y = 0 *trajs.veh_ft.y(1 :100 ); end if isfield(trajs, 'veh_st' ) && (trajs.veh_st.x(1 ) ~= 10000 ) R_trajs.veh_st_x = trajs.veh_st.x(1 :100 ) - origin_x; R_trajs.veh_st_y = trajs.veh_st.y(1 :100 ) - origin_y; else R_trajs.veh_st_x = 0 *trajs.veh_ft.x(1 :100 ); R_trajs.veh_st_y = 0 *trajs.veh_ft.y(1 :100 ); end da = [da;R_trajs.veh_s_x(end -19 :end -10 ) ]; da = [da;R_trajs.veh_f_x(end -19 :end -10 ) ]; da = [da;R_trajs.veh_rt_x(end -19 :end -10 ) ]; da = [da;R_trajs.veh_ft_x(end -19 :end -10 ) ]; da = [da;R_trajs.veh_st_x(end -19 :end -10 ) ]; r_lc_data{i }=R_trajs; end r_nlc_data = {}; for i = 1 : length (nlc_data) da = []; trajs = nlc_data{i }; origin_x = trajs.veh_s.x(1 ); origin_y = trajs.veh_s.y(1 ); R_trajs.veh_s_x = trajs.veh_s.x - origin_x; R_trajs.veh_s_y = trajs.veh_s.y - origin_y; if (trajs.veh_r.x(1 ) ~= 10000 ) R_trajs.veh_r_x = trajs.veh_r.x - origin_x; R_trajs.veh_r_y = trajs.veh_r.y - origin_y; else R_trajs.veh_r_x = 0 *trajs.veh_r.x; R_trajs.veh_r_y = 0 *trajs.veh_r.y; end if (trajs.veh_f.x(1 ) ~= 10000 ) R_trajs.veh_f_x = trajs.veh_f.x - origin_x; R_trajs.veh_f_y = trajs.veh_f.y - origin_y; else R_trajs.veh_f_x = 0 *trajs.veh_f.x; R_trajs.veh_f_y = 0 *trajs.veh_f.y; end if (trajs.veh_rt.x(1 ) ~= 10000 ) R_trajs.veh_rt_x = trajs.veh_rt.x - origin_x; R_trajs.veh_rt_y = trajs.veh_rt.y - origin_y; else R_trajs.veh_rt_x = 0 *trajs.veh_rt.x; R_trajs.veh_rt_y = 0 *trajs.veh_rt.y; end if (trajs.veh_ft.x(1 ) ~= 10000 ) R_trajs.veh_ft_x = trajs.veh_ft.x - origin_x; R_trajs.veh_ft_y = trajs.veh_ft.y - origin_y; else R_trajs.veh_ft_x = 0 *trajs.veh_ft.x; R_trajs.veh_ft_y = 0 *trajs.veh_ft.y; end if isfield(trajs, 'veh_st' ) && (trajs.veh_st.x(1 ) ~= 10000 ) R_trajs.veh_st_x = trajs.veh_st.x - origin_x; R_trajs.veh_st_y = trajs.veh_st.y - origin_y; else R_trajs.veh_st_x = 0 *trajs.veh_ft.x; R_trajs.veh_st_y = 0 *trajs.veh_ft.y; end da = [da;R_trajs.veh_s_x(end -19 :end -10 ) ]; da = [da;R_trajs.veh_f_x(end -19 :end -10 ) ]; da = [da;R_trajs.veh_rt_x(end -19 :end -10 ) ]; da = [da;R_trajs.veh_ft_x(end -19 :end -10 ) ]; da = [da;R_trajs.veh_st_x(end -19 :end -10 ) ]; r_nlc_data{i }=R_trajs; end save('../data/processed_relative.mat' ,'Label' ,'r_lc_data' ,'r_nlc_data' )
数据描述 mat文件 注:mat文件是matlab的数据存储的标准格式 。mat文件是标准的二进制文件,还可以ASCII码形式保存和加载,在MATLAB中打开显示类似于单行EXCEL表格 。
调用
用户可以调用matlab的子程序库,用c或fortran调用mat格式的数据。
几个相关函数名:
load 打开mat文件
save 关闭\保存mat文件
load(‘filename’,’X’,’Y’,’Z’) 加载filename文件中的X Y Z变量到工作区间中
save(‘filename’,’-struct’,’s’) 保存结构体s到filename中
nlc_data_5zones.mat
nlc_data: cell, 包含870个无变道场景的sequences
veh_s:主车
x : 横向位置 (m)
y : 纵向位置(m)
len :车辆长度(m)
wid : 车辆宽度(m)*
v : 车辆速度*Vehicle speed (m/s)
a : 车辆加速度 (m/s^2)
veh_f: 当前车道中的前车
veh_r: 当前车道中的后车
veh_ft:目标车道中的前车
veh_rt: 目标车道中的后车
veh_st:目标车道上的车辆重叠overlap vehicle in target lane???
lc_data_20s_withpoints.mat
lc_data: Same structure as nlc_data
points: array, n row, 2 column, [start, end]
其他相关论文 北京交通大学
基于NGSIM轨迹数据的换道行为微观特性分析
High D数据 参考链接:高速公路自然车辆轨迹的新数据集