Free Electron
BlendTire.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_BlendTire_h__
8 #define __tire_BlendTire_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /// @brief Simple Blend Tire Model
17  : public AsTireModel, public Initialize<AsBlendTireModel>
18 {
19  public:
20  AsConstruct(AsBlendTireModel);
21  void initialize(void)
22  {
23  add(model_upper, FE_USE("tire:model:upper"));
24  add(model_lower, FE_USE("tire:model:lower"));
25  add(slow_blend, FE_USE("tire:slow_blend"));
26  }
27  Accessor<String> model_upper;
28  Accessor<String> model_lower;
29  /**
30  slow_blend parameters:
31  0: surface vel crossover (m/s)
32  1: surface vel crossover smoothness
33  2: slip vel crossover (m/s)
34  3: slip vel crossover smoothness
35  */
37 
38 
39 };
40 
41 
42 /// @brief Blend Tire Model
43 class BlendTire
44  : virtual public TireI, virtual public StreamableI,
45  public CastableAs<BlendTire>
46 {
47  public:
48  BlendTire(void);
49 virtual ~BlendTire(void);
50 
51  /** Integrate a time step. */
52  void step(t_moa_real a_dt);
53 
54  /** Compile internal structure. This should be done
55  before any time stepping. */
56  bool compile(Record r_tire, Record r_config,
57  sp<RecordGroup> a_rg_dataset);
58 
59  /// @name Dynamic State Accessors
60  /// @{
61  void setVelocity( const t_moa_v3 &a_velocity);
62  void setAngularVelocity( const t_moa_v3 &a_ang_velocity);
63  void setContact( const t_moa_real a_radius,
64  const t_moa_real a_inclination);
65  const t_moa_v3 &getForce(void);
66  const t_moa_v3 &getMoment(void);
67  const t_moa_v3 &getVelocity(void);
68  const t_moa_v3 &getAngularVelocity(void);
69  const t_moa_real &getRadius(void) { return m_radius; }
70 
71  t_moa_real &contactRadius(void) { return m_contact_radius; }
72  t_moa_real &inclination(void) { return m_inclination; }
73 
74 virtual void output(std::ostream &a_ostrm)
75  {
76  a_ostrm << m_force[0] << " " << m_force[1] << " " << m_force[2];
77  }
78 virtual void input(std::istream &a_istrm)
79  {
80  a_istrm >> m_force[0] >> m_force[1] >> m_force[2];
81  }
82 
83  private:
84  void initialize(void);
85  // dynamic state
86  t_moa_v3 m_force;
87  t_moa_v3 m_moment;
88  t_moa_v3 m_velocity;
89  t_moa_v3 m_angular_velocity;
90  t_moa_real m_contact_radius;
91  t_moa_real m_inclination;
92 
93  // geometry
94  t_moa_real m_radius;
95  t_moa_real m_width;
96 
97  //
98  sp<TireI> m_spTireIupper;
99  sp<TireI> m_spTireIlower;
100  t_moa_v4 m_slow_blend;
101 };
102 
103 } /* namespace ext */
104 } /* namespace fe */
105 
106 #endif /* __tire_BlendTire_h__ */
107 
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
Simple Blend Tire Model.
Definition: BlendTire.h:16
Accessor< t_moa_v4 > slow_blend
slow_blend parameters: 0: surface vel crossover (m/s) 1: surface vel crossover smoothness 2: slip vel...
Definition: BlendTire.h:36
Reference to an instance of a Layout.
Definition: RecordSB.h:35
Blend Tire Model.
Definition: BlendTire.h:43
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192