MVSim
Lightweight simulator for 2.5D vehicles and robots
EllipseCurveMethod.h
1 /*+-------------------------------------------------------------------------+
2  | MultiVehicle simulator (libmvsim) |
3  | |
4  | Copyright (C) 2025 Francisco Pérez Ibañez |
5  | Copyright (C) 2014-2026 Jose Luis Blanco Claraco |
6  | Copyright (C) 2017 Borys Tymchenko (Odessa Polytechnic University) |
7  | Distributed under 3-clause BSD License |
8  | See COPYING |
9  +-------------------------------------------------------------------------+ */
10 
11 #pragma once
12 
13 #include <box2d/b2_friction_joint.h>
14 #include <mvsim/FrictionModels/FrictionBase.h>
15 #include <mvsim/TParameterDefinitions.h>
16 #include <mvsim/Wheel.h>
17 
18 namespace mvsim
19 {
28 {
29  DECLARES_REGISTER_FRICTION(EllipseCurveMethod)
30  public:
32 
33  // See docs in base class.
34  virtual mrpt::math::TVector2D evaluate_friction(
35  const FrictionBase::TFrictionInput& input) const override;
36 
37  private:
38  // TODO: Move to VehicleBase
39  // double CA_ = 8; //!< aerodynamic force coefficient (non-dimensional)
40 
41  double C_damping_ = 0.01;
42  double C_rr_ = 0.0;
43 
44  // Ellipse curve parameters:
45  double C_alpha_ = 8.5;
46  double C_s_ = 7.5;
47 
48  double slip_angle_saturation_ = 0.1;
49  double slip_ratio_saturation_ = 0.1;
50 
51  double C_alpha_s_ = 0.5;
52  double C_s_alpha_ = 0.5;
53 
54  public:
55  const TParameterDefinitions params_ = {
56  {"C_damping", {"%lf", &C_damping_}},
57  {"C_rr", {"%lf", &C_rr_}},
58  {"C_s", {"%lf", &C_s_}},
59  {"slip_angle_saturation", {"%lf", &slip_angle_saturation_}},
60  {"slip_ratio_saturation", {"%lf", &slip_ratio_saturation_}},
61  {"C_alpha", {"%lf", &C_alpha_}},
62  {"C_alpha_s", {"%lf", &C_alpha_s_}},
63  {"C_s_alpha", {"%lf", &C_s_alpha_}}};
64 };
65 } // namespace mvsim
Definition: EllipseCurveMethod.h:28
virtual mrpt::math::TVector2D evaluate_friction(const FrictionBase::TFrictionInput &input) const override
Definition: FrictionBase.h:29
Definition: VehicleBase.h:44
Definition: FrictionBase.h:41