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
13 // =============================================================================
14 //
15 // Pacejka tire constructed with data from file (JSON format).
16 //
17 // =============================================================================
18 
19 #ifndef PACEJKA_TIRE_H
20 #define PACEJKA_TIRE_H
21 
22 #include "chrono_vehicle/ChApiVehicle.h"
23 #include "chrono_vehicle/wheeled_vehicle/tire/ChPacejkaTire.h"
24 
25 #include "chrono_thirdparty/rapidjson/document.h"
26 
27 namespace chrono {
28 namespace vehicle {
29 
30 /// @addtogroup vehicle_wheeled_tire
31 /// @{
32 
33 /// Pacejka tire constructed with data from file (JSON format).
34 class CH_VEHICLE_API PacejkaTire : public ChPacejkaTire {
35   public:
36     PacejkaTire(const std::string& filename);
37     PacejkaTire(const rapidjson::Document& d);
~PacejkaTire()38     ~PacejkaTire() {}
39 
GetMass()40     virtual double GetMass() const override { return m_mass; }
GetInertia()41     virtual ChVector<> GetInertia() const override { return m_inertia; }
42 
43     virtual void AddVisualizationAssets(VisualizationType vis) override;
44     virtual void RemoveVisualizationAssets() override final;
45 
46   private:
47     virtual void Create(const rapidjson::Document& d) override;
48 
49     double m_mass;
50     ChVector<> m_inertia;
51 
52     bool m_has_mesh;
53     std::string m_meshFile_left;
54     std::string m_meshFile_right;
55     std::shared_ptr<ChTriangleMeshShape> m_trimesh_shape;
56 };
57 
58 /// @} vehicle_wheeled_tire
59 
60 }  // end namespace vehicle
61 }  // end namespace chrono
62 
63 #endif
64