sisl / AutomotiveDrivingModels.jl

Driving simulation architecture for Julia
Other
63 stars 29 forks source link

The difference between NGSIMTrajdata and Trajdata #80

Open DarrenRuan opened 4 years ago

DarrenRuan commented 4 years ago

Could you tell me where could I find the definition of Trajdata? Because based on the hints below, we could find the explicit definitions of Trajdata. But I could not find it in AutomotiveDrivingModels.jl/src/simulation/.

The resulting files can then be loaded into a Julia program as Trajdata, a type defined in AutomotiveDrivingModels.jl. See jnotebooks/Demo.ipynb for example usage.

In the file https://github.com/sisl/NGSIM.jl/blob/83378b59f8f766ad30be87a9ddba0ead1de9562a/src/trajdata.jl#L201 The NGSIMTrajdata is converted to Trajdata. Could you tell me why should we do that? BTW, could you tell me what is the difference between NGSIMTrajdata and Trajdata? I could find the definition of NGSIMTrajdata.

MaximeBouton commented 4 years ago

Trajdata lives in AutomotiveDrivingModels (look at the src code of v0.7.12 not master) https://github.com/sisl/AutomotiveDrivingModels.jl/blob/v0.7.12/src/states/trajdatas.jl#L5 You can see that it is an alias of the ListRecord object which is defined here: https://github.com/sisl/Records.jl/blob/master/src/listrecords.jl This datastructure is rather complicated and not well documented. We decided to drop its support in AutomotiveSimulators as most of its functionalities can be achieved by using Vector instead.

An NGSIMTrajdata is defined here: https://github.com/sisl/NGSIM.jl/blob/master/src/ngsim_trajdata.jl#L25

@raunakbh92 will be able to provide more help.

raunakbh92 commented 4 years ago

Trajdata was an alias to ListRecord, a container used to store a sequence of scenes. For the NGSIM data case, it was used as a means to read in the vehicle trajectory information from the NGSIM provided files, in a format that was then amenable to being replayed using AutomotiveDrivingModels and visualized using AutoViz. As Maxime mentioned, the same functionality can be replicated by using Vector{Scene}. Here is an example of doing that for another dataset, called the interaction dataset.