Skip to content
This repository has been archived by the owner on Feb 24, 2022. It is now read-only.

Term 3 Simulator: Time Mismatch between Ego Vehicle and Sensor Fusion Data #98

Open
ser94mor opened this issue Dec 12, 2018 · 0 comments

Comments

@ser94mor
Copy link

ser94mor commented Dec 12, 2018

Hello!

I have been doing the path planning project for a long time. The last problem that I've fought was collision avoidance with a car in front of the ego vehicle. I struggle to do this for several days, checked my code multiple times, wrote unit tests for critical parts. Here is what I have found.

I assumed that at some time T, I receive the response from the simulator with data about ego car at time T and data about other cars at time T. Based on this reasonable assumption, I calculated predicted positions for other vehicles. That is, assume that I generate trajectories of length N and at time T have K points left in my previous path (K < N). My path planner needs to generate N-K more points. At the Kth point from the previous path, the time would be T+0.02*K. The Kth entry from the previous path is the starting point for the generation of the new trajectory of length N-K. The Kth point is the starting point for the behavior planner (time T+0.02*K), and the end point is some time T+0.02*K+Tb in the future (Tb is a behavior planning horizon). So, I generated predictions for other cars with the time 0.02*K+Tb into the future. It is reasonable since sensor fusion information was obtained at time point T.

However, despite all my hard work on resolving the problem, collisions between ego vehicle and a vehicle in front of it always happened. Collisions always happened, until I changed prediction time from 0.02*K+Tb to Tb. That is like the simulator sent me data about the ego vehicle at time T and data about other vehicles at time T+0.02*K. After this change, my collision avoidance code works perfectly and maintains the expected buffer between the cars (of approximate length in meters as I specified in the settings).

TO SUM UP: simulator sends information about the ego vehicle at time T and sensor fusion information about other cars at time T+0.02*K, where K equals the number of points left in the previous path.

I am reasonably confident that this timing mismatch is not caused by the code I have written. I have a separate prediction module, which is covered by unit tests. Unit tests use two simplified versions of a track (highway maps), which is a straight line and a circle. For both synthetic tracks, the results of my prediction module are as expected.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant