Unexpected initial pose loaded in python standalone code

I’m trying to use python standalone code to simulate my customized robot. However, the initial pose of the robot is very weird and it’s really hard for me to correct it. (see below)

However, if I start my Isaac Sim from omniverse launch, and open the .usd file, everything looks correct. (see below)

my code is very simple:

import os
from omni.isaac.kit import SimulationApp

simulation_app = SimulationApp({“headless”: False})

from omni.isaac.core import World
from omni.isaac.core.utils.stage import add_reference_to_stage, get_stage_units
from omni.isaac.core.articulations import ArticulationView
from omni.isaac.core.utils import rotations
import numpy as np

curr_path = os.path.abspath(os.path.dirname(file))
asset_path = curr_path + “/asset/WheeledTennisRobot/tennis_robot.usd” # you may change this path to the .usd file

my_world = World(stage_units_in_meters=1.0)

add_reference_to_stage(usd_path=asset_path, prim_path=“/World/Robot”)

initial_orientation = np.array([rotations.euler_angles_to_quat(np.array([0,0,0]))])
articulated = ArticulationView(prim_paths_expr=“/World/Robot/tennis_robot/tennis_robot”,
positions = np.array([[0,0,0.3]]),
reset_xform_properties=False,
orientations=initial_orientation)

my_world.scene.add(articulated)
my_world.scene.add_default_ground_plane()
my_world.reset()

iter = 0
while simulation_app.is_running():

if iter < 10: # iter < 10 to show and stop at the intial pose
iter += 1
my_world.step(render=True)

simulation_app.close()

and my usd file can be downloaded here: tennis_robot.usd - Google Drive

I’m wondering if there is any way to load my robot with initial pose correctly?

Hi @xiaoqingyu0113 - Someone from our team will review and respond to your question.

Unfortunately the asset you shared only contains the robot base file - the references it’s supposed to load are missing

Can you send the entire folder in WheeledTennisRobot_06?

With that said - I can also notice that when you are importing, you are adding a second level reference - you can probably make a leaner asset if you import tenis_robot_edit.usd directly.

Hello, please find the WheeledTennisRobot_06 in this link: WheeledTennisRobot_06.zip - Google Drive

I also realize that I saved my .usd file in another folder, why all the parts are saved in ~/Documents? I don’t even know this folder before you point it out.

https://docs.omniverse.nvidia.com/app_create/prod_extensions/ext_onshape.html#preferences

It’s a default setting on the onshape importer. Please refer to the documentation above.

Thanks for sharing the entire model. I’ll check your model when i get back to the PC

Hello! I’ve had some time to work on your asset - here’s the breakdown of what I had to do to get it working:

  1. Open tenis_robot_edit.usd
    a. Remove Articulation Root from /World/tennis_robot
    b. Add Articulation Root to /World/tennis_robot/chair_base
  2. in your script, change the articulationView path to the chair_base: prim_paths_expr='/World/Robot/tennis_robot/tennis_robot/chair_base'

The reason for that is a known issue where the Articticulation Root gets automatically picked from the robot hierarchy when the Root is applied to the top level. If we manually pick the root to the desired robot link, it will use that as a base. In your asset’s case, it was picking link2, which contains a transform to the root already, so when you reset that transform to zero, it causes the entire robot to flip. That’s what was causing your robot to import rotated. Changing the base to chair_base resolves that issue, since it doesn’t contain a transform offset from the origin.

We are working to resolve that issue in the articulation Root so we can make it more robust.

Thank you a lot! This resolves my problem!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.