RussTedrake / manipulation

Course notes for MIT manipulation class
BSD 3-Clause "New" or "Revised" License
411 stars 121 forks source link

forward_kinematics.ipynb showing inconsistent gripper positions and rpy #220

Closed shaoyuancc closed 1 year ago

shaoyuancc commented 1 year ago

Re: https://github.com/RussTedrake/manipulation/blob/982197922235e9163bf5594ca87817064f58d5f8/pick/forward_kinematics.ipynb

I'm not sure if this is an actual issue or I'm doing something wrong but I noticed that the gripper positions and rpy values printed out are not consistent for the same values of iiwa joint angles.

Steps to reproduce:

  1. Run notebook
  2. Set iiwa_joint_1 by typing 0 into text box and pressing enter
  3. Note gripper position and gripper roll-pitch-yaw
  4. Set iiwa_joint_1 by typing 1 into text box and pressing enter
  5. Note gripper position and gripper roll-pitch-yaw
  6. Set iiwa_joint_1 by typing 0 into text box and pressing enter
  7. Note gripper position and gripper roll-pitch-yaw

Expected behavior: every time the iiwa joint angles are the same, the gripper position and rpy should show the same values.

Example output currently:

first set to 0 gripper position (m): [0.00 -0.47 0.68] gripper roll-pitch-yaw (rad):[-1.81 -0.00 0.00] set to 1 gripper position (m): [0.47 0.00 0.68] gripper roll-pitch-yaw (rad):[-1.81 -0.00 1.57] set to 0 gripper position (m): [0.25 0.39 0.68] gripper roll-pitch-yaw (rad):[-1.81 -0.00 2.57] set to -1 gripper position (m): [0.47 0.00 0.68] gripper roll-pitch-yaw (rad):[-1.81 -0.00 1.57] set to 0 gripper position (m): [0.25 -0.39 0.68] gripper roll-pitch-yaw (rad):[-1.81 -0.00 0.57] set to 1 gripper position (m): [0.47 0.00 0.68] gripper roll-pitch-yaw (rad):[-1.81 -0.00 1.57] set to 0.1 gripper position (m): [0.47 0.00 0.68] gripper roll-pitch-yaw (rad):[-1.81 -0.00 1.57] set to 1.56 gripper position (m): [0.46 0.05 0.68] gripper roll-pitch-yaw (rad):[-1.81 -0.00 1.67] set to 0 gripper position (m): [0.01 0.47 0.68] gripper roll-pitch-yaw (rad):[-1.81 -0.00 3.13]

RussTedrake commented 1 year ago

Good catch. It seems that my clear_output logic was causing the output to be printed to the screen delayed by one slider event. i'll push the fix.