Main Content

showdetails

Display overview of available kinematic groups

Since R2020b

Description

example

kinGroupDetails = showdetails(analyticalIK) displays an overview of all the kinematic group combinations available for the rigidBodyTree object associated with the analytical inverse kinematics (IK) solver. Each kinematic group contains body names for both a base and end effector that are valid for closed-form solutions to analytical IK.

To use a specific kinematic group for your object, click the corresponding Use this kinematic group link in the output table. This link updates the KinematicGroup and KinematicGroupType properties of the analyticalInverseKinematics object.

Examples

collapse all

Some manipulator robot models have large degrees-of-freedom (DOFs). To reach certain end-effector poses, however, only six DOFs are required. Use the analyticalInverseKinematics object, which supports six-DOF robots, to determine various valid kinematic groups for this large-DOF robot model. Use the showdetails object function to get information about the model.

Load Robot Model and Generate IK Solver

Load the robot model into the workspace, and create an analyicalInverseKinematics object. Use the showdetails object function to see the supported kinematic groups.

robot = loadrobot('willowgaragePR2','DataFormat','row');
aik = analyticalInverseKinematics(robot);
opts = showdetails(aik);
--------------------
Robot: (94 bodies)

Index                                          Base Name                                       EE Body Name     Type                    Actions
-----                                          ---------                                       ------------     ----                    -------
    1                                l_shoulder_pan_link                                  l_wrist_roll_link   RSSSSS   Use this kinematic group
    2                                r_shoulder_pan_link                                  r_wrist_roll_link   RSSSSS   Use this kinematic group
    3                                l_shoulder_pan_link                                l_gripper_palm_link   RSSSSS   Use this kinematic group
    4                                r_shoulder_pan_link                                r_gripper_palm_link   RSSSSS   Use this kinematic group
    5                                l_shoulder_pan_link                                l_gripper_led_frame   RSSSSS   Use this kinematic group
    6                                l_shoulder_pan_link                 l_gripper_motor_accelerometer_link   RSSSSS   Use this kinematic group
    7                                l_shoulder_pan_link                               l_gripper_tool_frame   RSSSSS   Use this kinematic group
    8                                r_shoulder_pan_link                                r_gripper_led_frame   RSSSSS   Use this kinematic group
    9                                r_shoulder_pan_link                 r_gripper_motor_accelerometer_link   RSSSSS   Use this kinematic group
   10                                r_shoulder_pan_link                               r_gripper_tool_frame   RSSSSS   Use this kinematic group

Select a group programmatically using the output of the showdetails object function, opts. The selected group uses the left shoulder as the base with the left wrist as the end effector.

aik.KinematicGroup = opts(1).KinematicGroup;
disp(aik.KinematicGroup)
               BaseName: 'l_shoulder_pan_link'
    EndEffectorBodyName: 'l_wrist_roll_link'

Generate the IK function for the selected group.

generateIKFunction(aik,'willowRobotIK');

Solve Analytical IK

Define a target end-effector pose using a randomly-generated configuration.

rng(0);
expConfig = randomConfiguration(robot);

eeBodyName = aik.KinematicGroup.EndEffectorBodyName;
baseName = aik.KinematicGroup.BaseName;
expEEPose = getTransform(robot,expConfig,eeBodyName,baseName);

Solve for all robot configurations that achieve the defined end-effector pose using the generated IK function. To ignore joint limits, specify false as the second input argument.

ikConfig = willowRobotIK(expEEPose,false);

To display the target end-effector pose in the world frame, get the transformation from the base of the robot model, rather than the base of the kinematic group. Display all of the generated IK solutions by specifying the indices for your kinematic group IK solution in the configuration vector used with the show function.

eeWorldPose = getTransform(robot,expConfig,eeBodyName);

generatedConfig = repmat(expConfig, size(ikConfig,1), 1);
generatedConfig(:,aik.KinematicGroupConfigIdx) = ikConfig;

for i = 1:size(ikConfig,1)
    figure;
    ax = show(robot,generatedConfig(i,:));
    hold all;
    plotTransforms(tform2trvec(eeWorldPose),tform2quat(eeWorldPose),'Parent',ax);
    title(['Solution ' num2str(i)]);
end

Input Arguments

collapse all

Analytical inverse kinematics solver, specified as an analyticalInverseKinematics object.

Output Arguments

collapse all

Kinematic group classification details, returned as a structure with these fields:

  • KinematicGroup — A structure that contains the base and end-effector body names of the kinematic group in the fields BaseName and EndEffectorBodyName, respectively.

  • Type — A kinematic group classification type with the same format as that KinematicGroupType property of the analyticalInverseKinematics object.

  • IsIntersectionAxesMidpoint — An n-element vector indicating whether each specific joint axis intersects with the preceding or following non-fixed joint. n is the number of non-fixed joints in the kinematic group.

  • MidpointAxisIntersections — A 2-by-3-by-n array that stores the joint intersection points where each element of the third dimension corresponds to a single joint. For each channel of n, the first row is the intersection point from the preceding joint to the joint represented by that channel. The second row is the intersection point from the joint to the following joint. The array gives intersection points as [x y z] coordinates relative to the base.

Version History

Introduced in R2020b