37using cyber::record::RecordWriter;
40 const std::string& restored_output_dir)
41 : source_record_dir_(source_record_dir),
42 restored_output_dir_(restored_output_dir) {}
56 AERROR <<
"unable to init triggers";
60 static constexpr uint64_t kMBToKB = 1024UL;
62 writer_->SetIntervalOfFileSegmentation(
64 writer_->SetSizeOfFileSegmentation(
67 AINFO <<
"output file path: " << output_file;
68 if (!
writer_->Open(output_file)) {
69 AERROR <<
"failed to open file for writing: " << output_file;
73 IntervalPool::Instance()->Reset();
74 IntervalPool::Instance()->SetIntervalEventLogFilePath(
88 if (!trigger->Init(trigger_conf)) {
89 AERROR <<
"unable to initiate trigger and collect channels";
99 if (trigger->ShouldRestore(msg)) {
BumperCrash trigger that fires when emergency mode is engaged
DriveEvent trigger that records drive events
EmergencyMode trigger that fires when emergency mode is engaged
HardBrake trigger that fires when hard break is engaged
bool InitTriggers(const SmartRecordTrigger &trigger_conf)
std::vector< std::unique_ptr< TriggerBase > > triggers_
RecordProcessor(const std::string &source_record_dir, const std::string &restored_output_dir)
const std::string restored_output_dir_
std::unique_ptr< cyber::record::RecordWriter > writer_
bool ShouldRestore(const cyber::record::RecordMessage &msg) const
const std::string source_record_dir_
virtual std::string GetDefaultOutputFile() const =0
virtual bool Init(const SmartRecordTrigger &trigger_conf)
A specialized trigger that does not trigger anything but indicates what small topics need to be resto...
Swerve trigger that fires when swerve is engaged
std::string GetFileName(const std::string &path, const bool remove_extension)
bool DirectoryExists(const std::string &directory_path)
Check if the directory specified by directory_path exists and is indeed a directory.
bool EnsureDirectory(const std::string &directory_path)
Check if a specified directory specified by directory_path exists.
Basic data struct of record message.
optional int32 time_segment
optional int32 size_segment
optional string trigger_log_file_path
optional RecordSegmentSetting segment_setting