scenario_simulator_v2 C++ API
sim_model_delay_steer_vel.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_VEL_HPP_
16 #define SIMPLE_PLANNING_SIMULATOR__VEHICLE_MODEL__SIM_MODEL_DELAY_STEER_VEL_HPP_
17 
18 #include <deque>
19 #include <eigen3/Eigen/Core>
20 #include <eigen3/Eigen/LU>
21 #include <iostream>
22 #include <queue>
29 {
30 public:
46  double vx_lim, double steer_lim, double vx_rate_lim, double steer_rate_lim, double wheelbase,
47  double dt, double vx_delay, double vx_time_constant, double steer_delay,
48  double steer_time_constant, double steer_dead_band);
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  };
65  enum IDX_U {
66  VX_DES = 0,
67  STEER_DES,
68  };
69 
70  const double vx_lim_;
71  const double vx_rate_lim_;
72  const double steer_lim_;
73  const double steer_rate_lim_;
74  const double wheelbase_;
75  double prev_vx_ = 0.0;
76  double current_ax_ = 0.0;
77 
78  std::deque<double> vx_input_queue_;
79  std::deque<double> steer_input_queue_;
80  const double vx_delay_;
81  const double vx_time_constant_;
83  const double steer_delay_;
84  const double
85  steer_time_constant_;
86  const double steer_dead_band_;
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 };
147 
148 #endif // SIMPLE_PLANNING_SIMULATOR__VEHICLE_MODEL__SIM_MODEL_DELAY_STEER_VEL_HPP_
calculate delay steering dynamics
Definition: sim_model_delay_steer_vel.hpp:29
SimModelDelaySteerVel(double vx_lim, double steer_lim, double vx_rate_lim, double steer_rate_lim, double wheelbase, double dt, double vx_delay, double vx_time_constant, double steer_delay, double steer_time_constant, double steer_dead_band)
constructor
Definition: sim_model_delay_steer_vel.cpp:18
~SimModelDelaySteerVel()=default
destructor
simple_planning_simulator vehicle model class to calculate vehicle dynamics
Definition: sim_model_interface.hpp:26