chrono::vehicle::ChSuspensionTestRig Class Reference

Description

Definition of a suspension test rig.

#include <ChSuspensionTestRig.h>

Inheritance diagram for chrono::vehicle::ChSuspensionTestRig:
Collaboration diagram for chrono::vehicle::ChSuspensionTestRig:

Public Member Functions

 ChSuspensionTestRig (ChWheeledVehicle &vehicle, int axle_index, double displ_limit, std::shared_ptr< ChTire > tire_left, std::shared_ptr< ChTire > tire_right, ChMaterialSurface::ContactMethod contact_method=ChMaterialSurface::NSC)
 Construct a test rig for a specified axle of a given vehicle. More...
 
 ChSuspensionTestRig (const std::string &filename, int axle_index, double displ_limit, std::shared_ptr< ChTire > tire_left, std::shared_ptr< ChTire > tire_right, ChMaterialSurface::ContactMethod contact_method=ChMaterialSurface::NSC)
 Construct a test rig for a specified axle of a given vehicle. More...
 
 ChSuspensionTestRig (const std::string &filename, std::shared_ptr< ChTire > tire_left, std::shared_ptr< ChTire > tire_right, ChMaterialSurface::ContactMethod contact_method=ChMaterialSurface::NSC)
 Construct a test rig from specified (JSON) file. More...
 
 ~ChSuspensionTestRig ()
 Destructor.
 
virtual std::string GetTemplateName () const override
 Get the name of the vehicle system template.
 
void SetDisplacementLimit (double val)
 Set the limits for post displacement. More...
 
void SetActuatorFunction (VehicleSide side, const std::shared_ptr< ChFunction > &func)
 Set the actuator function on the specified post (currently NOT USED).
 
std::shared_ptr< ChBodyGetWheelBody (VehicleSide side) const
 Get a handle to the specified wheel body.
 
const ChVectorGetWheelPos (VehicleSide side) const
 Get the global location of the specified wheel.
 
const ChQuaternionGetWheelRot (VehicleSide side) const
 Get the global rotation of the specified wheel.
 
const ChVectorGetWheelLinVel (VehicleSide side) const
 Get the global linear velocity of wheel.
 
ChVector GetWheelAngVel (VehicleSide side) const
 Get the global angular velocity of wheel.
 
WheelState GetWheelState (VehicleSide side) const
 Get the complete state for the specified wheel.
 
std::shared_ptr< ChBodyGetPostBody (VehicleSide side) const
 Get a handle to the specified post body.
 
const ChVectorGetPostPos (VehicleSide side) const
 Get the global location of the specified post body.
 
double GetActuatorDisp (VehicleSide side)
 
double GetActuatorForce (VehicleSide side)
 
double GetActuatorMarkerDist (VehicleSide side)
 
bool HasSteering () const
 Return true if a steering system is attached.
 
bool HasAntirollbar () const
 Return true if an anti-roll bar system is attached.
 
std::shared_ptr< ChSuspensionGetSuspension () const
 Get the suspension subsystem.
 
std::shared_ptr< ChSteeringGetSteering () const
 Get the steering subsystem.
 
std::shared_ptr< ChAntirollBarGetAntirollBar () const
 Get the anti-roll bar subsystem.
 
std::shared_ptr< ChWheelGetWheel (VehicleSide side) const
 Get a handle to the specified wheel subsystem.
 
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.
 
virtual double GetVehicleMass () const override
 Get the rig total mass. More...
 
virtual ChVector GetVehicleCOMPos () const override
 Get the current global rig COM location.
 
virtual void Initialize (const ChCoordsys<> &chassisPos, double chassisFwdVel=0) override
 Initialize this chassis at the specified global location and orientation. More...
 
void SetSuspensionVisualizationType (VisualizationType vis)
 Set visualization type for the suspension subsystem.
 
void SetSteeringVisualizationType (VisualizationType vis)
 Set visualization type for the steering subsystems.
 
void SetWheelVisualizationType (VisualizationType vis)
 Set visualization type for the wheel subsystems.
 
void SetTireVisualizationType (VisualizationType vis)
 Set visualization type for the tire subsystems.
 
void Synchronize (double time, double steering, double disp_L, double disp_R)
 Update the state at the current time. More...
 
virtual void Advance (double step) override
 Advance the state of the suspension test rig by the specified time step. More...
 
virtual void LogConstraintViolations () override
 Log current constraint violations.
 
virtual std::string ExportComponentList () const override
 Return a JSON string with information on all modeling components in the vehicle system. More...
 
virtual void ExportComponentList (const std::string &filename) const override
 Write a JSON-format file with information on all modeling components in the vehicle system. More...
 
- Public Member Functions inherited from chrono::vehicle::ChVehicle
virtual ~ChVehicle ()
 Destructor.
 
const std::string & GetName () const
 Get the name identifier for this vehicle.
 
void SetName (const std::string &name)
 Set the name identifier for this vehicle.
 
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 GetVehiclePointLocation (const ChVector<> &locpos) const
 Get the global position of the specified point. More...
 
ChVector GetVehiclePointVelocity (const ChVector<> &locpos) const
 Get the global velocity of the specified point. 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.
 
void SetOutput (ChVehicleOutput::Type type, const std::string &out_dir, const std::string &out_name, double output_step)
 Enable output for this vehicle system. More...
 
void SetChassisVisualizationType (VisualizationType vis)
 Set visualization mode for the chassis subsystem.
 
