Apollo 11.0
自动驾驶开放平台
pid_plus_controller.cc
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2017 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
18
19#include <cmath>
20
21#include "cyber/common/log.h"
22
23namespace apollo {
24namespace control {
25
35
36void PIDPlusController::SetPID(const PidPlusConf &pid_plus_conf) {
37 kp_ = pid_plus_conf.pid_conf().kp();
38 ki_ = pid_plus_conf.pid_conf().ki();
39 kd_ = pid_plus_conf.pid_conf().kd();
40 kaw_ = pid_plus_conf.pid_conf().kaw();
44 output_saturation_high_ = std::fabs(pid_plus_conf.pid_conf().output_saturation_level());
45 output_saturation_low_ = -std::fabs(pid_plus_conf.pid_conf().output_saturation_level());
46 ADEBUG << "kp: " << kp_ << " ki: " << ki_ << " kd: " << kd_ << " integrator_enabled: " << integrator_enabled_
47 << " integrator_saturation_high: " << integrator_saturation_high_;
48}
49
50} // namespace control
51} // namespace apollo
void InitPID()
initialize pid controller
void SetPID(const PidPlusConf &pid_plus_conf)
set pid controller coefficients for the proportional, integral, and derivative
#define ADEBUG
Definition log.h:41
class register implement
Definition arena_queue.h:37
optional double output_saturation_level
optional bool integrator_enable
Definition pid_conf.proto:6
optional double integrator_saturation_level
Definition pid_conf.proto:7