Skip to content

Latest commit

 

History

History
64 lines (36 loc) · 1.93 KB

vehicle_dynamic.md

File metadata and controls

64 lines (36 loc) · 1.93 KB

VehicleDynamic

from tdw.vehicle.vehicle_dynamic import VehicleDynamic

Dynamic data for a vehicle that can change per communicate() call (such as the position of the vehicle).


Fields

  • rigidbody The Rigidbody (velocity and angular velocity) of the vehicle.

  • transform The Transform of the agent.

  • images The images rendered by the agent as dictionary. Key = the name of the pass. Value = the pass as a numpy array.

  • projection_matrix The camera projection matrix of the agent's camera as a numpy array.

  • camera_matrix The camera matrix of the agent's camera as a numpy array.

  • got_images If True, we got images from the output data.

  • avatar_id The ID of the avatar.


Functions

__init__

VehicleDynamic()

The Rigidbody (velocity and angular velocity) of the vehicle.

save_images

self.save_images(output_directory)

Save the ID pass (segmentation colors) and the depth pass to disk. Images will be named: [frame_number]_[pass_name].[extension] For example, the depth pass on the first frame will be named: 00000000_depth.png

The img pass is either a .jpg. The id and depth passes are .png files.

Parameter Type Default Description
output_directory PATH The directory that the images will be saved to.

get_pil_image

self.get_pil_image()

self.get_pil_image(pass_mask="img")

Convert raw image data to a PIL image. Use this function to read and analyze an image in memory. Do NOT use this function to save image data to disk; save_image is much faster.

Parameter Type Default Description
pass_mask str "img" The pass mask. Options: "img", "id", "depth".

Returns: A PIL image.