scenario_simulator_v2 C++ API
sim_model_delay_steer_acc_geared.hpp
Go to the documentation of this file.
1 // Copyright 2021 The Autoware Foundation.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef SIMPLE_PLANNING_SIMULATOR__VEHICLE_MODEL__SIM_MODEL_DELAY_STEER_ACC_GEARED_HPP_
16 #define SIMPLE_PLANNING_SIMULATOR__VEHICLE_MODEL__SIM_MODEL_DELAY_STEER_ACC_GEARED_HPP_
17 
18 #include <deque>
19 #include <eigen3/Eigen/Core>
20 #include <eigen3/Eigen/LU>
21 #include <iostream>
22 #include <queue>
24 
26 {
27 public:
45  double vx_lim, double steer_lim, double vx_rate_lim, double steer_rate_lim, double wheelbase,
46  double dt, double acc_delay, double acc_time_constant, double steer_delay,
47  double steer_time_constant, double steer_dead_band, double debug_acc_scaling_factor,
48  double debug_steer_scaling_factor);
49 
54 
55 private:
56  const double MIN_TIME_CONSTANT;
57 
58  enum IDX {
59  X = 0,
60  Y,
61  YAW,
62  VX,
63  STEER,
64  ACCX,
65  };
66  enum IDX_U {
67  ACCX_DES = 0,
68  STEER_DES,
69  DRIVE_SHIFT,
70  };
71 
72  const double vx_lim_;
73  const double vx_rate_lim_;
74  const double steer_lim_;
75  const double steer_rate_lim_;
76  const double wheelbase_;
77 
78  std::deque<double> acc_input_queue_;
79  std::deque<double> steer_input_queue_;
80  const double acc_delay_;
81  const double acc_time_constant_;
82  const double steer_delay_;
83  const double steer_time_constant_;
84  const double steer_dead_band_;
85  const double debug_acc_scaling_factor_;
86  const double debug_steer_scaling_factor_;
87 
92  void initializeInputQueue(const double & dt);
93 
97  double getX() override;
98 
102  double getY() override;
103 
107  double getYaw() override;
108 
112  double getVx() override;
113 
117  double getVy() override;
118 
122  double getAx() override;
123 
127  double getWz() override;
128 
132  double getSteer() override;
133 
138  void update(const double & dt) override;
139 
145  Eigen::VectorXd calcModel(const Eigen::VectorXd & state, const Eigen::VectorXd & input) override;
146 
154  void updateStateWithGear(
155  Eigen::VectorXd & state, const Eigen::VectorXd & prev_state, const uint8_t gear,
156  const double dt);
157 };
158 
159 #endif // SIMPLE_PLANNING_SIMULATOR__VEHICLE_MODEL__SIM_MODEL_DELAY_STEER_ACC_GEARED_HPP_
Definition: sim_model_delay_steer_acc_geared.hpp:26
SimModelDelaySteerAccGeared(double vx_lim, double steer_lim, double vx_rate_lim, double steer_rate_lim, double wheelbase, double dt, double acc_delay, double acc_time_constant, double steer_delay, double steer_time_constant, double steer_dead_band, double debug_acc_scaling_factor, double debug_steer_scaling_factor)
constructor
Definition: sim_model_delay_steer_acc_geared.cpp:19
~SimModelDelaySteerAccGeared()=default
default destructor
simple_planning_simulator vehicle model class to calculate vehicle dynamics
Definition: sim_model_interface.hpp:26