Apollo  v5.5.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 
20 #include "cyber/time/time.h"
22 #include "modules/perception/proto/perception_obstacle.pb.h"
23 
24 namespace apollo {
25 namespace perception {
26 namespace onboard {
27 
29  public:
30  MsgSerializer() = default;
31  ~MsgSerializer() = default;
32 
33  static bool SerializeMsg(double timestamp, uint64_t lidar_timestamp,
34  int seq_num,
35  const std::vector<base::ObjectPtr>& objects,
36  const apollo::common::ErrorCode& error_code,
37  PerceptionObstacles* obstacles);
38 
39  private:
40  static bool ConvertObjectToPb(const base::ObjectPtr& object_ptr,
41  PerceptionObstacle* pb_msg);
42 };
43 
44 } // namespace onboard
45 } // namespace perception
46 } // namespace apollo
Definition: blob.h:72
Definition: msg_serializer.h:28
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:118