Apollo  6.0
Open source self driving car software
proto_adapter.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2020 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 #pragma once
18 
19 #include <memory>
20 
21 #include "modules/v2x/proto/v2x_car_status.pb.h"
22 #include "modules/v2x/proto/v2x_junction.pb.h"
23 #include "modules/v2x/proto/v2x_obu_rsi.pb.h"
24 #include "modules/v2x/proto/v2x_obu_traffic_light.pb.h"
25 #include "modules/v2x/proto/v2x_rsi.pb.h"
26 #include "modules/v2x/proto/v2x_traffic_light.pb.h"
27 
30 
31 namespace apollo {
32 namespace v2x {
38  BUS_LANE = 123,
39  TIDAL_LANE = 41,
42  NO_HONKING = 80,
51 };
52 
53 using OSLightColor = ::apollo::v2x::SingleTrafficLight_Color;
54 using OSLightype = ::apollo::v2x::SingleTrafficLight_Type;
55 using ObuLightype = ::apollo::v2x::obu::SingleTrafficLight_Type;
56 using OSLight = ::apollo::v2x::IntersectionTrafficLightData;
57 using ObuLight = ::apollo::v2x::obu::ObuTrafficLight;
58 using OSLocation = ::apollo::localization::LocalizationEstimate;
59 using OSRsi = ::apollo::v2x::RsiMsg;
62 using ObuJunction = ::apollo::v2x::Junction;
63 class ProtoAdapter final {
64  public:
65  static OSLightype LightTypeObu2Sys(int32_t type);
66  static bool LightObu2Sys(const ObuLight &obu_light,
67  std::shared_ptr<OSLight> *os_light);
68  static bool RsiObu2Sys(const ObuRsi *obu_rsi, std::shared_ptr<OSRsi> *os_rsi);
69  static bool JunctionHd2obu(const HDJunction &hd_junction,
70  std::shared_ptr<ObuJunction> *obu_junction);
71 };
72 
73 } // namespace v2x
74 } // namespace apollo
Definition: proto_adapter.h:40
::apollo::v2x::Junction ObuJunction
Definition: proto_adapter.h:62
Definition: proto_adapter.h:41
Definition: proto_adapter.h:34
static bool JunctionHd2obu(const HDJunction &hd_junction, std::shared_ptr< ObuJunction > *obu_junction)
Definition: proto_adapter.h:43
Definition: proto_adapter.h:38
Definition: proto_adapter.h:50
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
::apollo::localization::LocalizationEstimate OSLocation
Definition: proto_adapter.h:58
Definition: proto_adapter.h:42
Definition: proto_adapter.h:46
::apollo::v2x::obu::ObuRsi ObuRsi
Definition: proto_adapter.h:60
::apollo::v2x::IntersectionTrafficLightData OSLight
Definition: proto_adapter.h:56
::apollo::hdmap::JunctionInfoConstPtr HDJunction
Definition: proto_adapter.h:61
Definition: proto_adapter.h:63
static OSLightype LightTypeObu2Sys(int32_t type)
Definition: proto_adapter.h:47
static bool RsiObu2Sys(const ObuRsi *obu_rsi, std::shared_ptr< OSRsi > *os_rsi)
Definition: proto_adapter.h:45
::apollo::v2x::obu::ObuTrafficLight ObuLight
Definition: proto_adapter.h:57
Definition: proto_adapter.h:36
Definition: proto_adapter.h:39
::apollo::v2x::obu::SingleTrafficLight_Type ObuLightype
Definition: proto_adapter.h:55
Definition: proto_adapter.h:48
Definition: proto_adapter.h:44
static bool LightObu2Sys(const ObuLight &obu_light, std::shared_ptr< OSLight > *os_light)
::apollo::v2x::RsiMsg OSRsi
Definition: proto_adapter.h:59
Definition: proto_adapter.h:49
::apollo::v2x::SingleTrafficLight_Color OSLightColor
Definition: proto_adapter.h:53
Definition: proto_adapter.h:35
std::shared_ptr< const JunctionInfo > JunctionInfoConstPtr
Definition: hdmap_common.h:126
Definition: proto_adapter.h:37
::apollo::v2x::SingleTrafficLight_Type OSLightype
Definition: proto_adapter.h:54
RsiAlterType
Definition: proto_adapter.h:33