Python Bindings API

pybind11 carb.physx.vehicle bindings

class omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle
attach_stage(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, id: int, unregisterFromStageUpdate: bool) bool

Attach to a USD stage explicitly. This will traverse the prims of the stage and create controllers as needed. This method should only be used if the controllers are going to be updated explicitly (see update_controllers()) instead of being tirggered by the default stage update loop.

Note

The currently attached stage will be detached.

Parameters
  • id – USD stageId (can be retrieved from a stage - UsdUtils.StageCache.Get().GetId(stage).ToLongInt())

  • unregisterFromStageUpdate – If true, the vehicle extension will not listen to stage update events any longer.

Returns

True if stage was successfully attached.

compute_ackermann_steering_angle(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, steerAngle: float, axleSeparation: float, axleWidth: float) float

Compute the Ackermann steering angle for an outer wheel.

This helper method provides the Ackermann steering angle of the outer wheel for a given steer angle of the inner wheel (with respect to the turn direction). This helper method assumes the front axle has the steering wheels. The Ackermann corrected steer angle ensures that the perpendiculars to the front wheels’ longitudinal directions cross the extended vector of the rear axle at the same point.

Parameters
  • steerAngle – Steer angle (in radians) of the inner wheel (with respect to the turn direction). Value has to be in [-pi/2, pi/2].

  • axleSeparation – Distance between center of front axle and center of rear axle.

  • axleWidth – Distance between center-points of the two front wheels.

Returns

The Ackermann steer angle of the outer wheel in radians.

compute_sprung_masses(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, mass: float, upAxisIndex: int, positions: list) list

Compute sprung mass values for a given set of wheel positions.

Note

The method assumes that the provided positions enclose the origin. If this is not the case, the setup will be ill-conditioned, the computation will fail and an empty list is returned.

Parameters
  • mass – Total mass of the vehicle.

  • upAxisIndex – Index of the up-axis (0: x-axis, 1: y-axis, 2: z-axis).

  • positions – List of wheel positions relative to the center of mass. Position entries need to be provided as carb.Float3.

Returns

List with sprung mass value for each provided position entry. If an error occurs, the list will be empty.

compute_suspension_frame_transforms(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, path: str) bool

Compute the local space suspension frame transform for wheel attachments given the prim transforms and the center of mass information.

This helper method will set the USD suspensionFramePosition and suspensionFrameOrientation attributes of the PhysxVehicleWheelAttachmentAPI API schema such that the resulting world space transform will match the transform of the wheel attachment prim.

Note

Multiple requirements have to be fullfilled for this method to succeed. The vehicle prim and wheel attachment prims have to inherit from UsdGeomXformable. The vehicle prim needs the API schema MassAPI with the centerOfMass attribute defined.

Parameters

path – Wheel attachment or vehicle USD path. If the path is a prim with PhysxVehicleAPI applied, all the wheel attachments of the vehicle will be processed.

Returns

True on success, else False (error message will be sent to log).

compute_wheel_simulation_transforms(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, path: str) bool

Compute and set the simulation related transforms for wheel attachments given the prim transforms and the center of mass information.

DEPRECATED, please use compute_suspension_frame_transforms instead since compute_wheel_simulation_transforms operates on deprecated attributes.

This helper method will set the USD suspensionForceAppPointOffset, tireForceAppPointOffset and wheelCenterOfMassOffset attributes of the PhysxVehicleWheelAttachmentAPI API schema. All these attributes will be set to values such that the resulting world space transform will match the transform of the wheel attachment prim.

Note

Multiple requirements have to be fullfilled for this method to succeed. The vehicle prim and wheel attachment prims have to inherit from UsdGeomXformable. The vehicle prim needs the API schema MassAPI with the centerOfMass attribute defined.

Parameters

path – Wheel attachment or vehicle USD path. If the path is a prim with PhysxVehicleAPI applied, all the wheel attachments of the vehicle will be processed.

Returns

True on success, else False (error message will be sent to log).

detach_stage(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, registerToStageUpdate: bool) None

Detach from the USD stage. This will remove all vehicle related controller objects.

Parameters

