apollo icon indicating copy to clipboard operation
apollo copied to clipboard

Question: Why replay mode can be detected based on timestamp gap of detected obstacles in Perception module?

Open hongkedavid opened this issue 8 years ago • 2 comments

Dear Apollo developers,

I am studying the implementation of the perception module and find an interesting configuration parameter FLAGS_replay_timestamp_gap on line 45 of modules/prediction/container/obstacles/obstacles_container.cc. I don't quite understand the if-condition in the following code snippet. Specifically, how can we guarantee that Apollo is indeed running in replay mode if the absolute time difference is greater than FLAGS_replay_timestamp_gap, which is set as 10.0 according to modules/prediction/common/prediction_gflags.cc? What does maximum timestamp gap for rosbag replay mean?

  if (std::fabs(timestamp - timestamp_) > FLAGS_replay_timestamp_gap) {
    if (FLAGS_prediction_offline_mode) {
      FeatureOutput::Write();
    }
    obstacles_.Clear();
    ADEBUG << "Replay mode is enabled.";
  } else if (timestamp <= timestamp_) {
    AERROR << "Invalid timestamp curr [" << timestamp << "] v.s. prev ["
           << timestamp_ << "].";
    return;
  }

Thanks very much for your clarification!

hongkedavid avatar Apr 20 '18 21:04 hongkedavid

This module is in prediction. Currently replay is set to work in 10hz.

techoe avatar Apr 24 '18 21:04 techoe

Got it. Thanks a lot for your clarification!

hongkedavid avatar May 30 '18 15:05 hongkedavid