Apollo
10.0
自动驾驶开放平台
preprocessor_submodule.h
浏览该文件的文档.
1
/******************************************************************************
2
* Copyright 2019 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
#include <string>
21
22
#include "modules/common_msgs/chassis_msgs/chassis.pb.h"
23
#include "modules/common_msgs/control_msgs/control_cmd.pb.h"
24
#include "modules/common_msgs/control_msgs/pad_msg.pb.h"
25
#include "modules/common_msgs/localization_msgs/localization.pb.h"
26
#include "modules/common_msgs/planning_msgs/planning.pb.h"
27
#include "modules/control/control_component/proto/preprocessor.pb.h"
28
29
#include "
cyber/class_loader/class_loader.h
"
30
#include "
cyber/component/component.h
"
31
#include "
cyber/component/timer_component.h
"
32
#include "
modules/common/monitor_log/monitor_log_buffer.h
"
33
#include "
modules/common/status/status.h
"
34
#include "
modules/common/util/util.h
"
35
#include "
modules/control/control_component/controller_task_base/common/dependency_injector.h
"
36
37
namespace
apollo
{
38
namespace
control {
39
40
class
PreprocessorSubmodule
final :
public
cyber::Component
<LocalView> {
41
public
:
46
PreprocessorSubmodule
();
50
~PreprocessorSubmodule
();
55
std::string
Name
()
const
;
56
61
bool
Init
()
override
;
62
63
bool
Proc
(
const
std::shared_ptr<LocalView> &
local_view
)
override
;
64
65
private
:
72
common::Status
CheckInput(
LocalView
*
local_view
);
73
80
common::Status
CheckTimestamp(
const
LocalView
&
local_view
);
81
82
common::Status
ProducePreprocessorStatus(
Preprocessor
*preprocessor_status);
83
84
private
:
85
double
init_time_ = 0.0;
86
87
bool
estop_ =
false
;
88
89
common::monitor::MonitorLogBuffer
monitor_logger_buffer_;
90
91
common::Header
latest_replan_trajectory_header_;
92
93
std::mutex mutex_;
94
95
std::shared_ptr<cyber::Reader<LocalView>> local_view_reader_;
96
97
std::shared_ptr<cyber::Writer<Preprocessor>> preprocessor_writer_;
98
99
std::shared_ptr<DependencyInjector> injector_;
100
};
101
102
CYBER_REGISTER_COMPONENT
(
PreprocessorSubmodule
);
103
104
}
// namespace control
105
}
// namespace apollo
class_loader.h
apollo::common::Status
A general class to denote the return status of an API call.
Definition
status.h:43
apollo::common::monitor::MonitorLogBuffer
class MonitorLogBuffer
Definition
monitor_log_buffer.h:60
apollo::control::PreprocessorSubmodule
Definition
preprocessor_submodule.h:40
apollo::control::PreprocessorSubmodule::Name
std::string Name() const
Get name of the node
Definition
preprocessor_submodule.cc:47
apollo::control::PreprocessorSubmodule::Init
bool Init() override
Initialize the submodule
Definition
preprocessor_submodule.cc:51
apollo::control::PreprocessorSubmodule::PreprocessorSubmodule
PreprocessorSubmodule()
Construct a new Preprocessor Submodule object
Definition
preprocessor_submodule.cc:42
apollo::control::PreprocessorSubmodule::Proc
bool Proc(const std::shared_ptr< LocalView > &local_view) override
Definition
preprocessor_submodule.cc:62
apollo::control::PreprocessorSubmodule::~PreprocessorSubmodule
~PreprocessorSubmodule()
Destructor
Definition
preprocessor_submodule.cc:45
apollo::cyber::Component
Definition
component.h:60
status.h
component.h
CYBER_REGISTER_COMPONENT
#define CYBER_REGISTER_COMPONENT(name)
Definition
component.h:656
dependency_injector.h
util.h
Some util functions.
monitor_log_buffer.h
The class of MonitorLogBuffer
apollo
class register implement
Definition
arena_queue.h:37
apollo::common::Header
Definition
header.proto:7
apollo::control::LocalView
Definition
local_view.proto:11
apollo::control::Preprocessor
Definition
preprocessor.proto:10
local_view
LocalView contains all necessary data as planning input
timer_component.h
modules
control
control_component
submodules
preprocessor_submodule.h