====== Inverse Kinematics ====== Inverse Kinematics takes a goal in Cartesian coordinate space and returns a list of joint positions which result, if applied, in the end effector reaching the given goal. In PyCRAM we use the KDL inverse kinematics solver to compute the joint positions for a respective chain of joints. ===== IK in PyCRAM ===== In PyCRAM everything related to inverse kinematics is located in the ik.py. Mainly this is the 'request_ik' method which sends a service call over ROS to KDL and returns the resulting list of joint positions if there was a solution. If no solution could be found a 'IKError' will be raised which contains the position. ==== request_ik ==== The request ik method takes 5 parameter which can be seen along with a description in the table below: ^ Parameter ^ Description ^ Type ^ | root_link | The first link of the chain of joints for which a solution should be found | String | | tip_link | The last link of the chain of joints, this parameter together with root_link defines the chain of joints for which a solution should be found | String | | target_pose_and_rotation | The position and orientation of the end effector that should be achieved by KDL. | List of 2 lists representing pose and rotation. | | robot_object | The Object instance of the robot for which a solution should be found. | BulletWorld.Object | | joints | A list of the joint names in the chain defined by root_link and tip_link. | list | **Important** The target_pose_and_rotation has to be in the coordinate frame of the root_link. ==== _make_request_msg ==== This is an method for internal use, it creates a ROS message of type PositionIKRequest. This method takes the same parameter as request_ik which can be seen above. ==== _get_position_for_all_joints ==== This method is for internal use only, it takes a robot object and returns a list of two list which contains the names off all joints and the poses of these joints. ^ Parameter ^ Description ^ Type ^ | robot | The object representing a loaded robot | BulletWorld.Object | ==== _get_positions_for_joints ==== This method is similar to _get_positions_for_all_joints but this method returns a list of joint positions for a given list of joint names. ^ Parameter ^ Description ^ Type ^ | robot | The object representing a robot for which the joint positions should be found. | BulletWorld.Object| | joints | A list of joint names for which the positions should be found. | list|