registerToStageUpdate – If true, the detach operation will be followed by a re-attach and the vehicle extension will listen to stage update events again.

get_auto_reverse_enabled(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, path: str) bool

Return whether reverse gear can be automatically selected by holding the brake input.

Parameters

path – Vehicle USD path.

Returns

Auto reverse of the vehicle is enabled or disabled.

Return type

bool

get_drive_data(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, path: str) dict

Get the vehicle drive data of a vehicle.

DEPRECATED, please use get_vehicle_drive_state of the omni.physx extension instead.

Note

Should only be called after the simulation has been started.

Parameters

path – Vehicle USD path.

Returns

A dictionary with the following key, value pairs. An empty dictionary is returned for an invalid path, when the simulation is not running or when the vehicle does not have a Basic or Standard drive type. All values will contain valid data when the vehicle contains a PhysxVehicleDriveStandard drive type. Only the Input values will contain valid data when the vehicle contains a PhysxVehicleDriveBasic drive type, with the remaining values initialized to zero.

”analogInputAccel”, d,
”analogInputBrake”, d,
”analogInputHandbrake”, d,
”analogInputSteerLeft”, d,
”analogInputSteerRight”, d,
”gearUp”, i,
”gearDown”, i,
”useAutoGears”, i,
”currentGear”, i,
”targetGear”, i,
”engineRotationSpeed”, d,
”gearSwitchTime”, d,
”autoBoxSwitchTime”, d

get_input_enabled(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, path: str) bool

Return whether input control of the vehicle specified by the USD path is enabled or disabled.

Parameters

path – Vehicle USD path.

Returns

input control of the vehicle is enabled or disabled.

Return type

bool

get_mouse_enabled(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, path: str) bool

Return whether mouse control of the vehicle specified by the USD path is enabled or disabled.

Parameters

path – Vehicle USD path.

Returns

mouse control of the vehicle is enabled or disabled.

Return type

bool

get_steering_filter_time(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, path: str) float

Return the vehicle’s steering filter time which must 0.0 or greater. A setting of 0.0 turns the filter off. The higher the value the longer it takes for the steering to reach the desired angle.

Parameters

path – Vehicle USD path.

Returns

The filter time of the steering input filter in seconds (0.0 or greater).

Return type

float

get_steering_sensitivity(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, path: str) float

Return the vehicle’s steering sensitivity when using the gamepad. A setting of 1.0 generates a linear response between gamepad input and steering output. As the sensitivity is increased, the same gamepad input will generate a smaller steering output. However, regardless of the sensitivity, a full gamepad deflection will always generate a full steering deflection. steering deflection = sign(steering sensitivity) * power(gamepad input, steering sensitivity)

Parameters

path – Vehicle USD path.

Returns

The sensitivity of the vehicle steering as a function of the gamepad input.

Return type

float

get_wheel_data(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, path: str) dict

Get the vehicle wheel data of a vehicle.

DEPRECATED, please use get_wheel_state of the omni.physx extension instead.

Note

Should only be called after the simulation has been started.

Parameters

path – Wheel attachment USD path.

Returns

A dictionary with the following key, value pairs. An empty dictionary is returned for an invalid path.

”wheelRotationSpeed”, d,
”wheelRotationAngle”, d,

get_wheel_query_results(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, path: str) dict

Get the wheel query results of a vehicle.

DEPRECATED, please use get_wheel_state of the omni.physx extension instead.

Note

Should only be called after the simulation has been started.

Parameters

path – Wheel attachment USD path.

Returns

A dictionary with the following key, value pairs. An empty dictionary is returned for an invalid path.

