Description

Definition of a suspension test rig.

#include <ChTrackTestRig.h>

Inheritance diagram for chrono::vehicle::ChTrackTestRig:
Collaboration diagram for chrono::vehicle::ChTrackTestRig:

Public Member Functions

 ChTrackTestRig ()
 Default constructor.
 
 ChTrackTestRig (const std::string &filename, bool create_track=true, ChMaterialSurface::ContactMethod contact_method=ChMaterialSurface::NSC)
 Construct a test rig from specified track assembly JSON file. More...
 
 ChTrackTestRig (std::shared_ptr< ChTrackAssembly > assembly, bool create_track=true, ChMaterialSurface::ContactMethod contact_method=ChMaterialSurface::NSC)
 Construct a test rig using the specified track assembly and subsystem locations. More...
 
 ~ChTrackTestRig ()
 Destructor.
 
void SetDriver (std::unique_ptr< ChDriverTTR > driver)
 Set driver system.
 
void SetInitialRideHeight (double height)
 Set the initial ride height (relative to the sprocket reference frame). More...
 
void SetDisplacementLimit (double limit)
 Set the limits for post displacement (same for jounce and rebound). More...
 
void SetDisplacementDelay (double delay)
 Set time delay before applying post displacement. More...
 
void SetMaxTorque (double val)
 Set maximum sprocket torque.
 
void SetSprocketVisualizationType (VisualizationType vis)
 Set visualization type for the sprocket subsystem (default: PRIMITIVES).
 
void SetIdlerVisualizationType (VisualizationType vis)
 Set visualization type for the idler subsystem (default: PRIMITIVES).
 
void SetRoadWheelAssemblyVisualizationType (VisualizationType vis)
 Set visualization type for the road-wheel assembly subsystem (default: PRIMITIVES).
 
void SetRoadWheelVisualizationType (VisualizationType vis)
 Set visualization type for the road-wheel subsystem (default: PRIMITIVES).
 
void SetTrackShoeVisualizationType (VisualizationType vis)
 Set visualization type for the track shoe subsystems (default: PRIMITIVES).
 
void SetDriverLogFilename (const std::string &filename)
 Set filename for optional driver log.
 
void Initialize ()
 Initialize this track test rig.
 
virtual void Advance (double step) override
 Advance the state of the track test rig by the specified time step.
 
void SetCollide (int flags)
 Set collision flags for the various subsystems. More...
 
double GetThrottleInput () const
 
double GetDisplacementInput (int index)
 
std::string GetDriverMessage () const
 
double GetActuatorDisp (int index)
 
double GetActuatorForce (int index)
 
double GetActuatorMarkerDist (int index)
 
double GetMass () const
 Get the rig total mass. More...
 
std::shared_ptr< ChTrackAssemblyGetTrackAssembly () const
 Get the track assembly subsystem.
 
double GetRideHeight () const
 Get current ride height (relative to the chassis reference frame). More...
 
void LogDriverInputs ()
 Log current driver inputs.
 
virtual void LogConstraintViolations () override
 Log current constraint violations.
 
- Public Member Functions inherited from chrono::vehicle::ChVehicle
virtual ~ChVehicle ()
 Destructor.
 
const std::string & GetName () const
 Get the name identifier for this vehicle.
 
void SetName (const std::string &name)
 Set the name identifier for this vehicle.
 
ChSystemGetSystem ()
 Get a pointer to the Chrono ChSystem.
 
double GetChTime () const
 Get the current simulation time of the underlying ChSystem.
 
std::shared_ptr< ChChassisGetChassis () const
 Get a handle to the vehicle's chassis subsystem.
 
std::shared_ptr< ChBodyAuxRefGetChassisBody () const
 Get a handle to the vehicle's chassis body.
 
virtual std::shared_ptr< ChPowertrainGetPowertrain () const
 Get the powertrain attached to this vehicle.
 
const ChVectorGetVehiclePos () const
 Get the vehicle location. More...
 
const ChQuaternionGetVehicleRot () const
 Get the vehicle orientation. More...
 
double GetVehicleSpeed () const
 Get the vehicle speed. More...
 
double GetVehicleSpeedCOM () const
 Get the speed of the chassis COM. More...
 
ChVector GetVehiclePointLocation (const ChVector<> &locpos) const
 Get the global position of the specified point. More...
 