void SetChassisCollide (bool state)
 Enable/disable collision for the chassis subsystem. More...
 
virtual void SetChassisVehicleCollide (bool state)
 Enable/disable collision between the chassis and all other vehicle subsystems. More...
 
void SetChassisOutput (bool state)
 Enable/disable output from the chassis subsystem.
 
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.
 

Additional Inherited Members

- Protected Member Functions inherited from chrono::vehicle::ChVehicle
 ChVehicle (const std::string &name, ChMaterialSurface::ContactMethod contact_method=ChMaterialSurface::NSC)
 Construct a vehicle system with an underlying ChSystem. More...
 
 ChVehicle (const std::string &name, ChSystem *system)
 Construct a vehicle system using the specified ChSystem. More...
 
- Static Protected Member Functions inherited from chrono::vehicle::ChVehicle
template<typename T >
static bool AnyOutput (const std::vector< std::shared_ptr< T >> &list)
 Utility function for testing if any subsystem in a list generates output.
 
- Protected Attributes inherited from chrono::vehicle::ChVehicle
std::string m_name
 vehicle name
 
ChSystemm_system
 pointer to the Chrono system
 
bool m_ownsSystem
 true if system created at construction
 
bool m_output
 generate ouput for this vehicle system
 
ChVehicleOutputm_output_db
 vehicle output database
 
double m_output_step
 output time step
 
double m_next_output_time
 time for next output
 
int m_output_frame
 current output frame
 
std::shared_ptr< ChChassism_chassis
 handle to the chassis subsystem
 
double m_stepsize
 integration step-size for the vehicle system
 

Constructor & Destructor Documentation

chrono::vehicle::ChSuspensionTestRig::ChSuspensionTestRig ( ChWheeledVehicle vehicle,
int  axle_index,
double  displ_limit,
std::shared_ptr< ChTire tire_left,
std::shared_ptr< ChTire tire_right,
ChMaterialSurface::ContactMethod  contact_method = ChMaterialSurface::NSC 
)

Construct a test rig for a specified axle of a given vehicle.

This version uses a concrete vehicle object.

Parameters
vehiclevehicle source
axle_indexindex of the suspension to be tested
displ_limitlimits for post displacement
tire_leftleft tire
tire_rightright tire
contact_methodcontact method
chrono::vehicle::ChSuspensionTestRig::ChSuspensionTestRig ( const std::string &  filename,
int  axle_index,
double  displ_limit,
std::shared_ptr< ChTire tire_left,
std::shared_ptr< ChTire tire_right,
ChMaterialSurface::ContactMethod  contact_method = ChMaterialSurface::NSC 
)

Construct a test rig for a specified axle of a given vehicle.

This version assumes the vehicle is specified through a JSON file.

Parameters
filenameJSON file with vehicle specification
axle_indexindex of the suspension to be tested
displ_limitlimits for post displacement
tire_leftleft tire
tire_rightright tire
contact_methodcontact method
chrono::vehicle::ChSuspensionTestRig::ChSuspensionTestRig ( const std::string &  filename,
std::shared_ptr< ChTire tire_left,
std::shared_ptr< ChTire tire_right,
ChMaterialSurface::ContactMethod  contact_method = ChMaterialSurface::NSC 
)

Construct a test rig from specified (JSON) file.

Parameters
filenameJSON file with test rig specification
tire_leftleft tire
tire_rightright tire
contact_methodcontact method

Member Function Documentation

void chrono::vehicle::ChSuspensionTestRig::Advance ( double  step)
overridevirtual

Advance the state of the suspension test rig by the specified time step.

Note that this function also advances the tire states.

Reimplemented from chrono::vehicle::ChVehicle.

std::string chrono::vehicle::ChSuspensionTestRig::ExportComponentList ( ) const
overridevirtual

Return a JSON string with information on all modeling components in the vehicle system.

These include bodies, shafts, joints, spring-damper elements, markers, etc.

Implements chrono::vehicle::ChVehicle.

void chrono::vehicle::ChSuspensionTestRig::ExportComponentList ( const std::string &  filename) const
overridevirtual

Write a JSON-format file with information on all modeling components in the vehicle system.

These include bodies, shafts, joints, spring-damper elements, markers, etc.

Implements chrono::vehicle::ChVehicle.

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

Get the rig total mass.

This includes the mass of the suspension and wheels, and (if present) the mass of the steering mechanism.

Implements chrono::vehicle::ChVehicle.

void chrono::vehicle::ChSuspensionTestRig::Initialize ( const ChCoordsys<> &  chassisPos,
double  chassisFwdVel = 0 
)
overridevirtual

Initialize this chassis at the specified global location and orientation.

Parameters
[in]chassisPosinitial global position and orientation
[in]chassisFwdVelinitial forward velocity (ignored)

Implements chrono::vehicle::ChVehicle.

void chrono::vehicle::ChSuspensionTestRig::SetDisplacementLimit ( double  val)

Set the limits for post displacement.

Each post will move between [-val, +val].

void chrono::vehicle::ChSuspensionTestRig::Synchronize ( double  time,
double  steering,
double  disp_L,
double  disp_R 
)

Update the state at the current time.

steering between -1 and +1, and no force need be applied if using external actuation

Parameters
[in]timecurrent time
[in]steeringcurrent steering input [-1,+1]
[in]disp_Lleft post displacement
[in]disp_Rright post displacement