lgsvl / simulator

A ROS/ROS2 Multi-robot Simulator for Autonomous Vehicles
Other
2.29k stars 781 forks source link

Reproducible Apollo/SVL simulations #1548

Open ebadi opened 3 years ago

ebadi commented 3 years ago

We are using PythonAPI to control Apollo AD for enabling modules, setting source and destination for the ego vehicle and the SVL simulator for setting way points for pedestrians and other vehicles. However when we run the same simulation several times, the measurements (e.g. distance between agents) are not identical. Our guess is that there is no method of synchrony between SVL and APollo, is this correct? Is there a method like this in svl ?

Since loading Apollo modules takes several seconds and this causes Apollo to lag behind SVL, in the absence of tick synchrony, what are the best practices to achieve similar simulations (even when they are run in different machines)?

lemketron commented 3 years ago

Apollo is not deterministic but telling Apollo to use the simulator's clock sensor helps synchronize time between SVL Simulator and Apollo to give Apollo the best chance of processing data and responding more similarly from run to run. This allows Apollo to use the Simulator's notion of time rather than real world time. Refer to the documentation here: https://www.svlsimulator.com/docs/simulation-content/sensors-list/#clock