7 #ifndef __tire_MountSystem_h__ 8 #define __tire_MountSystem_h__ 32 void initialize(
void) {}
33 virtual void compile(
const t_note_id &a_note_id)
35 sp<Scope> spScope = m_rg_dataset->scope();
37 if(!spScope.isValid()) {
return; }
39 enforce<AsTire,AsTireLive>(m_rg_dataset);
41 m_asRig.bind(spScope);
42 m_asTireLive.bind(spScope);
43 m_asMount.bind(spScope);
47 RecordDictionary<AsRig> rd_rigs(m_rg_dataset);
48 RecordDictionary<AsTire> rd_tires(m_rg_dataset);
50 std::vector<Record> mounts;
51 m_asMount.filter(mounts, m_rg_dataset);
53 for(
unsigned int i_mount = 0; i_mount < mounts.size(); i_mount++)
55 Record &r_mount = mounts[i_mount];
57 mount.m_r_mount = r_mount;
58 mount.m_r_rig = rd_rigs[m_asMount.rig(r_mount)];
59 mount.m_r_tire = rd_tires[m_asMount.tire(r_mount)];
60 if( mount.m_r_rig.isValid() &&
61 mount.m_r_tire.isValid() &&
62 m_asRig.check(mount.m_r_rig) &&
63 m_asTireLive.check(mount.m_r_tire))
65 m_mounts.push_back(mount);
72 for(
unsigned int i_mount = 0; i_mount < m_mounts.size(); i_mount++)
75 WeakRecord &r_tire = m_mounts[i_mount].m_r_tire;
76 WeakRecord &r_mount = m_mounts[i_mount].m_r_mount;
78 t_moa_real alpha = m_asRig.alpha(r_rig)*pi/180.0;
80 vel[0] = m_asRig.velocity(r_rig) * cos(alpha);
81 vel[1] = m_asRig.velocity(r_rig) * sin(alpha)
82 * cos(m_asRig.inclination(r_rig));
83 vel[2] = m_asRig.pnt_velocity(r_rig)[2];
85 setIdentity(m_asTireLive.transform(r_tire));
86 translate(m_asTireLive.transform(r_tire),
87 m_asRig.location(r_rig));
88 rotate(m_asTireLive.transform(r_tire),
89 m_asRig.inclination(r_rig), e_xAxis);
90 invert(m_asMount.transform_inv(r_mount),
91 m_asTireLive.transform(r_tire));
93 vel = rotateVector<3, t_moa_real>(
94 m_asMount.transform_inv(r_mount),vel);
95 m_asTireLive.velocity(r_tire) = vel;
97 if(m_asRig.free_wheel(r_rig)) { angular_velocity[1] += vel[0] /
98 m_asTireLive.radius(r_tire); }
99 m_asTireLive.angular_velocity(r_tire) = angular_velocity;
103 void accumulate(
void)
105 for(
unsigned int i_mount = 0; i_mount < m_mounts.size(); i_mount++)
107 WeakRecord &r_rig = m_mounts[i_mount].m_r_rig;
108 WeakRecord &r_tire = m_mounts[i_mount].m_r_tire;
109 WeakRecord &r_mount = m_mounts[i_mount].m_r_mount;
111 t_moa_v3 rig_space_F = rotateVector<3, t_moa_real>
112 (m_asTireLive.transform(r_tire),
113 m_asTireLive.force(r_tire));
114 t_moa_v3 rig_space_M = rotateVector<3, t_moa_real>
115 (m_asTireLive.transform(r_tire),
116 m_asTireLive.moment(r_tire));
118 m_asRig.force_accum(r_rig).add(rig_space_F);
119 m_asRig.moment_accum(r_rig).add(rig_space_M);
123 std::vector<Mount> m_mounts;
Tire Test Rig Live.
Definition: tireAS.h:206
Tire.
Definition: tireAS.h:36
kernel
Definition: namespace.dox:3
Matrix< 4, 4, T > & invert(Matrix< 4, 4, T > &a_inverted, const Matrix< 4, 4, T > &a_matrix)
4x4 full matrix inversion
Definition: Matrix.h:1033
Time Stepping System.
Definition: Stepper.h:15
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
virtual void compile(const t_note_id &a_note_id)
Compile internal structure for dataset.
Definition: MountSystem.h:33
void step(t_moa_real a_dt)
Move system forward in time by a timestep.
Definition: MountSystem.h:70
Run Time Single Contact Tire Model.
Definition: tireAS.h:49
Tire to Rig Connection.
Definition: MountSystem.h:18
Reference to an instance of a Layout.
Definition: RecordSB.h:35
Non-persistent reference to an instance of a Layout.
Definition: WeakRecordSB.h:17
Rig to Tire mount.
Definition: tireAS.h:89