Skip to content

Commit

Permalink
Fix robot joints in IK
Browse files Browse the repository at this point in the history
  • Loading branch information
yijiangh committed Apr 28, 2022
1 parent abb4c56 commit 8dccbff
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def inverse_kinematics(self, robot, frame_WCF, start_configuration=None, group=N
pb_custom_limits = {joint_from_name(robot_uid, joint_name) : lims \
for joint_name, lims in joint_custom_limits.items()}

# ! no need to do robot_base_link transformation or flaneg_from_tool transformation here
# since the robot is cloned in place and pybullet handles those. We can directly feed in world_pose here
target_pose = pose_from_frame(frame_WCF)
with WorldSaver():
if start_configuration is not None:
Expand Down Expand Up @@ -125,6 +127,6 @@ def _compute_ik(self, robot_uid, ik_joints, tool_link, target_pose, max_iteratio
remove_body(sub_robot)
return []
remove_body(sub_robot)
conf = [kinematic_conf[i] for i, jt in enumerate(selected_movable_joints) if jt in ik_joints]
conf = [kinematic_conf[i] for i, jt in enumerate(get_movable_joints(robot_uid)) if jt in ik_joints]
# TODO in RFL case, the base_link will give us 17 joint, needs some pruning according to the ik_joints
return [conf]

0 comments on commit 8dccbff

Please sign in to comment.