Project Chrono: chrono::vehicle::ChRigidChassis Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
chrono::vehicle::ChRigidChassis Class Reference
VEHICLE module

## Description

Template for a rigid-body main chassis vehicle subsystem.

`#include <ChRigidChassis.h>`

Inheritance diagram for chrono::vehicle::ChRigidChassis:
[legend]
Collaboration diagram for chrono::vehicle::ChRigidChassis:
[legend]

## Public Member Functions
| ChRigidChassis (const std::string &name, bool fixed=false)
| Construct a vehicle subsystem with the specified name.
virtual std::string | GetTemplateName () const override
| Get the name of the vehicle subsystem template.
bool | HasCollision () const
| Specifies whether or not collision shapes were defined.
bool | HasPrimitives () const
| Specifies whether or not visualization primitives were defined.
bool | HasMesh () const
| Specifies whether or not a visualization mesh was defined.
const std::string & | GetMeshFilename () const
| Get the name of the Wavefront file with chassis visualization mesh.
virtual void | Initialize (ChSystem *system, const ChCoordsys<> &chassisPos, double chassisFwdVel, int collision_family=0) override
| Initialize the chassis at the specified global position and orientation.
virtual void | EnableCollision (bool state) override
| Enable/disable contact for the chassis.
virtual void | AddVisualizationAssets (VisualizationType vis) override
| Add visualization assets to this subsystem, for the specified visualization mode.
virtual void | RemoveVisualizationAssets () override final
| Remove all visualization assets from this subsystem.
Public Member Functions inherited from chrono::vehicle::ChChassis
| ChChassis (const std::string &name, bool fixed=false)
| Construct a chassis subsystem with the specified name.
virtual ChCoordsys | GetLocalDriverCoordsys () const =0
| Get the local driver position and orientation.
virtual const ChVector3d | GetLocalPosRearConnector () const
| Get the location (in the local frame of this chassis) of the connection to a rear chassis.
std::shared_ptr< ChBodyAuxRef > | GetBody () const
| Get a handle to the vehicle's chassis body.
ChSystem * | GetSystem () const
| Get a pointer to the containing system.
const ChVector3d & | GetPos () const
| Get the global location of the chassis reference frame origin.
ChQuaternion | GetRot () const
| Get the orientation of the chassis reference frame.
ChVector3d | GetDriverPos () const
| Get the global location of the driver.
double | GetSpeed () const
| Get the vehicle speed.
double | GetCOMSpeed () const
| Get the speed of the chassis COM.
double | GetRollRate () const
| Get the roll rate of the chassis.
double | GetPitchRate () const
| Get the pitch rate of the chassis.
double | GetYawRate () const
| Get the yaw rate of the chassis.
double | GetTurnRate () const
| Get the turn rate of the chassis.
ChVector3d | GetPointLocation (const ChVector3d &locpos) const
| Get the global position of the specified point.
ChVector3d | GetPointVelocity (const ChVector3d &locpos) const
| Get the global velocity of the specified point.
ChVector3d | GetPointAcceleration (const ChVector3d &locpos) const
| Get the acceleration at the specified point.
void | SetFixed (bool val)
| Set the "fixed to ground" status of the chassis body.
bool | IsFixed () const
| Return true if the chassis body is fixed to ground.
bool | HasBushings () const
| Return true if the vehicle model contains bushings.
void | AddMarker (const std::string &name, const ChFrame<> &frame)
| Add a marker on the chassis body at the specified position (relative to the chassis reference frame).
const std::vector< std::shared_ptr< ChMarker > > & | GetMarkers () const
void | SetAerodynamicDrag (double Cd, double area, double air_density)
| Set parameters and enable aerodynamic drag force calculation.
virtual void | Synchronize (double time)
| Update the state of the chassis subsystem.
void | AddJoint (std::shared_ptr< ChVehicleJoint > joint)
| Utility function to add a joint (kinematic or bushing) to the vehicle system.
void | AddExternalForceTorque (std::shared_ptr< ExternalForceTorque > load)
| Utility force to add an external load to the chassis body.
void | AddTerrainLoad (std::shared_ptr< ChLoadBase > terrain_load)
| Add a terrain load to the vehicle system.
virtual void | InitializeInertiaProperties () override
| Initialize subsystem inertia properties.
virtual void | UpdateInertiaProperties () override
| Update subsystem inertia properties.
Public Member Functions inherited from chrono::vehicle::ChPart
const std::string & | GetName () const
| Get the name identifier for this subsystem.
void | SetName (const std::string &name)
| Set the name identifier for this subsystem.
bool | IsInitialized () const
| Return flag indicating whether or not the part is fully constructed.
double | GetMass () const
| Get the subsystem mass.
const ChFrame & | GetCOMFrame () const
| Get the current subsystem COM frame (relative to and expressed in the subsystem's reference frame).
const ChMatrix33 & | GetInertia () const
| Get the current subsystem inertia (relative to the subsystem COM frame).
const ChFrame & | GetTransform () const
| Get the current subsystem position relative to the global frame.
void | SetVisualizationType (VisualizationType vis)
| Set the visualization mode for this subsystem.
virtual void | SetOutput (bool state)
| Enable/disable output for this subsystem.
bool | OutputEnabled () const
| Return the output state for this subsystem.

## Protected Member Functions
virtual void | ExportComponentList (rapidjson::Document &jsonDocument) const override
| Export this subsystem's component list to the specified JSON object.
virtual void | Output (ChVehicleOutput &database) const override
| Output data for this subsystem's component list to the specified database.
Protected Member Functions inherited from chrono::vehicle::ChChassis
virtual double | GetBodyMass () const =0
virtual ChFrame | GetBodyCOMFrame () const =0
virtual ChMatrix33 | GetBodyInertia () const =0
Protected Member Functions inherited from chrono::vehicle::ChPart
| ChPart (const std::string &name)
| Construct a vehicle subsystem with the specified name.
void | AddMass (double &mass)
| Add this subsystem's mass.
void | AddInertiaProperties (ChVector3d &com, ChMatrix33<> &inertia)
| Add this subsystem's inertia properties.
virtual void | Create (const rapidjson::Document &d)
| Create a vehicle subsystem from JSON data.
void | ExportBodyList (rapidjson::Document &jsonDocument, std::vector< std::shared_ptr< ChBody > > bodies) const
| Export the list of bodies to the specified JSON document.
void | ExportShaftList (rapidjson::Document &jsonDocument, std::vector< std::shared_ptr< ChShaft > > shafts) const
| Export the list of shafts to the specified JSON document.
void | ExportJointList (rapidjson::Document &jsonDocument, std::vector< std::shared_ptr< ChLink > > joints) const
| Export the list of joints to the specified JSON document.
void | ExportCouplesList (rapidjson::Document &jsonDocument, std::vector< std::shared_ptr< ChShaftsCouple > > couples) const
| Export the list of shaft couples to the specified JSON document.
void | ExportMarkerList (rapidjson::Document &jsonDocument, std::vector< std::shared_ptr< ChMarker > > markers) const
| Export the list of markers to the specified JSON document.
void | ExportLinSpringList (rapidjson::Document &jsonDocument, std::vector< std::shared_ptr< ChLinkTSDA > > springs) const
| Export the list of translational springs to the specified JSON document.
void | ExportRotSpringList (rapidjson::Document &jsonDocument, std::vector< std::shared_ptr< ChLinkRSDA > > springs) const
| Export the list of rotational springs to the specified JSON document.
void | ExportBodyLoadList (rapidjson::Document &jsonDocument, std::vector< std::shared_ptr< ChLoadBodyBody > > loads) const
| Export the list of body-body loads to the specified JSON document.

## Protected Attributes
ChVehicleGeometry | m_geometry
| collection of visualization and collision shapes
Protected Attributes inherited from chrono::vehicle::ChChassis
std::shared_ptr< ChBodyAuxRef > | m_body
| handle to the chassis body
std::shared_ptr< ChLoadContainer > | m_container_bushings
| load container for vehicle bushings
std::shared_ptr< ChLoadContainer > | m_container_external
| load container for external forces
std::shared_ptr< ChLoadContainer > | m_container_terrain
| load container for terrain forces
std::vector< std::shared_ptr< ExternalForceTorque > > | m_external_loads
| external loads
std::vector< std::shared_ptr< ChMarker > > | m_markers
| list of user-defined markers
bool | m_fixed
| is the chassis body fixed to ground?
Protected Attributes inherited from chrono::vehicle::ChPart
std::string | m_name
| subsystem name
bool | m_initialized
| specifies whether ot not the part is fully constructed
bool | m_output
| specifies whether or not output is generated for this subsystem
std::shared_ptr< ChPart > | m_parent
| parent subsystem (empty if parent is vehicle)
double | m_mass
| subsystem mass
ChMatrix33 | m_inertia
| inertia tensor (relative to subsystem COM)
ChFrame | m_com
| COM frame (relative to subsystem reference frame).
ChFrame | m_xform
| subsystem frame expressed in the global frame

## Additional Inherited Members
Static Public Member Functions inherited from chrono::vehicle::ChChassis
static void | RemoveJoint (std::shared_ptr< ChVehicleJoint > joint)
| Utility function to remove a joint (kinematic or bushing) from the vehicle system.
Static Public Member Functions inherited from chrono::vehicle::ChPart
static ChMatrix33 | TransformInertiaMatrix (const ChVector3d &moments, const ChVector3d &products, const ChMatrix33<> &vehicle_rot, const ChMatrix33<> &body_rot)
| Utility function for transforming inertia tensors between centroidal frames.
Static Protected Member Functions inherited from chrono::vehicle::ChPart
static void | RemoveVisualizationAssets (std::shared_ptr< ChPhysicsItem > item)
| Erase all visual shapes from the visual model associated with the specified physics item (if any).
static void | RemoveVisualizationAsset (std::shared_ptr< ChPhysicsItem > item, std::shared_ptr< ChVisualShape > shape)
| Erase the given shape from the visual model associated with the specified physics item (if any).

## Constructor & Destructor Documentation

## ◆ ChRigidChassis()

chrono::vehicle::ChRigidChassis::ChRigidChassis | ( | const std::string & | name,
|  | bool | fixed = false )

Construct a vehicle subsystem with the specified name.

Parameters

  [in] | name | name of the subsystem
  [in] | fixed | is the chassis body fixed to ground?

## Member Function Documentation

## ◆ AddVisualizationAssets()

void chrono::vehicle::ChRigidChassis::AddVisualizationAssets | ( | VisualizationType | vis | ) |
| overridevirtual

Add visualization assets to this subsystem, for the specified visualization mode.

Reimplemented from chrono::vehicle::ChPart.

## ◆ EnableCollision()

virtual void chrono::vehicle::ChRigidChassis::EnableCollision | ( | bool | state | ) |
| inlineoverridevirtual

Enable/disable contact for the chassis.

This function controls contact of the chassis with all other collision shapes in the simulation. Must be called after initialization and has effect only if the derived object has defined some collision shapes.

Implements chrono::vehicle::ChChassis.

## ◆ ExportComponentList()

void chrono::vehicle::ChRigidChassis::ExportComponentList | ( | rapidjson::Document & | jsonDocument | ) | const
| overrideprotectedvirtual

Export this subsystem's component list to the specified JSON object.

Derived classes should override this function and first invoke the base class implementation, followed by calls to the various static Export***List functions, as appropriate.

Reimplemented from chrono::vehicle::ChPart.

## ◆ GetMeshFilename()

const std::string & chrono::vehicle::ChRigidChassis::GetMeshFilename | ( |  | ) | const
| inline

Get the name of the Wavefront file with chassis visualization mesh.

An empty string is returned if no mesh was specified.

## ◆ GetTemplateName()

virtual std::string chrono::vehicle::ChRigidChassis::GetTemplateName | ( |  | ) | const
| inlineoverridevirtual

Get the name of the vehicle subsystem template.

Implements chrono::vehicle::ChPart.

## ◆ Initialize()

void chrono::vehicle::ChRigidChassis::Initialize | ( | ChSystem * | system,
|  | const ChCoordsys<> & | chassisPos,
|  | double | chassisFwdVel,
|  | int | collision_family = 0 )
| overridevirtual

Initialize the chassis at the specified global position and orientation.

Parameters

  [in] | system | containing system
  [in] | chassisPos | absolute chassis position
  [in] | chassisFwdVel | initial chassis forward velocity
  [in] | collision_family | chassis collision family

Reimplemented from chrono::vehicle::ChChassis.

## ◆ Output()

void chrono::vehicle::ChRigidChassis::Output | ( | ChVehicleOutput & | database | ) | const
| overrideprotectedvirtual

Output data for this subsystem's component list to the specified database.

Reimplemented from chrono::vehicle::ChPart.

## ◆ RemoveVisualizationAssets()

void chrono::vehicle::ChRigidChassis::RemoveVisualizationAssets | ( |  | ) |
| finaloverridevirtual

Remove all visualization assets from this subsystem.

Reimplemented from chrono::vehicle::ChPart.

The documentation for this class was generated from the following files:

- D:/W/B/src/chrono-9.0.1/src/chrono_vehicle/chassis/ChRigidChassis.h
- D:/W/B/src/chrono-9.0.1/src/chrono_vehicle/chassis/ChRigidChassis.cpp