text: // =============================================================================
  // PROJECT CHRONO - http://projectchrono.org
  //
  // Copyright (c) 2014 projectchrono.org
  // All rights reserved.
  //
  // Use of this source code is governed by a BSD-style license that can be found
  // in the LICENSE file at the top level of the distribution and at
  // http://projectchrono.org/license-chrono.txt.
  //
  // =============================================================================
  // Authors: Radu Serban, Justin Madsen, Daniel Melanz
  // =============================================================================
  //
  // Generic 2-axle vehicle model.
  // Can be constructed either with solid-axle or with multi-link suspensions.
  // Always uses a generic rack-pinion steering and a 2WD driveline model.
  //
  // =============================================================================
  
  #ifndef GENERIC_VEHICLE_H
  #define GENERIC_VEHICLE_H
  
  #include "chrono/core/ChCoordsys.h"
  #include "chrono/physics/ChSystem.h"
  #include "chrono/physics/ChMaterialSurface.h"
  
  #include "chrono_vehicle/wheeled_vehicle/ChWheeledVehicle.h"
  
  #include "chrono_models/ChApiModels.h"
  
  namespace chrono {
  namespace vehicle {
  namespace generic {
  
  /// @addtogroup vehicle_models_generic
  /// @{
  
  /// Definition of a Generic wheeled vehicle.
  /// This 2-axle vehicle is used as a sandbox for testing the various templates for wheeled vehicle
  /// subsystems (suspensions, steering, tires, etc.)
  class CH_MODELS_API Generic_Vehicle : public ChWheeledVehicle {
    public:
      Generic_Vehicle(const bool fixed,
                      SuspensionType suspType,
                      ChMaterialSurface::ContactMethod contactMethod = ChMaterialSurface::NSC);
  
      ~Generic_Vehicle() {}
  
      virtual int GetNumberAxles() const override { return 2; }
  
      virtual double GetWheelbase() const override { return 3.378; }
      virtual double GetMinTurningRadius() const override { return 8.0; }
      virtual double GetMaxSteeringAngle() const override { return 25 * CH_C_DEG_TO_RAD; }
  
      double GetSpringForce(int axle, VehicleSide side) const;
      double GetSpringLength(int axle, VehicleSide side) const;
      double GetSpringDeformation(int axle, VehicleSide side) const;
  
      double GetShockForce(int axle, VehicleSide side) const;
      double GetShockLength(int axle, VehicleSide side) const;
      double GetShockVelocity(int axle, VehicleSide side) const;
  
      virtual void Initialize(const ChCoordsys<>& chassisPos, double chassisFwdVel = 0) override;
  
      // Log debugging information
      void LogHardpointLocations();  /// suspension hardpoints at design
      void DebugLog(int what);       /// shock forces and lengths, constraints, etc.
  
    private:
      SuspensionType m_suspType;
  };
  
  /// @} vehicle_models_generic
  
  }  // end namespace generic
  }  // end namespace vehicle
  }  // end namespace chrono
  
  #endif
  