Hi, In Isaac Sim 2022.2.0, I fount some example about scene data replay.
for example, you can check the script in Isaac Example/Manipulation/Replay Follow Target
.
However, It seems like It save the data about rigid cube’s global pose and robot state.
To express deformation of the deformable object, I think I need to save object’s local pose, too.
here’s my code.
deform_path = “/World/Cube”
prim = get_current_stage().GetPrimAtPath(deform_path)
deformable_local = PhysxSchema.PhysxDeformableBodyAPI(prim)
deformable_global = XFormPrimView(prim_paths_expr=deform_path, name=“Deformable_Cube”)local_collision_point = np.array(deformable_local.GetCollisionPointsAttr().Get())
for i in range(3):
local_collision_point[:,i] = local_collision_point[:,i]global_collision_point = deformable_global.get_world_poses()[0]
final = (local_collision_point + global_collision_point) # N X 3 Numpy Array
How can I save final
as replay trajectory and reload it?
This is a code which I found in the example only for the rigid body.
def _on_replay_scene_step(step_size):
if world.current_time_step_index < data_logger.get_num_of_data_frames():
target_name1 = task_params["target_name1"]["value"]
data_frame = data_logger.get_data_frame(data_frame_index=world.current_time_step_index)
articulation_controller.apply_action(
ArticulationAction(joint_positions=data_frame.data["applied_joint_positions"])
)
# Sets the world position of the goal cube to the same recoded position
world.scene.get_object(target_name1).set_world_pose(
position=np.array(data_frame.data["target_position"])
)
return
In other word, Is there a way to move deformable object collision mesh by using saved data?
Or please share some information if there is API that about data replay for the deformable object.
Thanks!