Apollo  6.0
Open source self driving car software
msg_serializer.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 #pragma once
17 
18 #include <vector>
19 
21 #include "modules/perception/proto/perception_obstacle.pb.h"
22 
23 namespace apollo {
24 namespace perception {
25 namespace onboard {
26 
28  public:
29  MsgSerializer() = default;
30  ~MsgSerializer() = default;
31 
32  static bool SerializeMsg(double timestamp, uint64_t lidar_timestamp,
33  int seq_num,
34  const std::vector<base::ObjectPtr>& objects,
35  const apollo::common::ErrorCode& error_code,
36  PerceptionObstacles* obstacles);
37 
38  private:
39  static bool ConvertObjectToPb(const base::ObjectPtr& object_ptr,
40  PerceptionObstacle* pb_msg);
41 };
42 
43 } // namespace onboard
44 } // namespace perception
45 } // namespace apollo
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: msg_serializer.h:27
static bool SerializeMsg(double timestamp, uint64_t lidar_timestamp, int seq_num, const std::vector< base::ObjectPtr > &objects, const apollo::common::ErrorCode &error_code, PerceptionObstacles *obstacles)
std::shared_ptr< Object > ObjectPtr
Definition: object.h:123