Free Electron
LinearTire.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __tire_LinearTire_h__
8 #define __tire_LinearTire_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /// @brief Simple Linear Tire Model
17  : public AsTireModel, public Initialize<AsLinearTireModel>
18 {
19  public:
20  AsConstruct(AsLinearTireModel);
21  void initialize(void)
22  {
23  add(stiffness, FE_USE("tire:z:stiffness"));
24  add(damping, FE_USE("tire:z:damping"));
25  add(xy_stiffness, FE_USE("tire:xy:stiffness"));
26  add(friction, FE_USE("tire:friction"));
27  add(do_rollover, FE_USE("tire:do_rollover"));
28  add(pneumatic_trail, FE_USE("tire:pneumatic_trail"));
29  add(Fmax, FE_USE("tire:Fmax"));
30  }
31  Accessor<Real> stiffness;
32  Accessor<Real> damping;
33  Accessor<Real> xy_stiffness;
34  Accessor<Real> friction;
35  Accessor<Real> pneumatic_trail;
36  Accessor<Real> Fmax;
37  Accessor<bool> do_rollover;
38 };
39 
40 
41 /// @brief Linear Tire Model
43  : virtual public TireI, virtual public StreamableI,
44  public CastableAs<LinearTire>
45 {
46  public:
47  LinearTire(void);
48 virtual ~LinearTire(void);
49 
50  /** Integrate a time step. */
51  void step(t_moa_real a_dt);
52 
53  /** Compile internal structure. This should be done
54  before any time stepping. */
55  bool compile(Record r_tire, Record r_config,
56  sp<RecordGroup> a_rg_dataset);
57 
58  /// @name Dynamic State Accessors
59  /// @{
60  void setVelocity( const t_moa_v3 &a_velocity);
61  void setAngularVelocity( const t_moa_v3 &a_ang_velocity);
62  void setContact( const t_moa_real a_radius,
63  const t_moa_real a_inclination);
64  const t_moa_v3 &getForce(void);
65  const t_moa_v3 &getMoment(void);
66  const t_moa_v3 &getVelocity(void);
67  const t_moa_v3 &getAngularVelocity(void);
68  const t_moa_real &getRadius(void) { return m_radius; }
69 
70  t_moa_real &contactRadius(void) { return m_contact_radius; }
71  t_moa_real &inclination(void) { return m_inclination; }
72 
73 virtual void output(std::ostream &a_ostrm)
74  {
75  a_ostrm << m_force[0] << " " << m_force[1] << " " << m_force[2];
76  }
77 virtual void input(std::istream &a_istrm)
78  {
79  a_istrm >> m_force[0] >> m_force[1] >> m_force[2];
80  }
81 
82  private:
83  void initialize(void);
84  // dynamic state
85  t_moa_v3 m_force;
86  t_moa_v3 m_moment;
87  t_moa_v3 m_velocity;
88  t_moa_v3 m_angular_velocity;
89  t_moa_real m_contact_radius;
90  t_moa_real m_inclination;
91 
92  // geometry
93  t_moa_real m_radius;
94  t_moa_real m_width;
95  t_moa_real m_pneumatic_trail;
96 
97  bool m_do_rollover;
98 
99  t_moa_real m_xy_stiffness;
100  t_moa_real m_z_stiffness;
101  t_moa_real m_z_damping;
102  t_moa_real m_Cf;
103  t_moa_real m_Fmax;
104 };
105 
106 } /* namespace ext */
107 } /* namespace fe */
108 
109 #endif /* __tire_LinearTire_h__ */
110 
Simple Linear Tire Model.
Definition: LinearTire.h:16
Linear Tire Model.
Definition: LinearTire.h:42
Tire Model.
Definition: tireAS.h:22
kernel
Definition: namespace.dox:3
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
The most simple least common denominator, single contact, patch oriented Many (most?) "tire models" are this, or use this.
Definition: TireI.h:17
Reference to an instance of a Layout.
Definition: RecordSB.h:35
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192