Description

Base class for a vehicle subsystem.

It manages the part's name, visualization assets, and output.

#include <ChPart.h>

Inheritance diagram for chrono::vehicle::ChPart:
Collaboration diagram for chrono::vehicle::ChPart:

Public Member Functions

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.
 
virtual std::string GetTemplateName () const =0
 Get the name of the vehicle subsystem template.
 
bool IsInitialized () const
 Return flag indicating whether or not the part is fully constructed.
 
double GetMass () const
 Get the subsystem mass. More...
 
const ChFrameGetCOMFrame () const
 Get the current subsystem COM frame (relative to and expressed in the subsystem's reference frame). More...
 
const ChMatrix33GetInertia () const
 Get the current subsystem inertia (relative to the subsystem COM frame). More...
 
const ChFrameGetTransform () const
 Get the current subsystem position relative to the global frame. More...
 
void SetVisualizationType (VisualizationType vis)
 Set the visualization mode for this subsystem.
 
virtual void AddVisualizationAssets (VisualizationType vis)
 Add visualization assets to this subsystem, for the specified visualization mode.
 
virtual void RemoveVisualizationAssets ()
 Remove all visualization assets from this subsystem.
 
virtual void SetOutput (bool state)
 Enable/disable output for this subsystem.
 
bool OutputEnabled () const
 Return the output state for this subsystem.
 
virtual void ExportComponentList (rapidjson::Document &jsonDocument) const
 Export this subsystem's component list to the specified JSON object. More...
 
virtual void Output (ChVehicleOutput &database) const
 Output data for this subsystem's component list to the specified database.
 

Static Public Member Functions

static ChMatrix33 TransformInertiaMatrix (const ChVector<> &moments, const ChVector<> &products, const ChMatrix33<> &vehicle_rot, const ChMatrix33<> &body_rot)
 Utility function for transforming inertia tensors between centroidal frames. More...
 

Protected Member Functions

 ChPart (const std::string &name)
 Construct a vehicle subsystem with the specified name.
 
virtual void InitializeInertiaProperties ()=0
 Initialize subsystem inertia properties. More...
 
virtual void UpdateInertiaProperties ()=0
 Update subsystem inertia properties. More...
 
void AddMass (double &mass)
 Add this subsystem's mass. More...
 
void AddInertiaProperties (ChVector<> &com, ChMatrix33<> &inertia)
 Add this subsystem's inertia properties. More...
 
virtual void Create (const rapidjson::Document &d)
 Create a vehicle subsystem from JSON data. More...
 
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.
 

Static Protected Member Functions

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).
 

Protected Attributes

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< ChPartm_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
 

Friends

class ChAxle
 
class ChWheeledVehicle
 
class ChTrackedVehicle
 

Member Function Documentation

◆ AddInertiaProperties()

void chrono::vehicle::ChPart::AddInertiaProperties ( ChVector<> &  com,
ChMatrix33<> &  inertia 
)
protected

Add this subsystem's inertia properties.

This utility function first invokes UpdateInertiaProperties and then incorporates the contribution from this subsystem to the provided quantities:

  • com: COM expressed in the global frame (scaled by the subsystem mass)
  • inertia: inertia tensor relative to the global reference frame

◆ AddMass()

void chrono::vehicle::ChPart::AddMass ( double &  mass)
protected

Add this subsystem's mass.

This utility function first invokes InitializeInertiaProperties and then increments the given total mass.

◆ Create()

void chrono::vehicle::ChPart::Create ( const rapidjson::Document &  d)
protectedvirtual

Create a vehicle subsystem from JSON data.

A derived class must override this function and first invoke the base class implementation.

◆ ExportComponentList()

void chrono::vehicle::ChPart::ExportComponentList ( rapidjson::Document &  jsonDocument) const
virtual

◆ GetCOMFrame()

const ChFrame& chrono::vehicle::ChPart::GetCOMFrame ( ) const
inline

