Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
pacejka_combined_slip.cpp
Go to the documentation of this file.
2
3std::pair<double, double> PacejkaCombinedSlip::tire_forces(double slip_angle, double slip_ratio,
4 double vertical_load) const {
5 // Longitudinal pure slip force (Fx0)
6 double Bx = this->car_parameters_->tire_parameters.tire_B_longitudinal;
7 double Cx = this->car_parameters_->tire_parameters.tire_C_longitudinal;
8 double Dx = this->car_parameters_->tire_parameters.tire_D_longitudinal * vertical_load;
9 double Ex = this->car_parameters_->tire_parameters.tire_E_longitudinal;
10
11 double Fx0 = Dx * std::sin(Cx * std::atan(Bx * slip_ratio -
12 Ex * (Bx * slip_ratio - std::atan(Bx * slip_ratio))));
13
14 // Lateral pure slip force (Fy0)
15 double By = this->car_parameters_->tire_parameters.tire_B_lateral;
16 double Cy = this->car_parameters_->tire_parameters.tire_C_lateral;
17 double Dy = this->car_parameters_->tire_parameters.tire_D_lateral * vertical_load;
18 double Ey = this->car_parameters_->tire_parameters.tire_E_lateral;
19
20 double Fy0 = Dy * std::sin(Cy * std::atan(By * slip_angle -
21 Ey * (By * slip_angle - std::atan(By * slip_angle))));
22
23 // Combined slip reduction factors (friction ellipse type)
24 double Gx = std::cos(std::atan(By * slip_angle));
25 double Gy = std::cos(std::atan(Bx * slip_ratio));
26
27 // Final forces with combined slip
28 double Fx = Fx0 * Gx;
29 double Fy = Fy0 * Gy;
30
31 return std::make_pair(Fx, Fy);
32}
std::pair< double, double > tire_forces(double slip_angle, double slip_ratio, double vertical_load) const override
Calculate the forces acting in a tire based on the tire characteristics and dynamic state.
std::shared_ptr< common_lib::car_parameters::CarParameters > car_parameters_