Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
Wheelset.h
1// trax track library
2// AD 2014
3//
4// "the resolution of all the fruitless searches"
5//
6// Peter Gabriel
7//
8// Copyright (c) 2025 Trend Redaktions- und Verlagsgesellschaft mbH
9// Copyright (c) 2019 Marc-Michael Horstmann
10//
11// Permission is hereby granted to any person obtaining a copy of this software
12// and associated source code (the "Software"), to use, view, and study the
13// Software for personal or internal business purposes, subject to the following
14// conditions:
15//
16// 1. Redistribution, modification, sublicensing, or commercial use of the
17// Software is NOT permitted without prior written consent from the copyright
18// holder.
19//
20// 2. The Software is provided "AS IS", without warranty of any kind, express
21// or implied.
22//
23// 3. All copies of the Software must retain this license notice.
24//
25// For further information, please contact: horstmann.marc@trendverlag.de
26
27#pragma once
28
29#include "trax/Units.h"
30
31#include "spat/Position2D.h"
32
33namespace trax{
34
40 struct Wheelset{
50
54
55 Wheelset() noexcept
56 : Radius {0.5_m},
57 Gauge {1.435_m},
58 Flange {3_cm},
59 WheelWidth {0.2_m},
60 AxleRadius {0.1_m},
61 TotalMass {1500_kg},
62 AxlePosition {0_m,0.5_m},
63 Rotation {0},
64 Shift {0_m},
65 MaxMotorTorque {0}, //(30000.0f * units_per_kilogram * Square(units_per_meter)), //N*m
66 MaxBrakingTorque {0}, //(30000.0f * units_per_kilogram * Square(units_per_meter)), //N*m
68 {}
69
70 Wheelset(
77 spat::Position2D<Length> AxlePosition,
80
83 Torque FrictionTorque ) noexcept
84 : Radius {Radius},
85 Gauge {Gauge},
86 Flange {Flange},
92 Shift {Shift},
96 {}
97
98 inline bool IsValid() const{
99 return Radius > 0_m &&
100 Gauge > 0_m &&
101 TotalMass > 0_kg;
102 }
103 };
104}
Value< Dimension< 1, 0, 0 > > Length
Length.
Definition DimensionedValues.h:324
Value< Dimension< 0, 1, 0 > > Mass
Mass.
Definition DimensionedValues.h:327
constexpr Real _m(Length l) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1210
constexpr Real _kg(Mass m) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1443
Value< Dimension< 2, 1, -2 > > Torque
Torque.
Definition DimensionedValues.h:337
Value< Dimension< 0, 0, 0 > > Angle
Angle in radians.
Definition DimensionedValues.h:320
constexpr Real _cm(Length l) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1226
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
Implements a 2D - position in cartesian coordinates.
Definition Position2D.h:45
Length Gauge
Track gauge.
Definition Wheelset.h:42
Torque MaxBrakingTorque
Maximum braking torque that this wheelset can apply.
Definition Wheelset.h:52
Torque MaxMotorTorque
Maximum torque that this wheelset can apply for acceleration.
Definition Wheelset.h:51
Length Flange
Height of flange around the radius.
Definition Wheelset.h:43
Torque FrictionTorque
Friction that is introduced by this wheel.
Definition Wheelset.h:53
Length AxleRadius
Radius of the axle that holds the two wheels.
Definition Wheelset.h:45
Length WheelWidth
Width of the wheel.
Definition Wheelset.h:44
Mass TotalMass
Total mass of this wheelset.
Definition Wheelset.h:46
Angle Rotation
Rotation angle around axle (A.N).
Definition Wheelset.h:48
Length Shift
Shifting state along axle (A.N).
Definition Wheelset.h:49
Length Radius
Radius of the wheelpart it is rolling on the track with.
Definition Wheelset.h:41
spat::Position2D< Length > AxlePosition
Position of wheel axis relative to the WheelFrame's anchor A on the track (in A.T x A....
Definition Wheelset.h:47