Apollo 10.0
自动驾驶开放平台
leadlag_controller.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
22#pragma once
23
24#include "modules/control/control_component/proto/leadlag_conf.pb.h"
25
30namespace apollo {
31namespace control {
32
39 public:
45 void Init(const LeadlagConf &leadlag_conf, const double dt);
46
51 void SetLeadlag(const LeadlagConf &leadlag_conf);
52
58 void TransformC2d(const double dt);
59
63 void Reset();
64
72 virtual double Control(const double error, const double dt);
73
79
80 protected:
81 // Control coefficients in contiouous-time domain
82 double alpha_ = 0.0;
83 double beta_ = 0.0;
84 double tau_ = 0.0;
85 double Ts_ = 0.01; // By default, control sampling time is 0.01 sec
86 // Control coefficients in discrete-time domain
87 double kn1_ = 0.0;
88 double kn0_ = 0.0;
89 double kd1_ = 0.0;
90 double kd0_ = 0.0;
91 // Inner (intermedia) state in discrete-time domain at Direct Form II
92 double previous_output_ = 0.0;
94 double innerstate_ = 0.0;
99};
100
101} // namespace control
102} // namespace apollo
control module main class, it processes localization, chassis, and pad data to compute throttle,...
A lead/lag controller for speed and steering using defualt integral hold
void Reset()
reset variables for lead/leg controller
void SetLeadlag(const LeadlagConf &leadlag_conf)
alpha, beta and tau
void TransformC2d(const double dt)
transfer lead/lag controller coefficients to the discrete-time form, with the bilinear transform (tra...
int InnerstateSaturationStatus() const
get saturation status
void Init(const LeadlagConf &leadlag_conf, const double dt)
initialize lead/lag controller
class register implement
Definition arena_queue.h:37