Main Content

report

Create benchmark report

Since R2022b

    Description

    report(plannerBM) creates and opens a benchmark report as a live script (.mlx) in the MATLAB® editor. The function saves the report in the current working directory with the default file name.

    Note

    The report function also exports the input plannerBenchmark object to a MAT file and places the file in a folder called plannerBenchmark, located in the same directory as the saved report.

    report(plannerBM,filename) specifies the name and location filename of the saved report.

    example

    report(plannerBM,filename,Name=Value) specifies options using one or more name-value arguments. For example, report(plannerBM,"reportFile",Open=false) creates a benchmark report file named reportFile.mlx and saves it in the current working directory, but does not open the report in the MATLAB editor.

    Examples

    collapse all

    Create an occupancy map from an example map.

    load("exampleMaps.mat","simpleMap");
    map = occupancyMap(simpleMap);

    Create a state validator in the SE(2) state space using the map.

    sv = validatorOccupancyMap(stateSpaceSE2,Map=map);

    Specify the start and goal states.

    start = [5 8 pi/2];
    goal = [7 18 pi/2];

    Create a plannerBenchmark object.

    pbo = plannerBenchmark(sv,start,goal);

    Define the function handles for the initialization functions of the planners.

    plannerHAFcn = @(sv)plannerHybridAStar(sv);
    plannerRRTSFcn = @(sv)plannerRRTStar(sv.StateSpace,sv);

    Define the function handle for the plan function, which is shared by both planners.

    plnFcn = @(initOut,s,g)plan(initOut,s,g);

    Add the path planners for benchmarking to the plannerBenchmark object.

    addPlanner(pbo,plnFcn,plannerHAFcn);
    addPlanner(pbo,plnFcn,plannerRRTSFcn,PlannerName="ppRRTStar");

    Configure the random number generator to ensure a repeatable result.

    rng("default")

    Run the path planners five times each to collect metrics.

    runCount = 5;
    runPlanner(pbo,runCount)
    Initializing plannerHAFcn_plnFcn ...
    Done.
    Planning a path from the start pose (5 8 1.5708) to the goal pose (7 18 1.5708) using plannerHAFcn_plnFcn.
    Executing run 1.
    Executing run 2.
    Executing run 3.
    Executing run 4.
    Executing run 5.
    Initializing ppRRTStar ...
    Done.
    Planning a path from the start pose (5 8 1.5708) to the goal pose (7 18 1.5708) using ppRRTStar.
    Executing run 1.
    Executing run 2.
    Executing run 3.
    Executing run 4.
    Executing run 5.
    

    Generate a benchmark report file named reportFile.mlx that contains the clearance and smoothness metrics. The function opens the report in the MATLAB editor.

    report(pbo,"reportFile",Metric=["clearance","smoothness"])

    Run the reportFile.mlx to visualize the benchmark results of the specified 2-D path planners for each specified metric.

    Input Arguments

    collapse all

    Path planner benchmark, specified as a plannerBenchmark object.

    Name of the report file, specified as string scalar or character vector. The file name can include an absolute path, relative path, or no path. Specifying the .mlx extension is optional.

    Example: "reportFile"

    Example: "reportFile.mlx"

    Example: "mydir/reportFile"

    Example: "mydir/reportFile.mlx"

    Example: "C:/mydir/reportFile"

    Example: "C:/mydir/reportFile.mlx"

    Data Types: char | string

    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: report(plannerBM,"reportFile",Open=false) creates a benchmark report file named reportFile.mlx in the current directory, but does not open the report in the MATLAB editor.

    Metrics to include in the report, specified as a string scalar, character vector, string array, or cell array of character vectors of supported metrics. The supported metrics are:

    • "clearance"

    • "executionTime"

    • "initializationTime"

    • "isPathValid"

    • "pathLength"

    • "smoothness"

    Example: Metric="clearance"

    Example: Metric='clearance'

    Example: Metric=["clearance","executionTime"]

    Example: Metric={'clearance','executionTime'}

    Data Types: char | string | cell

    Content sections to exclude from the report, specified as a string scalar, character vector, string array, or a cell array of character vectors of supported contents of exclusion. The supported contents of exclusion are:

    • "PathVisualization"

    • "DetailedTable"

    Specifying "PathVisualization" excludes the Visualize Path on Map section from the report. Specifying "DetailedTable" excludes the metric tables containing the metric results for the planners from the individual planning executions.

    Example: Exclude="PathVisualization"

    Example: Exclude='PathVisualization'

    Example: Exclude=["PathVisualization","DetailedTable"]

    Example: Exclude={'PathVisualization','DetailedTable'}

    Data Types: char | string | cell

    Report opens in the editor, specified as a logical 1 (true) or 0 (false). When you specify this argument as true, the function opens the report in the MATLAB editor. Otherwise, it does not open the report in the editor.

    Example: Open=false

    Data Types: logical

    Version History

    Introduced in R2022b

    See Also

    Objects

    Functions