chrono::vehicle::citybus::CityBus_Vehicle Class Reference

Description

Bus model with two axles and double tires on rear axle.

#include <CityBus_Vehicle.h>

Inheritance diagram for chrono::vehicle::citybus::CityBus_Vehicle:
Collaboration diagram for chrono::vehicle::citybus::CityBus_Vehicle:

Public Member Functions

 CityBus_Vehicle (const bool fixed, BrakeType brake_type, ChContactMethod contact_method=ChContactMethod::NSC, CollisionType chassis_collision_type=CollisionType::NONE)
 
 CityBus_Vehicle (ChSystem *system, const bool fixed, BrakeType brake_type, CollisionType chassis_collision_type=CollisionType::NONE)
 
virtual int GetNumberAxles () const override
 Return the number of axles for this vehicle.
 
virtual double GetWheelbase () const override
 Return the vehicle wheelbase.
 
virtual double GetMinTurningRadius () const override
 Return the minimum turning radius. More...
 
virtual double GetMaxSteeringAngle () const override
 Return the maximum steering angle. More...
 
void SetInitWheelAngVel (const std::vector< double > &omega)
 
double GetSpringForce (int axle, VehicleSide side) const
 
double GetSpringLength (int axle, VehicleSide side) const
 
double GetSpringDeformation (int axle, VehicleSide side) const
 
double GetShockForce (int axle, VehicleSide side) const
 
double GetShockLength (int axle, VehicleSide side) const
 
double GetShockVelocity (int axle, VehicleSide side) const
 
virtual void Initialize (const ChCoordsys<> &chassisPos, double chassisFwdVel=0) override
 Initialize this vehicle at the specified global location and orientation. More...
 
void LogHardpointLocations ()
 
void DebugLog (int what)
 suspension hardpoints at design
 
- Public Member Functions inherited from chrono::vehicle::ChWheeledVehicle
 ChWheeledVehicle (const std::string &name, ChContactMethod contact_method=ChContactMethod::NSC)
 Construct a vehicle system with a default ChSystem. More...
 
 ChWheeledVehicle (const std::string &name, ChSystem *system)
 Construct a vehicle system using the specified ChSystem. More...
 
virtual ~ChWheeledVehicle ()
 Destructor.
 
virtual std::string GetTemplateName () const override
 Get the name of the vehicle system template.
 
virtual std::shared_ptr< ChPowertrainGetPowertrain () const override
 Get the powertrain attached to this vehicle.
 
const ChAxleListGetAxles () const
 Get all vehicle axle subsystems.
 
std::shared_ptr< ChAxleGetAxle (int id) const
 Get the specified vehicle axle subsystem.
 
std::shared_ptr< ChSuspensionGetSuspension (int id) const
 Get the specified suspension subsystem.
 
std::shared_ptr< ChSteeringGetSteering (int id) const
 Get the specified steering subsystem.
 
std::shared_ptr< ChWheelGetWheel (int axle, VehicleSide side, WheelLocation location=SINGLE) const
 Get the specified vehicle wheel, by specifying the axle, side, and wheel location. More...
 
std::shared_ptr< ChTireGetTire (int axle, VehicleSide side, WheelLocation location=SINGLE) const
 Get the specified vehicle tire, by specifying the axle, side, and wheel location. More...
 
std::shared_ptr< ChBrakeGetBrake (int axle, VehicleSide side) const
 Get the specified vehicle brake, by specifying the axle and side. More...
 
std::shared_ptr< ChDrivelineWVGetDriveline () const
 Get a handle to the vehicle's driveline subsystem.
 
std::shared_ptr< ChSubchassisGetSubchassis (int id) const
 Get the subchassis system (if none present, returns an empty pointer).
 
virtual double GetVehicleMass () const override
 Get the vehicle total mass. More...
 
virtual ChVector GetVehicleCOMPos () const override
 Get the current global vehicle COM location.
 
virtual std::shared_ptr< ChShaftGetDriveshaft () const override
 Get a handle to the vehicle's driveshaft body.
 
const ChVectorGetSpindlePos (int axle, VehicleSide side) const
 Get the global location of the specified spindle.
 
ChQuaternion GetSpindleRot (int axle, VehicleSide side) const
 Get the orientation of the specified spindle. More...
 
const ChVectorGetSpindleLinVel (int axle, VehicleSide side) const
 Get the linear velocity of the specified spindle. More...
 
ChVector GetSpindleAngVel (int axle, VehicleSide side) const
 Get the angular velocity of the specified spindle. More...
 
double GetSpindleOmega (int axle, VehicleSide side) const
 Get the angular speed of the specified spindle. More...
 
double GetWheeltrack (int id) const
 Return the vehicle wheel track of the specified suspension subsystem.
 
void SetSubchassisVisualizationType (VisualizationType vis)
 Set visualization mode for the sub-chassis subsystems.
 
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 SetChassisVehicleCollide (bool state) override
 Enable/disable collision between the chassis and all other vehicle subsystems. More...
 
void SetSuspensionOutput (int id, bool state)
 Enable/disable output from the suspension subsystems. More...
 
void SetSteeringOutput (int id, bool state)
 Enable/disable output from the steering subsystems. More...
 
void SetAntirollbarOutput (int id, bool state)
 Enable/disable output from the anti-roll bar subsystems. More...
 
