chrono::vehicle::ChVehicle Class Referenceabstract

## Description

Base class for chrono vehicle systems.

The reference frame for a vehicle follows the ISO standard: Z-axis up, X-axis pointing forward, and Y-axis towards the left of the vehicle.

#include <ChVehicle.h>

Inheritance diagram for chrono::vehicle::ChVehicle:
Collaboration diagram for chrono::vehicle::ChVehicle:

## Public Member Functions

virtual ~ChVehicle ()
Destructor.

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 double GetVehicleMass () const =0
Get the vehicle total mass. More...

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 GetVehicleAcceleration (const ChVector<> &locpos) const
Get the acceleration at the specified point. More...

virtual std::shared_ptr< ChShaftGetDriveshaft () const =0
Get a handle to the vehicle's driveshaft body.

virtual double GetDriveshaftSpeed () const =0
Get the angular speed of the driveshaft. More...

ChVector GetDriverPos () const
Get the global location of the driver.

virtual void Initialize (const ChCoordsys<> &chassisPos, double chassisFwdVel=0)=0
Initialize this vehicle at the specified global location and orientation. More...

void SetChassisVisualizationType (VisualizationType vis)
Set visualization mode for the chassis subsystem.

Advance the state of this vehicle by the specified time step.

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.

virtual void LogConstraintViolations ()=0
Log current constraint violations.

## Protected Member Functions

ChVehicle (ChMaterialSurfaceBase::ContactMethod contact_method=ChMaterialSurfaceBase::DVI)
Construct a vehicle system with a default ChSystem.

ChVehicle (ChSystem *system)
Construct a vehicle system using the specified ChSystem.

## Protected Attributes

ChSystemm_system
pointer to the Chrono system

bool m_ownsSystem
true if system created at construction

std::shared_ptr< ChChassism_chassis
handle to the chassis subsystem

double m_stepsize
integration step-size for the vehicle system

## Member Function Documentation

 virtual double chrono::vehicle::ChVehicle::GetDriveshaftSpeed ( ) const
pure virtual

Get the angular speed of the driveshaft.

This function provides the interface between a vehicle system and a powertrain system.

 ChVector chrono::vehicle::ChVehicle::GetVehicleAcceleration ( const ChVector<> & locpos ) const

Get the acceleration at the specified point.

The point is assumed to be given relative to the chassis reference frame. The returned acceleration is expressed in the chassis reference frame.

 virtual double chrono::vehicle::ChVehicle::GetVehicleMass ( ) const
pure virtual

Get the vehicle total mass.

This includes the mass of the chassis and all vehicle subsystems.

 const ChVector& chrono::vehicle::ChVehicle::GetVehiclePos ( ) const

Get the vehicle location.

This is the global location of the chassis reference frame origin.

 const ChQuaternion& chrono::vehicle::ChVehicle::GetVehicleRot ( ) const

Get the vehicle orientation.

This is the chassis orientation, returned as a quaternion representing a rotation with respect to the global reference frame.

 double chrono::vehicle::ChVehicle::GetVehicleSpeed ( ) const

Get the vehicle speed.

Return the speed measured at the origin of the chassis reference frame.

 double chrono::vehicle::ChVehicle::GetVehicleSpeedCOM ( ) const

Get the speed of the chassis COM.

Return the speed measured at the chassis center of mass.

 virtual void chrono::vehicle::ChVehicle::Initialize ( const ChCoordsys<> & chassisPos, double chassisFwdVel = 0 )
pure virtual

Initialize this vehicle at the specified global location and orientation.

Parameters
 [in] chassisPos initial global position and orientation [in] chassisFwdVel initial chassis forward velocity