ChVector GetVehiclePointVelocity (const ChVector<> &locpos) const
 Get the global velocity of the specified point. More...
 
ChVector GetVehicleAcceleration (const ChVector<> &locpos) const
 Get the acceleration at the specified point. More...
 
ChVector GetDriverPos () const
 Get the global location of the driver.
 
void SetOutput (ChVehicleOutput::Type type, const std::string &out_dir, const std::string &out_name, double output_step)
 Enable output for this vehicle system. More...
 
void SetChassisVisualizationType (VisualizationType vis)
 Set visualization mode for the chassis subsystem.
 
void SetChassisCollide (bool state)
 Enable/disable collision for the chassis subsystem. More...
 
virtual void SetChassisVehicleCollide (bool state)
 Enable/disable collision between the chassis and all other vehicle subsystems. More...
 
void SetChassisOutput (bool state)
 Enable/disable output from the chassis subsystem.
 
void SetStepsize (double val)
 Set the integration step size for the vehicle system.
 
double GetStepsize () const
 Get the current value of the integration step size for the vehicle system.
 

Additional Inherited Members

- Protected Member Functions inherited from chrono::vehicle::ChVehicle
 ChVehicle (const std::string &name, ChMaterialSurface::ContactMethod contact_method=ChMaterialSurface::NSC)
 Construct a vehicle system with an underlying ChSystem. More...
 
 ChVehicle (const std::string &name, ChSystem *system)
 Construct a vehicle system using the specified ChSystem. More...
 
- Static Protected Member Functions inherited from chrono::vehicle::ChVehicle
template<typename T >
static bool AnyOutput (const std::vector< std::shared_ptr< T >> &list)
 Utility function for testing if any subsystem in a list generates output.
 
- Protected Attributes inherited from chrono::vehicle::ChVehicle
std::string m_name
 vehicle name
 
ChSystemm_system
 pointer to the Chrono system
 
bool m_ownsSystem
 true if system created at construction
 
bool m_output
 generate ouput for this vehicle system
 
ChVehicleOutputm_output_db
 vehicle output database
 
double m_output_step
 output time step
 
double m_next_output_time
 time for next output
 
int m_output_frame
 current output frame
 
std::shared_ptr< ChChassism_chassis
 handle to the chassis subsystem
 
double m_stepsize
 integration step-size for the vehicle system
 

Constructor & Destructor Documentation

chrono::vehicle::ChTrackTestRig::ChTrackTestRig ( const std::string &  filename,
bool  create_track = true,
ChMaterialSurface::ContactMethod  contact_method = ChMaterialSurface::NSC 
)

Construct a test rig from specified track assembly JSON file.

Parameters
[in]filenameJSON file with test rig specification
[in]create_trackinclude track shoes?
[in]contact_methodcontact method
chrono::vehicle::ChTrackTestRig::ChTrackTestRig ( std::shared_ptr< ChTrackAssembly assembly,
bool  create_track = true,
ChMaterialSurface::ContactMethod  contact_method = ChMaterialSurface::NSC 
)

Construct a test rig using the specified track assembly and subsystem locations.

Parameters
[in]assemblyhandle to the track assembly
[in]create_trackinclude track shoes?
[in]contact_methodcontact method

Member Function Documentation

double chrono::vehicle::ChTrackTestRig::GetMass ( ) const

Get the rig total mass.

This is simply the mass of the track subsystem.

double chrono::vehicle::ChTrackTestRig::GetRideHeight ( ) const

Get current ride height (relative to the chassis reference frame).

This estimate uses the average of the left and right posts.

void chrono::vehicle::ChTrackTestRig::SetCollide ( int  flags)

Set collision flags for the various subsystems.

By default, collision is enabled for sprocket, idler, road wheels, and track shoes.

void chrono::vehicle::ChTrackTestRig::SetDisplacementDelay ( double  delay)

Set time delay before applying post displacement.

Default value: 0

void chrono::vehicle::ChTrackTestRig::SetDisplacementLimit ( double  limit)

Set the limits for post displacement (same for jounce and rebound).

Default value: 0

void chrono::vehicle::ChTrackTestRig::SetInitialRideHeight ( double  height)

Set the initial ride height (relative to the sprocket reference frame).

If not specified, the reference height is the track assembly design configuration.