PxVehicleSuspensionComponent

Defined in include/vehicle2/suspension/PxVehicleSuspensionComponents.h

Inheritance Relationships

Base Type

class PxVehicleSuspensionComponent : public PxVehicleComponent

Public Functions

inline PxVehicleSuspensionComponent()
inline virtual ~PxVehicleSuspensionComponent()
virtual void getDataForSuspensionComponent(const PxVehicleAxleDescription *&axleDescription, const PxVehicleRigidBodyParams *&rigidBodyParams, const PxVehicleSuspensionStateCalculationParams *&suspensionStateCalculationParams, PxVehicleArrayData<const PxReal> &steerResponseStates, const PxVehicleRigidBodyState *&rigidBodyState, PxVehicleArrayData<const PxVehicleWheelParams> &wheelParams, PxVehicleArrayData<const PxVehicleSuspensionParams> &suspensionParams, PxVehicleArrayData<const PxVehicleSuspensionComplianceParams> &suspensionComplianceParams, PxVehicleArrayData<const PxVehicleSuspensionForceParams> &suspensionForceParams, PxVehicleSizedArrayData<const PxVehicleAntiRollForceParams> &antiRollForceParams, PxVehicleArrayData<const PxVehicleRoadGeometryState> &wheelRoadGeomStates, PxVehicleArrayData<PxVehicleSuspensionState> &suspensionStates, PxVehicleArrayData<PxVehicleSuspensionComplianceState> &suspensionComplianceStates, PxVehicleArrayData<PxVehicleSuspensionForce> &suspensionForces, PxVehicleAntiRollTorque *&antiRollTorque) = 0

Retrieve pointers to the parameter and state data required to compute the suspension state and the forces/torques that arise from the suspension state.

Note

antiRollForceParams and antiRollTorque should be returned either both non-NULL or both NULL.

Parameters
  • axleDescription[out] must be returned as a non-null pointer to a single PxVehicleAxleDescription instance that describes the wheels and axles of the vehicle.

  • rigidBodyParams[out] must be returned as a a non-null pointer to a single PxVehicleRigidBodyParams instance that describes the mass and moment of inertia of the vehicle’s rigid body.

  • suspensionStateCalculationParams[out] must be returned as a non-null pointer to a single PxVehicleSuspensionStateCalculationParams instance that describes the jounce computation type etc.

  • steerResponseStates[out] must be returned as a non-null pointer to a single PxVehicleSteerCommandResponseStates instance that describes the steer state of the wheels.

  • rigidBodyState[out] must be returned as a non-null pointer to a single PxVehicleRigidBodyState instance that describes the pose and momentum of the vehicle’s rigid body.

  • wheelParams[out] must be set to a non-null pointer to an array of PxVehicleWheelParams containing per-wheel parameters for each wheel referenced by axleDescription.

  • suspensionParams[out] must be set to a non-null pointer to an array of PxVehicleSuspensionParams containing per-wheel parameters for each wheel referenced by axleDescription.

  • suspensionComplianceParams[out] must be set to a non-null pointer to an array of PxVehicleSuspensionComplianceParams containing per-wheel parameters for each wheel referenced by axleDescription.

  • suspensionForceParams[out] must be set to a non-null pointer to an array of PxVehicleSuspensionForceParams containing per-wheel parameters for each wheel referenced by axleDescription.

  • antiRollForceParams[out] is optionally returned as a non-null pointer to an array of PxVehicleAntiRollForceParams with each element in the array describing a unique anti-roll bar connecting a pair of wheels.

  • wheelRoadGeomStates[out] must be set to non-null pointer to an array of PxVehicleRoadGeometryState containing per-wheel road geometry for each wheel referenced by axleDescription.

  • suspensionStates[out] must be set to a non-null pointer to an array of PxVehicleSuspensionState containing per-wheel suspension state for each wheel referenced by axleDescription.

  • suspensionComplianceStates[out] must be set to a non-null pointer to an array of PxVehicleSuspensionComplianceState containing per-wheel suspension compliance state for each wheel referenced by axleDescription.

  • suspensionForces[out] must be set to a non-null pointer to an array of PxVehicleSuspensionForce containing per-wheel suspension forces for each wheel referenced by axleDescription.

  • antiRollTorque[out] is optionally returned as a non-null pointer to a single PxVehicleAntiRollTorque instance that will store the accumulated anti-roll torque to be applied to the vheicle’s rigid body.

inline virtual bool update(const PxReal dt, const PxVehicleSimulationContext &context)

Update the suspension state and suspension compliance state and use those updated states to compute suspension and anti-roll forces/torques to apply to the vehicle’s rigid body.

Note

The suspension and anti-roll forces/torques are computed in the world frame.

Parameters
  • dt[in] is the simulation time that has passed since the last call to PxVehicleSuspensionComponent::update()

  • context[in] describes a variety of global simulation constants such as frame and scale of the simulation and the gravitational acceleration of the simulated environment.