void SetDrivelineOutput (bool state)
 Enable/disable output from the driveline subsystem. More...
 
void InitializeTire (std::shared_ptr< ChTire > tire, std::shared_ptr< ChWheel > wheel, VisualizationType tire_vis=VisualizationType::PRIMITIVES, ChTire::CollisionType tire_coll=ChTire::CollisionType::SINGLE_POINT)
 Initialize the given tire and attach it to the specified wheel. More...
 
void InitializePowertrain (std::shared_ptr< ChPowertrain > powertrain)
 Initialize the given powertrain system and associate it to this vehicle. More...
 
virtual void Synchronize (double time, const ChDriver::Inputs &driver_inputs, const ChTerrain &terrain)
 Update the state of this vehicle at the current time. More...
 
virtual void Advance (double step) override final
 Advance the state of this vehicle by the specified time step. More...
 
void LockAxleDifferential (int axle, bool lock)
 Lock/unlock the differential on the specified axle. More...
 
void LockCentralDifferential (int which, bool lock)
 Lock/unlock the specified central differential. More...
 
void EnableBrakeLocking (bool lock)
 Enable/disable brake locking. More...
 
void ApplyParkingBrake (bool lock)
 Engage/disengage parking brake. More...
 
bool ParkingBrake () const
 Returns the state of the parking brake (true if enagaged, false otherwise).
 
void DisconnectDriveline ()
 Disconnect driveline. More...
 
virtual void LogConstraintViolations () override
 Log current constraint violations.
 
void LogSubsystemTypes ()
 Log the types (template names) of current vehicle subsystems.
 
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 main chassis subsystem.
 
std::shared_ptr< ChChassisRearGetChassisRear (int id) const
 Get the specified specified rear chassis subsystem.
 
std::shared_ptr< ChChassisConnectorGetChassisConnector (int id) const
 Get a handle to the specified chassis connector.
 
std::shared_ptr< ChBodyAuxRefGetChassisBody () const
 Get a handle to the vehicle's chassis body.
 
std::shared_ptr< ChBodyAuxRefGetChassisRearBody (int id) const
 Get a handle to the specified rear chassis body.
 
const ChVectorGetVehiclePos () const
 Get the vehicle location. More...
 
ChQuaternion GetVehicleRot () 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 GetVehiclePointAcceleration (const ChVector<> &locpos) const
 Get the acceleration at the specified point. More...
 
ChVector GetDriverPos () const
 Get the global location of the driver.
 
void SetCollisionSystemType (collision::ChCollisionSystemType collsys_type)
 Change the default collision detection system. More...
 
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 SetChassisRearVisualizationType (VisualizationType vis)
 Set visualization mode for the rear chassis subsystems.
 
void SetChassisCollide (bool state)
 Enable/disable collision for the chassis subsystem. More...
 
void SetChassisOutput (bool state)
 Enable/disable output from the chassis subsystem.
 
bool HasBushings () const
 Return true if the vehicle model contains bushings.
 

Additional Inherited Members

- Protected Member Functions inherited from chrono::vehicle::ChWheeledVehicle
virtual void Output (int frame, ChVehicleOutput &database) const override
 Output data for all modeling components in the vehicle system.
 
- Protected Member Functions inherited from chrono::vehicle::ChVehicle
 ChVehicle (const std::string &name, ChContactMethod contact_method=ChContactMethod::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::ChWheeledVehicle
ChSubchassisList m_subchassis
 list of subchassis subsystems (typically empty)
 
ChAxleList m_axles
 list of axle subsystems
 
ChSteeringList m_steerings
 list of steering subsystems
 
std::shared_ptr< ChDrivelineWVm_driveline
 driveline subsystem
 
std::shared_ptr< ChPowertrainm_powertrain
 associated powertrain system
 
bool m_parking_on
 indicates whether or not parking brake is engaged
 
- 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 main chassis subsystem
 
ChChassisRearList m_chassis_rear
 list of rear chassis subsystems (can be empty)
 
ChChassisConnectorList m_chassis_connectors
 list of chassis connector (must match m_chassis_rear)
 

Member Function Documentation

◆ GetMaxSteeringAngle()

virtual double chrono::vehicle::citybus::CityBus_Vehicle::GetMaxSteeringAngle ( ) const
inlineoverridevirtual

Return the maximum steering angle.

This default implementation estimates the maximum steering angle based on a bicycle model and the vehicle minimum turning radius.

Reimplemented from chrono::vehicle::ChWheeledVehicle.

◆ GetMinTurningRadius()

virtual double chrono::vehicle::citybus::CityBus_Vehicle::GetMinTurningRadius ( ) const
inlineoverridevirtual

Return the minimum turning radius.

A concrete wheeled vehicle class should override the default value (20 m).

Reimplemented from chrono::vehicle::ChWheeledVehicle.

◆ Initialize()

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

Initialize this vehicle at the specified global location and orientation.

This base class implementation only initializes the main chassis subsystem. Derived classes must extend this function to initialize all other wheeled vehicle subsystems (axles, steerings, driveline).

Parameters
[in]chassisPosinitial global position and orientation
[in]chassisFwdVelinitial chassis forward velocity

Reimplemented from chrono::vehicle::ChWheeledVehicle.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_models/vehicle/citybus/CityBus_Vehicle.h
  • /builds/uwsbel/chrono/src/chrono_models/vehicle/citybus/CityBus_Vehicle.cpp