”suspLineStart”, (d, d, d),
”suspLineDir”, (d, d, d),
”suspLineLength”, d,
”isInAir”, i,
”tireContactActorType”, i,
”tireContactActorName”, s,
”tireContactActorBoundsMinimum”, (d, d, d),
”tireContactActorBoundsMaximum”, (d, d, d),
”tireSurfaceMaterialDynamicFriction”, d,
”tireSurfaceMaterialStaticFriction”, d,
”tireSurfaceMaterialRestitution”, d,
”tireSurfaceMaterialFrictionCombineMode”, i,
”tireSurfaceMaterialRestitutionCombineMode”, i,
”tireSurfaceType”, i,
”tireContactPoint”, (d, d, d),
”tireContactNormal”, (d, d, d),
”tireFriction”, d,
”suspJounce”, d,
”suspSpringForce”, d,
”tireLongitudinalDir”, (d, d, d),
”tireLateralDir”, (d, d, d),
”longitudinalSlip”, d,
”lateralSlip”, d,
”steerAngle”, d,
”localPosePosition”, (d, d, d),
”localPoseQuaternion”, (d, d, d, d)

set_auto_reverse_enabled(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, path: str, autoReverseEnabled: bool) None

Enable auto reverse control of the vehicle specified by the USD path. Hold brake to reverse, hold the accelerator to drive.

Parameters
  • path – Vehicle USD path.

  • autoReverseEnabled – Enable/disable auto reverse.

set_input_enabled(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, path: str, inputEnabled: bool) None

Enable input control of the vehicle specified by the USD path. Input control of all other vehicles will be disabled.

Parameters
  • path – Vehicle USD path.

  • inputEnabled – Enable/disable device input.

set_mouse_enabled(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, path: str, mouseEnabled: bool) None

Enable mouse control of the vehicle specified by the USD path.

Parameters
  • path – Vehicle USD path.

  • mouseEnabled – Enable/disable mouse control.

set_steering_filter_time(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, path: str, steeringFilterTime: float) None

Set the vehicle’s steering filter time constant which must 0.0 or greater. A setting of 0.0 turns the filter off. The higher the value the longer it takes for the steering to reach the desired angle.

Parameters
  • path – Vehicle USD path.

  • steeringFilterTime – The filter time of the steering input filter in seconds (0.0 or greater).

set_steering_sensitivity(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, path: str, steeringSensitivity: float) None

Set the vehicle’s steering sensitivity when using the gamepad. Must be 1.0 or greater. A setting of 1.0 generates a linear response between gamepad input and steering output. As the sensitivity is increased, the same gamepad input will generate a smaller steering output. However, regardless of the sensitivity, a full gamepad deflection will always generate a full steering deflection. steering deflection = sign(steering sensitivity) * power(gamepad input, steering sensitivity)

Parameters
  • path – Vehicle USD path.

  • steeringSensitivity – The sensitivity of the vehicle steering as a function of the gamepad input (1.0 or greater).

set_to_rest_state(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, path: str) None

Set the internal dynamics state of a vehicle back to the rest state.

DEPRECATED, please use set_vehicle_to_rest_state of the omni.physx extension instead.

Note

Should only be called after the simulation has been started.

Parameters

path – Vehicle USD path.

set_wheel_rotation_angle(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, path: str, rotationAngle: float) None

Set the rotation angle about the rolling axis of a wheel.

DEPRECATED, please use set_wheel_rotation_angle of the omni.physx extension instead.

Note

Should only be called after the simulation has been started.

Parameters
  • path – Wheel attachment USD path.

  • rotationAngle – Rotation angle of the wheel in radians.

set_wheel_rotation_speed(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, path: str, rotationSpeed: float) None

Set the rotation speed about the rolling axis of a wheel.

DEPRECATED, please use set_wheel_rotation_speed of the omni.physx extension instead.

Note

Should only be called after the simulation has been started.

Parameters
  • path – Wheel attachment USD path.

  • rotationSpeed – Rotation speed of the wheel in radians per second.

update_controllers(self: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle, elapsedSeconds: float) None

Explicit update step for the vehicle controller logic (applying steer, brake, acceleration etc.).

Parameters

elapsedSeconds – Elapsed time in seconds.

omni.physxvehicle.bindings._physxVehicle.acquire_physx_vehicle_interface(plugin_name: str = None, library_path: str = None) omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle
omni.physxvehicle.bindings._physxVehicle.release_physx_vehicle_interface(arg0: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle) None
omni.physxvehicle.bindings._physxVehicle.release_physx_vehicle_interface_scripting(arg0: omni.physxvehicle.bindings._physxVehicle.IPhysxVehicle) None