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 // Double road-wheel model constructed with data from file (JSON format). 16 // 17 // ============================================================================= 18 19 #ifndef DOUBLE_ROAD_WHEEL_H 20 #define DOUBLE_ROAD_WHEEL_H 21 22 #include "chrono_vehicle/ChApiVehicle.h" 23 #include "chrono_vehicle/tracked_vehicle/road_wheel/ChDoubleRoadWheel.h" 24 25 #include "chrono_thirdparty/rapidjson/document.h" 26 27 namespace chrono { 28 namespace vehicle { 29 30 /// @addtogroup vehicle_tracked_suspension 31 /// @{ 32 33 /// Double road-wheel model constructed with data from file (JSON format). 34 class CH_VEHICLE_API DoubleRoadWheel : public ChDoubleRoadWheel { 35 public: 36 DoubleRoadWheel(const std::string& filename); 37 DoubleRoadWheel(const rapidjson::Document& d); ~DoubleRoadWheel()38 ~DoubleRoadWheel() {} 39 GetWheelRadius()40 virtual double GetWheelRadius() const override { return m_wheel_radius; } GetWheelWidth()41 virtual double GetWheelWidth() const override { return m_wheel_width; } GetWheelGap()42 virtual double GetWheelGap() const override { return m_wheel_gap; } 43 GetWheelMass()44 virtual double GetWheelMass() const override { return m_wheel_mass; } GetWheelInertia()45 virtual const ChVector<>& GetWheelInertia() override { return m_wheel_inertia; } 46 47 private: 48 virtual void Create(const rapidjson::Document& d) override; 49 virtual void CreateContactMaterial(ChContactMethod contact_method) override; 50 virtual void AddVisualizationAssets(VisualizationType vis) override; 51 52 double m_wheel_radius; 53 double m_wheel_width; 54 double m_wheel_gap; 55 56 double m_wheel_mass; 57 ChVector<> m_wheel_inertia; 58 59 bool m_has_mesh; 60 std::string m_meshFile; 61 62 MaterialInfo m_mat_info; 63 }; 64 65 /// @} vehicle_tracked_suspension 66 67 } // end namespace vehicle 68 } // end namespace chrono 69 70 #endif 71