Apollo  6.0
Open source self driving car software
relative_map.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 #pragma once
18 
19 #include <string>
20 
25 #include "modules/map/relative_map/proto/navigation.pb.h"
26 #include "modules/map/relative_map/proto/relative_map_config.pb.h"
27 #include "modules/perception/proto/perception_obstacle.pb.h"
28 
29 namespace apollo {
30 namespace relative_map {
31 
32 class RelativeMap {
33  public:
34  RelativeMap();
35 
39  std::string Name() const { return "RelativeMap"; }
40 
46  common::VehicleStateProvider* vehicle_state_provider);
47 
53 
57  void Stop();
58 
62  virtual ~RelativeMap() = default;
63 
68  bool Process(MapMsg* const map_msg);
69 
70  void OnPerception(
71  const perception::PerceptionObstacles& perception_obstacles);
72  void OnChassis(const canbus::Chassis& chassis);
73  void OnLocalization(const localization::LocalizationEstimate& localization);
74  void OnNavigationInfo(const NavigationInfo& navigation_info);
75 
76  private:
77  bool CreateMapFromNavigationLane(MapMsg* map_msg);
78  RelativeMapConfig config_;
79  apollo::common::monitor::MonitorLogBuffer monitor_logger_buffer_;
80 
81  NavigationLane navigation_lane_;
82  perception::PerceptionObstacles perception_obstacles_;
83  canbus::Chassis chassis_;
84  localization::LocalizationEstimate localization_;
85 
86  std::mutex navigation_lane_mutex_;
87  common::VehicleStateProvider* vehicle_state_provider_;
88 };
89 
90 } // namespace relative_map
91 } // namespace apollo
void OnPerception(const perception::PerceptionObstacles &perception_obstacles)
NavigationLane generates a real-time relative map based on navagation lines.
Definition: navigation_lane.h:97
Definition: relative_map.h:32
void Stop()
module stop function
The class of vehicle state. It includes basic information and computation about the state of the vehi...
Definition: vehicle_state_provider.h:46
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
apollo::common::Status Init(common::VehicleStateProvider *vehicle_state_provider)
module initialization function
void OnNavigationInfo(const NavigationInfo &navigation_info)
bool Process(MapMsg *const map_msg)
main logic of the relative_map module, runs periodically triggered by timer.
apollo::common::Status Start()
module start function
std::string Name() const
module name
Definition: relative_map.h:39
void OnLocalization(const localization::LocalizationEstimate &localization)
virtual ~RelativeMap()=default
destructor
The class of MonitorLogBuffer.
A general class to denote the return status of an API call. It can either be an OK status for success...
Definition: status.h:43
This class help collect MonitorMessage pb to monitor topic. The messages can be published automatical...
Definition: monitor_log_buffer.h:60
void OnChassis(const canbus::Chassis &chassis)