Main Content

showWorkspaceAnalysis

Plot robot workspace encoded by manipulability index of robot end effector

Since R2024b

    Description

    ax = showWorkspaceAnalysis(workspace,manipIndex) plots a manipulability-encoded robot workspace using end-effector workspace coordinates and the corresponding manipulability index values.

    ax = showWorkspaceAnalysis(___,Name=Value) specifies options using one or more name-value arguments in addition to the input arguments from the previous syntax. For example, Parent=ax2 specifies the parent axes on which to plot the workspace analysis.

    example

    Examples

    collapse all

    Load the robot model for the Universal Robots UR5e manipulator, and specify the last body in the robot model "tool0" as the end effector.

    robot = loadrobot("universalUR5e",DataFormat="row");
    show(robot);
    ee = "tool0";

    Generate the workspace for the robot in an obstacle-free environment, using "tool0" as the end effector of the robot model, and ignoring self-collisions in the robot model during collision checking.

    rng default
    [workspace,configs] = generateRobotWorkspace(robot,{},ee,IgnoreSelfCollision="on");

    Calculate the manipulability, using Yoshikawa index, for each configuration in the workspace.

    mIdx = manipulabilityIndex(robot,configs,ee);

    Show the robot, and then plot the workspace analysis. Voxelize the workspace to make it easier to see the high-manipulability areas.

    hold on
    showWorkspaceAnalysis(workspace,mIdx,Voxelize=true)
    axis auto
    title("Voxelized Manipulability-Encoded Workspace")
    hold off

    Figure contains an axes object. The axes object with title Voxelized Manipulability-Encoded Workspace, xlabel X, ylabel Y contains 29 objects of type patch, line, scatter. These objects represent base_link, base, base_link_inertia, shoulder_link, upper_arm_link, forearm_link, wrist_1_link, wrist_2_link, wrist_3_link, flange, tool0, base_link_inertia_mesh, shoulder_link_mesh, upper_arm_link_mesh, forearm_link_mesh, wrist_1_link_mesh, wrist_2_link_mesh, wrist_3_link_mesh.

    Get the configurations with a manipulability index greater than 0.1.

    highMIdxConfigs = configs(mIdx>0.1,:)
    highMIdxConfigs = 105×6
    
        3.9154    0.4125   -0.9379    5.5167    4.7242    0.6303
        1.0622    4.1458   -1.3166   -1.2245    4.5497    1.4419
       -5.7293    2.3464    1.4688   -0.7895   -1.5100    6.0276
        3.2651   -2.6273   -1.3984   -6.2064   -1.5744   -0.7925
       -2.4593   -2.6281   -1.6178    5.4875    4.5263   -1.2915
       -2.7437   -0.2400    1.1615   -3.6661    1.3592   -2.1843
        1.2724   -2.2470   -1.3553   -0.8128    5.0738    5.3420
       -1.1097    3.6946   -0.9852   -0.4699   -1.6610    2.2566
       -2.1939    0.6961   -1.2854   -1.6824   -1.8969    1.6364
        2.7559    0.2960   -1.5027   -0.0870    4.4716    2.8200
          ⋮
    
    

    Input Arguments

    collapse all

    Workspace as end-effector coordinates, specified as an M-by-3 matrix. M is the number of end-effector coordinates.

    Use the generateRobotWorkspace function to generate this workspace.

    Manipulability index, specified as an M-element vector. M is the number of end-effector coordinates.

    Name-Value Arguments

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: showWorkspaceAnalysis(wksp,mIdx,Voxelize=false,Parent=ax2) specifies the parent axes on which to plot a non-voxelized workspace analysis.

    Voxelization of the workspace analysis plot, specified as a logical 1 (true) or 0 (false).

    Example: showWorkspaceAnalysis(wksp,mIdx,Voxelize=false)

    Axes in which to plot the workspace analysis, specified as an Axes or UIAxes object. See the axes or uiaxes functions for more information.

    By default, showWorkspaceAnalysis plots in a new figure.

    Example: showWorkspaceAnalysis(wksp,mIdx,Parent=ax2)

    Output Arguments

    collapse all

    Axes used to the plot workspace analysis, returned as an Axes or UIAxes object. See the axes or uiaxes functions for more information.

    Example: showWorkspaceAnalysis(wksp,mIdx,Parent=ax2)

    Version History

    Introduced in R2024b