Get the current subsystem COM frame (relative to and expressed in the subsystem's reference frame).

Note that the correct value is reported only after the subsystem is initialized.

◆ GetInertia()

const ChMatrix33& chrono::vehicle::ChPart::GetInertia ( ) const
inline

Get the current subsystem inertia (relative to the subsystem COM frame).

The return 3x3 symmetric matrix

 [ int{x^2+z^2}dm    -int{xy}dm    -int{xz}dm    ]
 [                  int{x^2+z^2}   -int{yz}dm    ]
 [                                int{x^2+y^2}dm ]

represents the inertia tensor relative to the subsystem COM frame. Note that the correct value is reported only after the subsystem is initialized.

◆ GetMass()

double chrono::vehicle::ChPart::GetMass ( ) const
inline

Get the subsystem mass.

Note that the correct value is reported only after the subsystem is initialized.

◆ GetTransform()

const ChFrame& chrono::vehicle::ChPart::GetTransform ( ) const
inline

Get the current subsystem position relative to the global frame.

Note that the vehicle frame is defined to be the reference frame of the (main) chassis. Note that the correct value is reported only after the subsystem is initialized.

◆ InitializeInertiaProperties()

virtual void chrono::vehicle::ChPart::InitializeInertiaProperties ( )
protectedpure virtual

Initialize subsystem inertia properties.

Derived classes must override this function and set the subsystem mass (m_mass) and, if constant, the subsystem COM frame and its inertia tensor. This function is called during initialization of the vehicle system.

Implemented in chrono::vehicle::ChDeformableTire, chrono::vehicle::ChRigidTire, chrono::vehicle::ChTrackAssembly, chrono::vehicle::ChSAELeafspringAxle, chrono::vehicle::ChChassis, chrono::vehicle::ChMultiLink, chrono::vehicle::ChDoubleWishbone, chrono::vehicle::ChToeBarDeDionAxle, chrono::vehicle::ChHendricksonPRIMAXX, chrono::vehicle::ChThreeLinkIRS, chrono::vehicle::ChMacPhersonStrut, chrono::vehicle::ChDeDionAxle, chrono::vehicle::ChToeBarLeafspringAxle, chrono::vehicle::ChToeBarRigidPanhardAxle, chrono::vehicle::ChRigidPanhardAxle, chrono::vehicle::ChToeBarPushPipeAxle, chrono::vehicle::ChSolidBellcrankThreeLinkAxle, chrono::vehicle::ChSolidAxle, chrono::vehicle::ChSemiTrailingArm, chrono::vehicle::ChLeafspringAxle, chrono::vehicle::ChPushPipeAxle, chrono::vehicle::ChSingleWishbone, chrono::vehicle::ChSolidThreeLinkAxle, chrono::vehicle::ChPitmanArmShafts, chrono::vehicle::ChSprocket, chrono::vehicle::ChDoubleWishboneReduced, chrono::vehicle::ChWheel, chrono::vehicle::ChPitmanArm, chrono::vehicle::ChRigidPinnedAxle, chrono::vehicle::ChRotaryArm, chrono::vehicle::ChRigidSuspension, chrono::vehicle::ChDistanceIdler, chrono::vehicle::ChTranslationalIdler, chrono::vehicle::ChTranslationalDamperSuspension, chrono::vehicle::ChTransmission, chrono::vehicle::ChTrackWheel, chrono::vehicle::ChRotationalDamperSuspension, chrono::vehicle::ChRackPinion, chrono::vehicle::ChTrackShoeBandANCF, chrono::vehicle::ChTrackShoeDoublePin, chrono::vehicle::ChAntirollBarRSD, chrono::vehicle::ChTrackShoeBandBushing, chrono::vehicle::ChBalancer, chrono::vehicle::ChTrackShoeSinglePin, chrono::vehicle::ChBrake, chrono::vehicle::ChDriveline, chrono::vehicle::ChTrackBrake, and chrono::vehicle::ChEngine.

◆ TransformInertiaMatrix()

ChMatrix33 chrono::vehicle::ChPart::TransformInertiaMatrix ( const ChVector<> &  moments,
const ChVector<> &  products,
const ChMatrix33<> &  vehicle_rot,
const ChMatrix33<> &  body_rot 
)
static

Utility function for transforming inertia tensors between centroidal frames.

It converts an inertia matrix specified in a centroidal frame aligned with the vehicle reference frame to an inertia matrix expressed in a centroidal body reference frame.

Parameters
momentsmoments of inertia in vehicle-aligned centroidal frame
productsproducts of inertia in vehicle-aligned centroidal frame
vehicle_rotvehicle absolute orientation matrix
body_rotbody absolute orientation matrix

◆ UpdateInertiaProperties()

virtual void chrono::vehicle::ChPart::UpdateInertiaProperties ( )
protectedpure virtual

Update subsystem inertia properties.

Derived classes must override this function and set the global subsystem transform (m_xform) and, unless constant, the subsystem COM frame (m_com) and its inertia tensor (m_inertia). Calculate the current inertia properties and global frame of this subsystem. This function is called every time the state of the vehicle system is advanced in time.

Implemented in chrono::vehicle::ChDeformableTire, chrono::vehicle::ChRigidTire, chrono::vehicle::ChTrackAssembly, chrono::vehicle::ChSAELeafspringAxle, chrono::vehicle::ChChassis, chrono::vehicle::ChMultiLink, chrono::vehicle::ChDoubleWishbone, chrono::vehicle::ChToeBarDeDionAxle, chrono::vehicle::ChHendricksonPRIMAXX, chrono::vehicle::ChThreeLinkIRS, chrono::vehicle::ChMacPhersonStrut, chrono::vehicle::ChDeDionAxle, chrono::vehicle::ChToeBarLeafspringAxle, chrono::vehicle::ChToeBarRigidPanhardAxle, chrono::vehicle::ChRigidPanhardAxle, chrono::vehicle::ChToeBarPushPipeAxle, chrono::vehicle::ChSolidBellcrankThreeLinkAxle, chrono::vehicle::ChSolidAxle, chrono::vehicle::ChSemiTrailingArm, chrono::vehicle::ChLeafspringAxle, chrono::vehicle::ChPushPipeAxle, chrono::vehicle::ChSingleWishbone, chrono::vehicle::ChSolidThreeLinkAxle, chrono::vehicle::ChPitmanArmShafts, chrono::vehicle::ChSprocket, chrono::vehicle::ChDoubleWishboneReduced, chrono::vehicle::ChWheel, chrono::vehicle::ChPitmanArm, chrono::vehicle::ChRigidPinnedAxle, chrono::vehicle::ChRotaryArm, chrono::vehicle::ChRigidSuspension, chrono::vehicle::ChDistanceIdler, chrono::vehicle::ChTranslationalIdler, chrono::vehicle::ChTranslationalDamperSuspension, chrono::vehicle::ChTransmission, chrono::vehicle::ChTrackWheel, chrono::vehicle::ChRotationalDamperSuspension, chrono::vehicle::ChRackPinion, chrono::vehicle::ChTrackShoeBandANCF, chrono::vehicle::ChTrackShoeDoublePin, chrono::vehicle::ChAntirollBarRSD, chrono::vehicle::ChTrackShoeBandBushing, chrono::vehicle::ChBalancer, chrono::vehicle::ChTrackShoeSinglePin, chrono::vehicle::ChBrake, chrono::vehicle::ChDriveline, chrono::vehicle::ChTrackBrake, and chrono::vehicle::ChEngine.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_vehicle/ChPart.h
  • /builds/uwsbel/chrono/src/chrono_vehicle/ChPart.cpp