joevento / Nvidia-Isaac-Sim-Tree-Generator

Nvidia isaac sim extension which can be used to place infinite amount of trees which are specified in an .txt file.
1 stars 0 forks source link

Nvidia Isaac Sim Tree Generator

This script is designed to generate a forest of trees in an NVIDIA Isaac Sim simulation based on information provided in a .txt file. Each line in the .txt file represents the coordinates, type, and scale of a tree to be placed in the simulation.

Usage

  1. Installation: Make sure you have NVIDIA Isaac Sim installed and set up.

  2. Download Tree Models: Download tree models in USD format and specify their paths in the script. I sadly cannot share the trees I used when developing this. So you will have to find or model them yourself. (Birch_usd_path, Spruce_usd_path, Pine_usd_path, Maple_usd_path).

  3. Prepare Tree Coordinates File: Create a .txt file containing tree coordinates, type, and scale information. Each line in the file should be formatted as follows:

    x_coordinate; y_coordinate; z_coordinate; tree_type; scale_x; scale_y; scale_z
  4. Run the Script: Run the script and specify the path to the tree coordinates file. Use the provided interface to generate or delete trees in the simulation.

Script Details

generate_trees(path_to_coords)

This function reads tree coordinates from the specified file and generates trees in the simulation based on the provided information.

delete_forest(stage: Stage)

This function removes all trees generated by the script from the simulation.

convert_rotation(roll, pitch, yaw)

Converts rotation angles from degrees to quaternions.

check_raycast(stage, path_to_object)

Projects a raycast from the tree's origin to find the ground level and adjusts the tree's position accordingly.

Interface

The script provides a simple user interface with the following components:

Notes

Feel free to customize the script and interface according to your requirements!