Apollo 10.0
自动驾驶开放平台
dependency_injector.h
浏览该文件的文档.
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 "modules/common_msgs/control_msgs/control_cmd.pb.h"
20#include "modules/common_msgs/control_msgs/control_interactive_msg.pb.h"
21#include "modules/common_msgs/external_command_msgs/command_status.pb.h"
22#include "modules/control/control_component/proto/control_debug.pb.h"
23
25
26namespace apollo {
27namespace control {
28
30 public:
31 DependencyInjector() = default;
32
34
36 return &vehicle_state_;
37 }
38
40 ADEBUG << "Get the new control_command: "
41 << control_command->ShortDebugString();
42 lon_debug_ = control_command->mutable_debug()->simple_lon_debug();
43 }
44
46 return &lon_debug_;
47 }
48
50 const external_command::CommandStatus& planning_command_status) {
51 planning_command_status_.CopyFrom(planning_command_status);
52 ADEBUG << "Received planning_command_status_ is "
53 << planning_command_status_.DebugString();
54 }
55
57 return &planning_command_status_;
58 }
59
61 return &control_command_;
62 }
63
65 return control_command_;
66 }
67
69 return &control_debug_previous_;
70 }
71
73 return control_debug_previous_;
74 }
75
77 return &control_debug_info_;
78 }
79
81 return control_debug_info_;
82 }
83
84 void control_debug_info_clear() { control_debug_info_.Clear(); }
85
87 control_process_ = control_process;
88 ADEBUG << "set control_process_ is " << control_process_;
89 }
90
91 const bool control_process() const { return control_process_; }
92
94 return &control_interactive_msg_;
95 }
96
98 return control_interactive_msg_;
99 }
100
101 private:
103 SimpleLongitudinalDebug lon_debug_;
104 external_command::CommandStatus planning_command_status_;
105 ControlDebugInfo control_debug_info_;
106 ControlDebugInfo control_debug_previous_;
107 ControlCommand control_command_;
108 ControlInteractiveMsg control_interactive_msg_;
109 bool control_process_ = false;
110};
111
112} // namespace control
113} // namespace apollo
const ControlCommand & previous_control_command() const
ControlCommand * previous_control_command_mutable()
const ControlDebugInfo & previous_control_debug() const
const ControlInteractiveMsg & control_interactive_info() const
const external_command::CommandStatus * get_planning_command_status() const
ControlInteractiveMsg * mutable_control_interactive_info()
void set_planning_command_status(const external_command::CommandStatus &planning_command_status)
ControlDebugInfo * mutable_control_debug_info()
ControlDebugInfo * previous_control_debug_mutable()
void set_control_process(bool control_process)
const ControlDebugInfo & control_debug_info() const
const SimpleLongitudinalDebug * Get_previous_lon_debug_info() const
apollo::common::VehicleStateProvider * vehicle_state()
void Set_pervious_control_command(ControlCommand *control_command)
#define ADEBUG
Definition log.h:41
class register implement
Definition arena_queue.h:37