chrono::vehicle::ChWheeledVehicleAssembly Class Reference

Description

Wrapper class for a Chrono::Vehicle vehicle and powertrain assembly.

A ChWheeledVehicleAssembly always uses rigid tires (attached through a user-provided callback object of type ChTireContactCallback) and optionally a contact model associated with the chassis body (specified through a user-provided callback of type ChChassisContactCallback). Driver inputs are provided through a user-provided callback object of type ChDriverInputsCallabck.

#include <ChWheeledVehicleAssembly.h>

Public Member Functions

 ChWheeledVehicleAssembly (ChSystem *system, const std::string &vehicle_def_filename, const std::string &powertrain_def_filename)
 Constructor from given JSON specification files. More...
 
void SetDriverInputsCallback (ChDriverInputsCallback *cb)
 Set the callback object for specifying driver inputs. More...
 
void SetTireContactCallback (ChTireContactCallback *cb)
 Set the callback object for specifying tire contact geometry. More...
 
void SetChassisContactCallback (ChChassisContactCallback *cb)
 Set the callback object for specifying chassis contact geometry. More...
 
void Initialize (const ChVector<> &init_loc, const ChQuaternion<> &init_rot)
 Initialize the vehicle model at the specified location and orientation. More...
 
void Synchronize (double time)
 Update the vehicle model at the specified time.
 
std::shared_ptr< WheeledVehicleGetVehicle () const
 Get handle to the underlying vehicle subsystem.
 
std::shared_ptr< SimplePowertrain > GetPowertrain () const
 Get handle to the underlying powertrain subsystem.
 

Constructor & Destructor Documentation

chrono::vehicle::ChWheeledVehicleAssembly::ChWheeledVehicleAssembly ( ChSystem system,
const std::string &  vehicle_def_filename,
const std::string &  powertrain_def_filename 
)

Constructor from given JSON specification files.

The vehicle system is constructed within the specified system, using the given JSON specification files for the vehicle and powertrain subsystems. These files are assumed to be given relative to the Chrono::Vehicle data directory.

Parameters
systempointer to containing system
vehicle_def_filenameJSON file with vehicle specification
powertrain_def_filenameJSON file with powertrain specification

Member Function Documentation

void chrono::vehicle::ChWheeledVehicleAssembly::Initialize ( const ChVector<> &  init_loc,
const ChQuaternion<> &  init_rot 
)

Initialize the vehicle model at the specified location and orientation.

Parameters
init_locinitial location of the chassis reference frame
init_rotinitial orientation of the chassis reference frame
void chrono::vehicle::ChWheeledVehicleAssembly::SetChassisContactCallback ( ChChassisContactCallback cb)

Set the callback object for specifying chassis contact geometry.

Note that this function must be called before Initialize(). If not set, no contact geometry is attached to the vehicle chassis.

void chrono::vehicle::ChWheeledVehicleAssembly::SetDriverInputsCallback ( ChDriverInputsCallback cb)

Set the callback object for specifying driver inputs.

If not set, all driver inputs default to 0.

void chrono::vehicle::ChWheeledVehicleAssembly::SetTireContactCallback ( ChTireContactCallback cb)

Set the callback object for specifying tire contact geometry.

Note that this function must be called before Initialize(). If not set, no contact geometry is attached to the vehicle wheels.