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

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_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 (see set_steering_filter_time() for details).

Parameters:

path – Vehicle USD path.

Returns:

The filter time of the steering input filter in seconds.

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 (see set_steering_sensitivity() for details).

Parameters:

path – Vehicle USD path.

Returns:

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

Return type:

float

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

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#