ApolloAuto / apollo

An open autonomous driving platform
Apache License 2.0
25.06k stars 9.68k forks source link

Running Sim Model without passing sensor data #15370

Open chiragr15 opened 5 months ago

chiragr15 commented 5 months ago

I have a question on how the tool is able to run modules which require lidar/camera/ground-truth data like prediction/perception during 'Sim Control'? I am able to route and actuate the vehicle on some demo maps using bootstrap and Sim Control without sending any explicit sensor data channels for the modules to read from. How is this possible in Sim Control? Does the sensor data come from pre-simulated data?

YuqiHuai commented 5 months ago

For the planning module to operate, it needs to receive prediction messages, and SimControl publishes dummy prediction messages with no obstacle by default. So to run SimControl pretty much only planning and routing need to be turned on, and there will be no obstacle in simulation.

Checkout https://github.com/ApolloAuto/apollo/blob/03e6dddcc065355281af2e7c4eb27fa8db4d919f/modules/dreamview/backend/common/sim_control_manager/dynamic_model/perfect_control/sim_perfect_control.cc#L514-L524

There also exist tools like replay_perception that publish perception messages, then you can turn on the prediction module can see Apollo reacting to those obstacles in SimControl simulation.