Skip to content
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

Inconsistent interface of import_robot in URDFParseAndImportFile #8

Open
Maverobot opened this issue Aug 22, 2024 · 0 comments
Open

Comments

@Maverobot
Copy link

Maverobot commented Aug 22, 2024

I could not get the command URDFParseAndImportFile working. I tried with

        result, prim_path = omni.kit.commands.execute(
            "URDFParseAndImportFile",
            urdf_path=urdf_path,
            dest_path=dest_path,
            import_config=import_config,
        )

After this line, the result became True and prim_path became /my_robot_name. However, the robot has NOT been added to the stage in the omniverse app.

After checking the source code, I found something quite strange.

In

def do(self) -> str:
if self._dest_path:
self._dest_path = self._dest_path.replace(
"\\", "/"
) # Omni client works with both slashes cross platform, making it standard to make it easier later on
result = omni.client.read_file(self._dest_path)
if result[0] != Result.OK:
stage = Usd.Stage.CreateNew(self._dest_path)
stage.Save()
return self._urdf_interface.import_robot(
self._root_path,
self._filename,
self._urdf_robot,
self._import_config,
self._dest_path,
self._get_articulation_root,
)
, the 5th argument of import_robot is "path to USD file" but 5th argument should be stage according to
.def("import_robot", wrapInterfaceFunction(&Urdf::importRobot), py::arg("assetRoot"), py::arg("assetName"),
py::arg("robot"), py::arg("importConfig"), py::arg("stage") = std::string(""),
py::arg("getArticulationRoot") = false,
R"pbdoc(
Importing the robot, from the already parsed URDF file.
Args:
arg0 (:obj:`str`): The absolute path to where the urdf file is
arg1 (:obj:`str`): The name of the urdf file
arg2 (:obj:`omni.importer.urdf._urdf.UrdfRobot`): The parsed URDF file, the output from :obj:`parse_urdf`
arg3 (:obj:`omni.importer.urdf._urdf.ImportConfig`): Import configuration parameters
arg4 (:obj:`str`): optional: path to stage to use for importing. leaving it empty will import on open stage. If the open stage is a new stage, textures will not load.
Returns:
:obj:`str`: Path to the robot on the USD stage.
, where the docstring also seems to be outdated.

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

No branches or pull requests

1 participant