Skip to content

[Question] run_diff_ik.py can't work without reset the arm to the default pose #2529

Closed

Description

@nolann030628

Question

I want to write an IK function basd on the tutorial, and I don't want the pos to go back to the default pose so I comment the robot.write_joint_state_to_sim(joint_pos, joint_vel), but the arm seems to can not compute the right joint_pos_des.

 if count % 150 == 0:
            # reset time
            count = 0
        # reset joint state
            joint_pos = robot.data.default_joint_pos.clone()
            joint_vel = robot.data.default_joint_vel.clone()
            # robot.write_joint_state_to_sim(joint_pos, joint_vel)
            robot.reset()

the code I commented is show above, I want to know how to solve this and use this ik controller in my custom env. I would be more than appreciated for any useful suggestions!
Image

Activity

  1. RandomOakForest commented on May 20, 2025

    @RandomOakForest
    Collaborator

    Thanks for posting this. What would be then the pose you expect the robot arm to be at? It seems write_joint_state_to_sim should be used. See the example in this tutorial. I will move this post to a discussion for the team to follow up.

  2. locked and limited conversation to collaborators on May 20, 2025
  3. converted this issue into a discussion #2531 on May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions