<commit_before>// =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All right 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: <NAME>
// =============================================================================
//
// Tracked vehicle model built from subsystems specified w/ JSON input data file
//
// =============================================================================

#ifndef TRACKVEHICLE_H
#define TRACKVEHICLE_H

#include "core/ChCoordsys.h"
#include "physics/ChSystem.h"
#include "subsys/trackSystem/TrackSystem.h"
#include "subsys/powertrain/TrackPowertrain.h"
#include "subsys/driveline/TrackDriveline.h"

namespace chrono {

class CH_SUBSYS_API TrackVehicle : public ChSystem
{
public:

  TrackVehicle(bool fixed = false, bool chassisVis = false);

  ~TrackVehicle() {}

  int GetNum_TrackSystems() const { return m_num_tracks; }

  virtual ChCoordsys<> GetLocalDriverCoordsys() const { return m_driverCsys; }

  void Initialize(const ChCoordsys<>& chassisPos);
  
  void Update(double	time,
              double	left_drive_input,
			        double	right_drive_input);

  /// Set the integration step size for the vehicle system.
  void SetStepsize(double val) { m_stepsize = val; }

  /// Get the current value of the integration step size for the vehicle system.
  double GetStepsize() const { return m_stepsize; }

private:

  void Load_TrackSystem(const std::string& filename, int track);


  ChSharedPtr<ChBodyAuxRef> m_chassis;  ///< hull body
  int m_num_tracks;       // number of tracks for this vehicle

  std::vector<ChVector<> > m_TrackSystem_locs;   // locations of the track system c-sys relative to chassis
  std::vector<ChSharedPtr<TrackSystem> > m_TrackSystems;	// list of track systems

  ChSharedPtr<TrackDriveline>   m_driveline;    ///< handle to the driveline subsystem
  ChSharedPtr<TrackPowertrain> m_ptrain;  ///< powertrain system

  static const double     m_Mass;                   // chassis mass
  static const ChVector<> m_COM;                    // location of the chassis COM in the local ref frame
  static const ChVector<> m_Inertia;                // symmetric moments of inertia of the chassis

  static const ChCoordsys<> m_driverCsys;  // driver position and orientation relative to chassis
  static const std::string m_MeshFile;

  double m_stepsize;          ///< integration time step for tracked vehicle system

  // friend class irrDriver
};


} // end namespace chrono


#endif
<commit_msg>add function to return the chassis ChBody<commit_after>// =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All right 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: <NAME>
// =============================================================================
//
// Tracked vehicle model built from subsystems specified w/ JSON input data file
//
// =============================================================================

#ifndef TRACKVEHICLE_H
#define TRACKVEHICLE_H

#include "core/ChCoordsys.h"
#include "physics/ChSystem.h"
#include "subsys/trackSystem/TrackSystem.h"
#include "subsys/powertrain/TrackPowertrain.h"
#include "subsys/driveline/TrackDriveline.h"

namespace chrono {

class CH_SUBSYS_API TrackVehicle : public ChSystem
{
public:

  TrackVehicle(bool fixed = false, bool chassisVis = false);

  ~TrackVehicle() {}

  int GetNum_TrackSystems() const { return m_num_tracks; }

  virtual ChCoordsys<> GetLocalDriverCoordsys() const { return m_driverCsys; }

  void Initialize(const ChCoordsys<>& chassisPos);
  
  void Update(double	time,
              double	left_drive_input,
			        double	right_drive_input);

  /// Set the integration step size for the vehicle system.
  void SetStepsize(double val) { m_stepsize = val; }

  /// Get the current value of the integration step size for the vehicle system.
  double GetStepsize() const { return m_stepsize; }

  ChSharedPtr<ChBody> GetChassis() { return m_chassis; }

private:

  void Load_TrackSystem(const std::string& filename, int track);


  ChSharedPtr<ChBodyAuxRef> m_chassis;  ///< hull body
  int m_num_tracks;       // number of tracks for this vehicle

  std::vector<ChVector<> > m_TrackSystem_locs;   // locations of the track system c-sys relative to chassis
  std::vector<ChSharedPtr<TrackSystem> > m_TrackSystems;	// list of track systems

  ChSharedPtr<TrackDriveline>   m_driveline;    ///< handle to the driveline subsystem
  ChSharedPtr<TrackPowertrain> m_ptrain;  ///< powertrain system

  static const double     m_Mass;                   // chassis mass
  static const ChVector<> m_COM;                    // location of the chassis COM in the local ref frame
  static const ChVector<> m_Inertia;                // symmetric moments of inertia of the chassis

  static const ChCoordsys<> m_driverCsys;  // driver position and orientation relative to chassis
  static const std::string m_MeshFile;

  double m_stepsize;          ///< integration time step for tracked vehicle system

  // friend class irrDriver
};


} // end namespace chrono


#endif

{'fraction_non_alphanumeric': 0.18876130828114127, 'fraction_numerical': 0.0013917884481558804, 'mean_word_length': 3.855574324324324, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3869926', 'n_tokens_mistral': 1670, 'n_tokens_neox': 1554, 'n_words': 502}