Unverified Commit 33b49731 authored by Wenguo Hou's avatar Wenguo Hou Committed by GitHub

Resets joint position/velocity targets in reset_scene_to_default() (#2692)

Fix bug of reset joint initial state of articulation in event function
`reset_scene_to_default` ref to:
https://github.com/isaac-sim/IsaacLab/issues/2663, where the targets
were not previously reset together with the joint positions.

# Description

ref: https://github.com/isaac-sim/IsaacLab/issues/2663Signed-off-by: 's avatarWenguo Hou <wghou09@bjtu.edu.cn>
Co-authored-by: 's avatarKelly Guo <kellyg@nvidia.com>
parent 0b377f62
...@@ -1156,6 +1156,8 @@ def reset_scene_to_default(env: ManagerBasedEnv, env_ids: torch.Tensor): ...@@ -1156,6 +1156,8 @@ def reset_scene_to_default(env: ManagerBasedEnv, env_ids: torch.Tensor):
default_joint_pos = articulation_asset.data.default_joint_pos[env_ids].clone() default_joint_pos = articulation_asset.data.default_joint_pos[env_ids].clone()
default_joint_vel = articulation_asset.data.default_joint_vel[env_ids].clone() default_joint_vel = articulation_asset.data.default_joint_vel[env_ids].clone()
# set into the physics simulation # set into the physics simulation
articulation_asset.set_joint_position_target(default_joint_pos, env_ids=env_ids)
articulation_asset.set_joint_velocity_target(default_joint_pos, env_ids=env_ids)
articulation_asset.write_joint_state_to_sim(default_joint_pos, default_joint_vel, env_ids=env_ids) articulation_asset.write_joint_state_to_sim(default_joint_pos, default_joint_vel, env_ids=env_ids)
# deformable objects # deformable objects
for deformable_object in env.scene.deformable_objects.values(): for deformable_object in env.scene.deformable_objects.values():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment