MCZhi / Driving-IRL-NGSIM

[T-ITS] Driving Behavior Modeling using Naturalistic Human Driving Data with Inverse Reinforcement Learning
MIT License
192 stars 37 forks source link

How to filter vehicles? #8

Open 123yu456 opened 2 months ago

123yu456 commented 2 months ago

If I want to filter the vehicle trajectories in the dataset to only include lane-changing trajectory data, how should I proceed? Could you give me some advice? 1. If I want to filter the vehicles in the dataset to only study those with lane-changing behavior, what code modifications would be involved in the data processing part? 2. I want to narrow down the selection range of surrounding vehicles, changing the original range of 50 meters to the preceding and following vehicles before and after the target vehicle changes lanes. Where should I make these modifications? I tried to change it myself but failed. I would greatly appreciate your advice. Thank you!

MCZhi commented 2 months ago

I guess you can just run the dump_data.py and use ngsim = ngsim_data('us-101'); ngsim.load('processed/us-101') to load the data as scenarios. This will allow you to access the trajectory data of all vehicles, including the ability to filter vehicles with lane-changing actions or select preceding and following vehicles.

123yu456 commented 2 months ago

Sorry, I'm having a hard time understanding your question. My coding skills are very basic, and I'm struggling to modify the code to focus only on vehicles with lane-changing behavior and to narrow down the range of surrounding vehicles. After looking through the code, I'm not sure where to find the relevant content to make these modifications. Feeling helpless, I turned to you for help. Additionally, I found some code online that others used to filter the NGSIM dataset, but I'm unsure how to integrate it into your code or where to add it.