Main Content

copy

Create deep copy of planner object

    Description

    example

    plannerCopy = copy(planner) creates a deep copy of the planner object with the same properties.

    Examples

    collapse all

    Create an occupancy map from an example map and set the map resolution as 10 cells/meter.

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

    Create a state space and update the state space bounds to be the same as the map limits.

    ss = stateSpaceSE2;
    ss.StateBounds = [map.XWorldLimits; map.YWorldLimits; [-pi pi]];

    Create a state validator with stateSpaceSE2 using the map and set the validation distance.

    sv = validatorOccupancyMap(ss,Map=map);
    sv.ValidationDistance = 0.01;

    Create a plannerBiRRT object.

    planner = plannerBiRRT(ss,sv)
    planner = 
      plannerBiRRT with properties:
    
                    StateSpace: [1x1 stateSpaceSE2]
                StateValidator: [1x1 validatorOccupancyMap]
               MaxNumTreeNodes: 10000
                 MaxIterations: 10000
         MaxConnectionDistance: 0.1000
        EnableConnectHeuristic: 0
    
    

    Create a copy of the plannerBiRRT object.

    plannerNew = copy(planner)
    plannerNew = 
      plannerBiRRT with properties:
    
                    StateSpace: [1x1 stateSpaceSE2]
                StateValidator: [1x1 validatorOccupancyMap]
               MaxNumTreeNodes: 10000
                 MaxIterations: 10000
         MaxConnectionDistance: 0.1000
        EnableConnectHeuristic: 0
    
    

    Input Arguments

    collapse all

    Path planner, specified as a plannerBiRRT object.

    Output Arguments

    collapse all

    Copy of path planner, returned as a plannerBiRRT object.

    Version History

    Introduced in R2021a

    See Also

    Objects

    Functions