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 // Tracked vehicle shafts-based brake model constructed with data from file 16 // (JSON format). 17 // 18 // ============================================================================= 19 20 #ifndef TRACK_BRAKE_SHAFTS_H 21 #define TRACK_BRAKE_SHAFTS_H 22 23 #include "chrono_vehicle/ChApiVehicle.h" 24 #include "chrono_vehicle/tracked_vehicle/brake/ChTrackBrakeShafts.h" 25 26 #include "chrono_thirdparty/rapidjson/document.h" 27 28 namespace chrono { 29 namespace vehicle { 30 31 /// @addtogroup vehicle_tracked_brake 32 /// @{ 33 34 /// Tracked vehicle shafts-based brake model constructed with data from file (JSON format). 35 class CH_VEHICLE_API TrackBrakeShafts : public ChTrackBrakeShafts { 36 public: 37 TrackBrakeShafts(const std::string& filename); 38 TrackBrakeShafts(const rapidjson::Document& d); ~TrackBrakeShafts()39 ~TrackBrakeShafts() {} 40 GetShaftInertia()41 virtual double GetShaftInertia() override { return m_shaft_inertia; } GetMaxBrakingTorque()42 virtual double GetMaxBrakingTorque() override { return m_maxtorque; } 43 44 private: 45 virtual void Create(const rapidjson::Document& d) override; 46 47 double m_shaft_inertia; 48 double m_maxtorque; 49 }; 50 51 /// @} vehicle_tracked_brake 52 53 } // end namespace vehicle 54 } // end namespace chrono 55 56 #endif 57