code: def joint_positions_for_eef_command(self, dpos, rotation):
          
  
          self.ik_robot_target_pos += dpos * self.user_sensitivity
  
          # this rotation accounts for rotating the end effector by 90 degrees
          # from its rest configuration. The corresponding line in most demo
          # scripts is:
          #   `env.set_robot_joint_positions([0, -1.18, 0.00, 2.18, 0.00, 0.57, 1.5708])`
          rotation = rotation.dot(
              T.rotation_matrix(angle=-np.pi / 2, direction=[0., 0., 1.], point=None)[
                  :3, :3
              ]
          )
  
          self.ik_robot_target_orn = T.mat2quat(rotation)
  
          # convert from target pose in base frame to target pose in bullet world frame
          world_targets = self.bullet_base_pose_to_world_pose(
              (self.ik_robot_target_pos, self.ik_robot_target_orn)
          )
  
          rest_poses = [0, -1.18, 0.00, 2.18, 0.00, 0.57, 3.3161]
  
          for bullet_i in range(100):
              arm_joint_pos = self.inverse_kinematics(
                  world_targets[0], world_targets[1], rest_poses=rest_poses
              )
              self.sync_ik_robot(arm_joint_pos, sync_last=True)
  
          return arm_joint_pos
docs: This function runs inverse kinematics to back out target joint positions
          from the provided end effector command.
  
          Same arguments as @get_control.
  
          Returns:
              A list of size @num_joints corresponding to the target joint angles.