chrono::vehicle::ChWheeledVehicle Class Referenceabstract

Description

Base class for chrono wheeled vehicle systems.

This class provides the interface between the vehicle system and other systems (tires, driver, etc.). 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 <ChWheeledVehicle.h>

Inheritance diagram for chrono::vehicle::ChWheeledVehicle:
Collaboration diagram for chrono::vehicle::ChWheeledVehicle:

Public Member Functions

 ChWheeledVehicle (ChMaterialSurfaceBase::ContactMethod contact_method=ChMaterialSurfaceBase::DVI)
 Construct a vehicle system with a default ChSystem.
 
 ChWheeledVehicle (ChSystem *system)
 Construct a vehicle system using the specified ChSystem.
 
virtual ~ChWheeledVehicle ()
 Destructor.
 
std::shared_ptr< ChSuspensionGetSuspension (int id) const
 Get the specified suspension subsystem.
 
std::shared_ptr< ChSteeringGetSteering (int id)
 Get the specified steering subsystem.
 
std::shared_ptr< ChWheelGetWheel (const WheelID &wheel_id) const
 Get a handle to the specified vehicle wheel subsystem.
 
std::shared_ptr< ChBrakeGetBrake (const WheelID &wheel_id) const
 Get a handle to the specified vehicle brake subsystem.
 
std::shared_ptr< ChDrivelineGetDriveline () const
 Get a handle to the vehicle's driveline subsystem.
 
virtual double GetVehicleMass () const override
 Get the vehicle total mass. More...
 
virtual std::shared_ptr< ChShaftGetDriveshaft () const override
 Get a handle to the vehicle's driveshaft body.
 
virtual double GetDriveshaftSpeed () const override
 Get the angular speed of the driveshaft. More...
 
virtual int GetNumberAxles () const =0
 Return the number of axles for this vehicle.
 
std::shared_ptr< ChBodyGetWheelBody (const WheelID &wheelID) const
 Get a handle to the specified wheel body.
 
const ChVectorGetWheelPos (const WheelID &wheel_id) const
 Get the global location of the specified wheel.
 
const ChQuaternionGetWheelRot (const WheelID &wheel_id) const
 Get the orientation of the specified wheel. More...
 
const ChVectorGetWheelLinVel (const WheelID &wheel_id) const
 Get the linear velocity of the specified wheel. More...
 
ChVector GetWheelAngVel (const WheelID &wheel_id) const
 Get the angular velocity of the specified wheel. More...
 
double GetWheelOmega (const WheelID &wheel_id) const
 Get the angular speed of the specified wheel. More...
 
WheelState GetWheelState (const WheelID &wheel_id) const
 Get the complete state for the specified wheel. More...
 
void SetSuspensionVisualizationType (VisualizationType vis)
 Set visualization type for the suspension subsystems. More...
 
void SetSteeringVisualizationType (VisualizationType vis)
 Set visualization type for the steering subsystems. More...
 
void SetWheelVisualizationType (VisualizationType vis)
 Set visualization type for the wheel subsystems. More...
 
virtual void Synchronize (double time, double steering, double braking, double powertrain_torque, const TireForces &tire_forces)
 Update the state of this vehicle at the current time. More...
 
virtual void LogConstraintViolations () override
 Log current constraint violations.
 
- Public Member Functions inherited from chrono::vehicle::ChVehicle
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.
 
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...
 
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.
 
virtual void Advance (double step)
 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.
 

Protected Attributes

ChSuspensionList m_suspensions
 list of handles to suspension subsystems
 
ChAntirollbarList m_antirollbars
 list of handles to antirollbar subsystems (optional)
 
std::shared_ptr< ChDrivelinem_driveline
 handle to the driveline subsystem
 
ChSteeringList m_steerings
 list of handles to steering subsystems
 
ChWheelList m_wheels
 list of handles to wheel subsystems
 
ChBrakeList m_brakes
 list of handles to brake subsystems
 
- Protected Attributes inherited from chrono::vehicle::ChVehicle
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
 

Additional Inherited Members

- Protected Member Functions inherited from chrono::vehicle::ChVehicle
 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.
 

Member Function Documentation

double chrono::vehicle::ChWheeledVehicle::GetDriveshaftSpeed ( ) const
overridevirtual

Get the angular speed of the driveshaft.

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

Implements chrono::vehicle::ChVehicle.

double chrono::vehicle::ChWheeledVehicle::GetVehicleMass ( ) const
overridevirtual

Get the vehicle total mass.

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

Implements chrono::vehicle::ChVehicle.

ChVector chrono::vehicle::ChWheeledVehicle::GetWheelAngVel ( const WheelID wheel_id) const

Get the angular velocity of the specified wheel.

Return the angular velocity of the wheel frame, expressed in the global reference frame.

const ChVector & chrono::vehicle::ChWheeledVehicle::GetWheelLinVel ( const WheelID wheel_id) const

Get the linear velocity of the specified wheel.

Return the linear velocity of the wheel center, expressed in the global reference frame.

double chrono::vehicle::ChWheeledVehicle::GetWheelOmega ( const WheelID wheel_id) const

Get the angular speed of the specified wheel.

This is the angular speed of the wheel axle.

const ChQuaternion & chrono::vehicle::ChWheeledVehicle::GetWheelRot ( const WheelID wheel_id) const

Get the orientation of the specified wheel.

The wheel orientation is returned as a quaternion representing a rotation with respect to the global reference frame.

WheelState chrono::vehicle::ChWheeledVehicle::GetWheelState ( const WheelID wheel_id) const

Get the complete state for the specified wheel.

This includes the location, orientation, linear and angular velocities, all expressed in the global reference frame, as well as the wheel angular speed about its rotation axis.

void chrono::vehicle::ChWheeledVehicle::SetSteeringVisualizationType ( VisualizationType  vis)

Set visualization type for the steering subsystems.

This function should be called only after vehicle initialization.

void chrono::vehicle::ChWheeledVehicle::SetSuspensionVisualizationType ( VisualizationType  vis)

Set visualization type for the suspension subsystems.

This function should be called only after vehicle initialization.

void chrono::vehicle::ChWheeledVehicle::SetWheelVisualizationType ( VisualizationType  vis)

Set visualization type for the wheel subsystems.

This function should be called only after vehicle initialization.

void chrono::vehicle::ChWheeledVehicle::Synchronize ( double  time,
double  steering,
double  braking,
double  powertrain_torque,
const TireForces tire_forces 
)
virtual

Update the state of this vehicle at the current time.

The vehicle system is provided the current driver inputs (throttle between 0 and 1, steering between -1 and +1, braking between 0 and 1), the torque from the powertrain, and tire forces (expressed in the global reference frame).

Parameters
[in]timecurrent time
[in]steeringcurrent steering input [-1,+1]
[in]brakingcurrent braking input [0,1]
[in]powertrain_torqueinput torque from powertrain
[in]tire_forcesvector of tire force structures