Fixing formatting for USD scripts

This commit is contained in:
Abhishek Joshi
2024-07-04 16:25:44 -05:00
parent fcb247e35b
commit e734527e7b
6 changed files with 18 additions and 42 deletions
+8 -10
View File
@@ -1,14 +1,12 @@
import argparse
from tqdm import tqdm
from pathlib import Path
import mujoco
# from mujoco.usd import exporter
import exporter
from mujoco.usd import exporter
def generate_usd_trajectory(args):
"""Generates a USD file given the user arguments"""
# load a model to mujoco
model_path = args.model_path
m = mujoco.MjModel.from_xml_path(model_path)
@@ -19,7 +17,7 @@ def generate_usd_trajectory(args):
output_directory_name=Path(args.model_path).stem,
output_directory_root=args.output_directory_root,
camera_names=args.camera_names)
# step through the simulation for the given duration of time
while d.time < args.duration:
mujoco.mj_step(m, d)
@@ -32,7 +30,7 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--model_path',
parser.add_argument('--model_path',
type=str,
required=True,
help='path to mjcf xml model')
@@ -47,20 +45,20 @@ if __name__ == "__main__":
default=60,
help='frame rate of the generated video')
parser.add_argument('--output_directory_root',
parser.add_argument('--output_directory_root',
type=str,
default="../usd_trajectories/",
help='location where to create usd files')
parser.add_argument('--camera_names',
parser.add_argument('--camera_names',
type=str,
nargs='+',
help='cameras to include in usd')
parser.add_argument('--export_extension',
parser.add_argument('--export_extension',
type=str,
default="usd",
help='extension of exported file (can be usd, usda, or usdc)')
help='extension of exported file (usd, usda, usdc)')
args = parser.parse_args()
generate_usd_trajectory(args)