Skip to content

Add USD scene tools #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

inbarajaldrin
Copy link

This commit introduces 5 new utility functions for interacting with USD scenes in Isaac Sim:

list_prims() — enumerate all prims in the stage
open_usd() — load a USD file as the main stage
import_usd() — import USD files at a custom pose
get_object_info() — retrieve detailed transform + type move_prim() — move prims using various rotation formats

This commit introduces 5 new utility functions for interacting with USD scenes in Isaac Sim:

list_prims() — enumerate all prims in the stage
open_usd() — load a USD file as the main stage
import_usd() — import USD files at a custom pose
get_object_info() — retrieve detailed transform + type
move_prim() — move prims using various rotation formats
@@ -302,6 +302,11 @@ def _execute_command_internal(self, command):
"generate_3d_from_text_or_image": self.generate_3d_from_text_or_image,
"transform": self.transform,
"search_3d_usd_by_text": self.search_3d_usd_by_text,
"list_prims": self.list_prims,
"open_usd": self.open_usd,
"import_usd": self.import_usd,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"traceback": traceback.format_exc()
}

def import_usd(self, usd_path: str, prim_path: str = None, position: List[float] = None, orientation: List[float] = None, orientation_format: str = "degrees") -> Dict[str, Any]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return f"Error listing prims: {str(e)}"

@mcp.tool()
def open_usd(usd_path: str) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicated to load_usd() and consider to reuse load_usd instead.

"traceback": traceback.format_exc()
}

def move_prim(self, prim_path: str, position: List[float] = None, orientation: List[float] = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reuse transform() method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants