Apollo  6.0
Open source self driving car software
header_builder.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2018 The Apollo Authors. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *****************************************************************************/
16 
17 #ifndef CYBER_RECORD_HEADER_BUILDER_H_
18 #define CYBER_RECORD_HEADER_BUILDER_H_
19 
20 #include "cyber/proto/record.pb.h"
21 
22 namespace apollo {
23 namespace cyber {
24 namespace record {
25 
30  public:
40  static proto::Header GetHeaderWithSegmentParams(
41  const uint64_t segment_interval, const uint64_t segment_raw_size);
42 
52  static proto::Header GetHeaderWithChunkParams(const uint64_t chunk_interval,
53  const uint64_t chunk_raw_size);
54 
60  static proto::Header GetHeader();
61 
62  private:
63  static const uint32_t MAJOR_VERSION_ = 1;
64  static const uint32_t MINOR_VERSION_ = 0;
65  static const proto::CompressType COMPRESS_TYPE_ =
66  proto::CompressType::COMPRESS_NONE;
67  static const uint64_t CHUNK_INTERVAL_ = 20 * 1000 * 1000 * 1000ULL; // 20s
68  static const uint64_t SEGMENT_INTERVAL_ = 60 * 1000 * 1000 * 1000ULL; // 60s
69  static const uint64_t CHUNK_RAW_SIZE_ = 200 * 1024 * 1024ULL; // 200MB
70  static const uint64_t SEGMENT_RAW_SIZE_ = 2048 * 1024 * 1024ULL; // 2GB
71 };
72 
73 } // namespace record
74 } // namespace cyber
75 } // namespace apollo
76 
77 #endif // CYBER_RECORD_HEADER_BUILDER_H_
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
static proto::Header GetHeaderWithSegmentParams(const uint64_t segment_interval, const uint64_t segment_raw_size)
Build a record header with customized max interval time (ns) and max raw size (byte) for segment...
The builder of record header.
Definition: header_builder.h:29
static proto::Header GetHeaderWithChunkParams(const uint64_t chunk_interval, const uint64_t chunk_raw_size)
Build a record header with customized max interval time (ns) and max raw size (byte) for chunk...
static proto::Header GetHeader()
Build a default record header.