Replies: 3 comments
-
Thank you for posting this. Here's a summary to consider. Core IssueThe validation error occurs because:
Possible Solution Approach1. Modify the USD File (Recommended) from pxr import UsdPhysics, Gf
stage = omni.usd.get_context().get_stage()
hand_path = "/World/envs/env_0/Hand/inspire_hand_r"
# Set valid default positions in USD
thumb_joints = ["R_thumb_MCP_joint1", "R_thumb_MCP_joint2"]
for joint in thumb_joints:
joint_prim = stage.GetPrimAtPath(f"{hand_path}/{joint}")
attr = joint_prim.GetAttribute("state:angular:position")
attr.Set(0.3 if "joint1" in joint else 1.4) # Valid defaults 2. Programmatic Override (Alternative) def override_joint_defaults():
stage = omni.usd.get_context().get_stage()
for i in range(args_cli.num_envs):
for joint_name in ["R_thumb_MCP_joint1", "R_thumb_MCP_joint2"]:
prim_path = f"/World/envs/env_{i}/Hand/inspire_hand_r/{joint_name}"
joint_prim = stage.GetPrimAtPath(prim_path)
if joint_prim.IsValid():
attr = joint_prim.GetAttribute("state:angular:position")
attr.Set(0.3 if "joint1" in joint_name else 1.4)
# Call BEFORE sim.reset()
override_joint_defaults() Fixed Joint Setup Correctiondef fixed_joint():
stage = omni.usd.get_context().get_stage()
for i in range(args_cli.num_envs):
joint_path = f"/World/envs/env_{i}/Hand/inspire_hand_r/root_joint"
joint_prim = stage.GetPrimAtPath(joint_path)
# Create fixed joint properties
fixed_joint = UsdPhysics.FixedJoint.Define(stage, joint_path)
fixed_joint.GetBody0Rel().SetTargets([f"/World/envs/env_{i}/Arm/flange"])
fixed_joint.GetLocalPos0Attr().Set(Gf.Vec3f(0,0,0))
fixed_joint.GetLocalRot0Attr().Set(Gf.Quatf(1,0,0,0))
# Apply articulation root to hand ONLY
root_api = UsdPhysics.ArticulationRootAPI.Apply(
stage.GetPrimAtPath(f"/World/envs/env_{i}/Hand")
) Key Fixes
# Check flange exists before attaching
flange_prim = stage.GetPrimAtPath("/World/envs/env_0/Arm/flange")
if not flange_prim.IsValid():
print("ERROR: Arm flange not found!") |
Beta Was this translation helpful? Give feedback.
-
Thank you for the reply.
I launched issac lab, loaded the hand and then executed your code.
Sorry if I was not clear enough earlier but If it helps, here is the snippet of .usd file of inspire_hand
|
Beta Was this translation helpful? Give feedback.
-
Thank you for following up. I will move this post to our Discussions for the team to follow up. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
I am trying to spawn UR10e arm and Inspire hand in the interactive scene and then create joint between them because i want to keep separate articulation for arm and hand.
There is a problem in default joint values of Hand 'R_thumb_MCP_joint1' and 'R_thumb_MCP_joint2'. default value of these joints are 0.0, which are out of lower limit of these joints.
So, i am doing
Works and spawn arm and hand, but when i try to add joint between them
`def fixed_joint():
stage = omni.usd.get_context().get_stage()
for i in range(args_cli.num_envs):
joint_path = f"/World/envs/env_{i}/Hand/inspire_hand_r/root_joint"
joint_prim = stage.GetPrimAtPath(joint_path)
print(f'Joint Prim : {joint_prim}')
# Verify that joint exists and its a PhysicsFixedJoint
if not joint_prim or not UsdPhysics.FixedJoint(joint_prim).GetPrim().IsValid():
raise ValueError(f'Joint at {joint_path} does not exist or is nor a PhysicsFixedJoints')
`
It no longer take the given joint_pos. If i am printing hand articulation then it prints (check joint_pos values):
ArticulationCfg(class_type=<class 'isaaclab.assets.articulation.articulation.Articulation'>, prim_path='/World/envs/env_./Hand', spawn=UsdFileCfg(func=<function spawn_from_usd at 0x7707dc1b9bd0>, visible=True, semantic_tags=None, copy_from_source=True, mass_props=None, deformable_props=None, rigid_props=RigidBodyPropertiesCfg(rigid_body_enabled=None, kinematic_enabled=None, disable_gravity=True, linear_damping=None, angular_damping=None, max_linear_velocity=None, max_angular_velocity=None, max_depenetration_velocity=5.0, max_contact_impulse=None, enable_gyroscopic_forces=None, retain_accelerations=None, solver_position_iteration_count=None, solver_velocity_iteration_count=None, sleep_threshold=None, stabilization_threshold=None), collision_props=None, activate_contact_sensors=False, scale=None, articulation_props=None, fixed_tendons_props=None, joint_drive_props=None, visual_material_path='material', visual_material=None, usd_path='/home/admin/Snap_Assembly/CAD_Models/USD_Models/Hand_flattened_joint_modified.usd', variants=None), init_state=ArticulationCfg.InitialStateCfg(pos=(1, 1, 1), rot=(1.0, 0.0, 0.0, 0.0), lin_vel=(0.0, 0.0, 0.0), ang_vel=(0.0, 0.0, 0.0), joint_pos={'R_thumb_MCP_joint1': 0.3, 'R_thumb_MCP_joint2': 1.4}, joint_vel={'.': 0.0}), collision_group=0, debug_vis=False, articulation_root_prim_path=None, soft_joint_pos_limit_factor=1.0, actuators={'hand': ImplicitActuatorCfg(class_type=<class 'isaaclab.actuators.actuator_pd.ImplicitActuator'>, joint_names_expr=['.*'], effort_limit=0.5, velocity_limit=100.0, effort_limit_sim=None, velocity_limit_sim=None, stiffness=0.6, damping=0.001, armature=None, friction=0.01)})
Beta Was this translation helpful? Give feedback.
All reactions