Apollo 10.0
自动驾驶开放平台
mpc_controller_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/calibration_table.pb.h"
28#include "modules/control/control_component/proto/preprocessor.pb.h"
29
37
38namespace apollo {
39namespace control {
40class MPCControllerSubmodule final : public cyber::Component<Preprocessor> {
41 public:
51
56 std::string Name() const;
57
62 bool Init() override;
63
70 bool Proc(const std::shared_ptr<Preprocessor>& preprocessor_status) override;
71
72 private:
73 common::Status ProduceControlCoreCommand(
74 const LocalView& local_view, ControlCommand* control_core_command);
75
76 private:
77 bool estop_ = false;
78
79 common::monitor::MonitorLogBuffer monitor_logger_buffer_;
80
81 std::shared_ptr<ControlTask> mpc_controller_;
82
83 std::mutex mutex_;
84 // TODO(SHU): separate conf
85 std::shared_ptr<cyber::Writer<ControlCommand>> control_core_writer_;
86 std::shared_ptr<DependencyInjector> injector_;
87};
88
90
91} // namespace control
92} // namespace apollo
A general class to denote the return status of an API call.
Definition status.h:43
MPCControllerSubmodule()
Construct a new MPCControllerSubmodule object
std::string Name() const
Get name of the node
bool Proc(const std::shared_ptr< Preprocessor > &preprocessor_status) override
generate control command
bool Init() override
Initialize the node
#define CYBER_REGISTER_COMPONENT(name)
Definition component.h:656
Defines the Controller base class.
Some util functions.
The class of MonitorLogBuffer
class register implement
Definition arena_queue.h:37
LocalView contains all necessary data as planning input