1 // =============================================================================
2 // PROJECT CHRONO - http://projectchrono.org
3 //
4 // Copyright (c) 2014 projectchrono.org
5 // All rights reserved.
6 //
7 // Use of this source code is governed by a BSD-style license that can be found
8 // in the LICENSE file at the top level of the distribution and at
9 // http://projectchrono.org/license-chrono.txt.
10 //
11 // =============================================================================
12 // Authors: Radu Serban, Michael Taylor
13 // =============================================================================
14 //
15 // M113 continuous band track assembly subsystem using rigid-link track shoes.
16 //
17 // =============================================================================
18
19 #include "chrono_models/vehicle/m113/M113_TrackAssemblyBandBushing.h"
20 #include "chrono_models/vehicle/m113/M113_BrakeSimple.h"
21 #include "chrono_models/vehicle/m113/M113_BrakeShafts.h"
22 #include "chrono_models/vehicle/m113/M113_Idler.h"
23 #include "chrono_models/vehicle/m113/M113_RoadWheel.h"
24 #include "chrono_models/vehicle/m113/M113_SprocketBand.h"
25 #include "chrono_models/vehicle/m113/M113_Suspension.h"
26 #include "chrono_models/vehicle/m113/M113_TrackShoeBandBushing.h"
27
28 namespace chrono {
29 namespace vehicle {
30 namespace m113 {
31
32 // -----------------------------------------------------------------------------
33 // Static variables
34 // -----------------------------------------------------------------------------
35 const ChVector<> M113_TrackAssemblyBandBushing::m_sprocket_loc(0, 0, 0);
36 const ChVector<> M113_TrackAssemblyBandBushing::m_idler_loc(-3.83, 0, -0.12);
37 const ChVector<> M113_TrackAssemblyBandBushing::m_susp_locs_L[5] = { //
38 ChVector<>(-0.655, 0, -0.215), //
39 ChVector<>(-1.322, 0, -0.215), //
40 ChVector<>(-1.989, 0, -0.215), //
41 ChVector<>(-2.656, 0, -0.215), //
42 ChVector<>(-3.322, 0, -0.215)};
43 const ChVector<> M113_TrackAssemblyBandBushing::m_susp_locs_R[5] = { //
44 ChVector<>(-0.740, 0, -0.215), //
45 ChVector<>(-1.407, 0, -0.215), //
46 ChVector<>(-2.074, 0, -0.215), //
47 ChVector<>(-2.740, 0, -0.215), //
48 ChVector<>(-3.407, 0, -0.215)};
49
50 // -----------------------------------------------------------------------------
51 // Constructor for the M113 continuous band track assembly using rigid-link
52 // track shoes.
53 // Create the suspensions, idler, brake, sprocket, and track shoes.
54 // -----------------------------------------------------------------------------
M113_TrackAssemblyBandBushing(VehicleSide side,BrakeType brake_type)55 M113_TrackAssemblyBandBushing::M113_TrackAssemblyBandBushing(VehicleSide side, BrakeType brake_type)
56 : ChTrackAssemblyBandBushing("", side) {
57 size_t num_shoes = 0;
58 std::string suspName("M113_Suspension");
59 std::string shoeName("M113_TrackShoe");
60 switch (side) {
61 case LEFT:
62 SetName("M113_TrackAssemblyLeft");
63 m_idler = chrono_types::make_shared<M113_IdlerLeft>();
64 m_brake = chrono_types::make_shared<M113_BrakeSimple>("M113_BrakeLeft");
65 m_sprocket = chrono_types::make_shared<M113_SprocketBandLeft>();
66 num_shoes = 105;
67 suspName += "Left_";
68 shoeName += "Left_";
69 break;
70 case RIGHT:
71 SetName("M113_TrackAssemblyRight");
72 m_idler = chrono_types::make_shared<M113_IdlerRight>();
73 m_brake = chrono_types::make_shared<M113_BrakeSimple>("M113_BrakeRight");
74 m_sprocket = chrono_types::make_shared<M113_SprocketBandRight>();
75 num_shoes = 106;
76 suspName += "Right_";
77 shoeName += "Right_";
78 break;
79 }
80
81 m_suspensions.resize(5);
82 m_suspensions[0] = chrono_types::make_shared<M113_Suspension>(suspName + "0", side, 0, true);
83 m_suspensions[1] = chrono_types::make_shared<M113_Suspension>(suspName + "1", side, 0, true);
84 m_suspensions[2] = chrono_types::make_shared<M113_Suspension>(suspName + "2", side, 2, false);
85 m_suspensions[3] = chrono_types::make_shared<M113_Suspension>(suspName + "3", side, 2, false);
86 m_suspensions[4] = chrono_types::make_shared<M113_Suspension>(suspName + "4", side, 0, true);
87
88 for (size_t it = 0; it < num_shoes; it++) {
89 m_shoes.push_back(chrono_types::make_shared<M113_TrackShoeBandBushing>(shoeName + std::to_string(it)));
90 }
91 }
92
93 // -----------------------------------------------------------------------------
94 // -----------------------------------------------------------------------------
GetSprocketLocation() const95 const ChVector<> M113_TrackAssemblyBandBushing::GetSprocketLocation() const {
96 return m_sprocket_loc;
97 }
98
GetIdlerLocation() const99 const ChVector<> M113_TrackAssemblyBandBushing::GetIdlerLocation() const {
100 return m_idler_loc;
101 }
102
GetRoadWhelAssemblyLocation(int which) const103 const ChVector<> M113_TrackAssemblyBandBushing::GetRoadWhelAssemblyLocation(int which) const {
104 return (m_side == LEFT) ? m_susp_locs_L[which] : m_susp_locs_R[which];
105 }
106
107 } // end namespace m113
108 } // end namespace vehicle
109 } // end namespace chrono
110