Vehicle Track Reading
These functions are responsible for reading vehicle track information from provided csv file into a vector of scenes, a format compatible with AutomotiveSimulator.jl
AutomotiveInteraction.INTERACTIONTrajdata
— TypeINTERACTIONTrajdata The trajectory data stored in the original INTERACTION dataset format. The dataset is a csv file with columns: trackid - Int64 - Representing the id of the agent frameid - Int64 - Represents the frames in which the agent appears in the video timestampms - Int64 - represents the time the agent appears in the video. The unit is millisecond agenttype - String - Can be person, car, truck and so on x - Float64 - x position, in meter y - Float64 - y position in meter vx - Float64 - x velocity in m/s vy - Float64 - y velocity in m/s psi_rad - Float64 - yaw angle in radian length - Float64 - Length of the vehicle, in meter width - Float64 - Width of the vehicle, in meter
Example
tdraw = INTERACTIONTrajdata("vehicle_tracks_000.csv");
AutomotiveInteraction.carsinframe
— Functioncarsinframe(trajdata::INTERACTIONTrajdata, frame::Int)
- From the dictionary
frame2cars
which has frame number as key and all vector of car ids in that frame
as value, this function extracts the value corresponding to key given by frame
Example
# Return array with car ids in frame 1
carsinframe(tdraw,1)
AutomotiveInteraction.car_df_index
— Functionfunction car_df_index
- Given frame and carid, find index of car in trajdata
- Returns 0 if it does not exist (CAVEAT THIS IS COMMENTED OUT)
AutomotiveInteraction.read_veh_tracks
— Functionfunction read_veh_tracks(;roadway)
- Reads the vehicle tracks information from
../dataset/vehicle_tracks_000.csv
- Modernize to stop using
ListRecord
andTrajdata
- Just use Vector of Scenes
Arguments
- roadway: Used in the vehicle state to create
Frenet
coords for the vehicle on the provided roadway
Example
road_ext = make_interaction_roadway_with_extensions()
trajdata = read_veh_tracks(roadway=road_ext)
# Then access a certain framenumber from the trajdata by
scene = trajdata[1]
render([road_ext,scene,IDOverlay(scene=scene)])